Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
add SIP bindings
  • Loading branch information
alexbruy committed Jan 10, 2017
1 parent 17905ca commit 6c3c533
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 0 deletions.
1 change: 1 addition & 0 deletions python/core/core.sip
Expand Up @@ -65,6 +65,7 @@
%Include qgsgeometryvalidator.sip
%Include qgsgml.sip
%Include qgsgmlschema.sip
%Include qgshelp.sip
%Include qgshistogram.sip
%Include qgsinterval.sip
%Include qgsjsonutils.sip
Expand Down
7 changes: 7 additions & 0 deletions python/core/qgsapplication.sip
Expand Up @@ -437,6 +437,13 @@ static void qtgui_UpdatePyArgv(PyObject *argvlist, int argc, char **argv)
*/
static QgsMessageLog* messageLog();

/**
* Returns the application's help viewer, used for displaying
* help topic for the given key
* @note added in QGIS 3.0
*/
static QgsHelp* helpViewer();

%If(ANDROID)
//dummy method to workaround sip generation issue issue
bool x11EventFilter ( XEvent * event );
Expand Down
50 changes: 50 additions & 0 deletions python/core/qgshelp.sip
@@ -0,0 +1,50 @@
/** \ingroup core
* \class QgsHelp
* @brief Helper class for showing help topic URI for the given key.
*
* Help can be stored online, on the local directory or on the intranet
* server. Location of the QGIS help can be configured in QGIS options.
* Multiple locations are supported, they will be used in order of
* preference, from top to bottom.
*
* URI construction takes in account following information:
* - QGIS version
* - language of the QGIS UI
*
* If no help found, default error page with information how to setup
* help system will be shown.
*
* This class can be created directly, or accessed via
* QgsApplication::helpViewer().
*
* @note added in QGIS 3.0
*/
class QgsHelp : QObject
{
%TypeHeaderCode
#include <qgshelp.h>
%End

public:

/** Constructor for QgsHelp.
* @param parent parent QObject
*/
QgsHelp( QObject* parent = nullptr );

virtual ~QgsHelp();

/** Opens help topic for the given help key using default system
* web browser. If help topic not found, builtin error page shown.
* @param key key which identified help topic
* @note added in QGIS 3.0
*/
void openHelp( const QString& key ) const;

/** Returns URI of the help topic for the given key. If help topic
* not found, URI of the builtin error page returned.
* @param key key which identified help topic
* @note added in QGIS 3.0
*/
QUrl helpUrl( const QString& key ) const;
};

0 comments on commit 6c3c533

Please sign in to comment.