QGIS/python/gui/qgsidentifymenu.sip

161 lines
4.5 KiB
Plaintext
Raw Normal View History

2017-04-19 15:51:02 +02:00
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/qgsidentifymenu.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
2014-09-17 11:23:22 +02:00
class QgsIdentifyMenu : QMenu
{
2017-04-19 15:51:02 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:class:`QgsMapToolIdentify`
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:class:`QgsAction`
2017-12-15 10:36:55 -04:00
It can also embed custom map layer actions, defined for this menu exclusively.
If used in a QgsMapToolIdentify, it is accessible via QgsMapToolIdentify.identifyMenu() and can be customized in the map tool sub-class.
2014-09-17 11:23:22 +02:00
%End
2017-04-19 15:51:02 +02:00
%TypeHeaderCode
#include "qgsidentifymenu.h"
%End
2014-09-17 11:23:22 +02:00
public:
enum MenuLevel
{
LayerLevel,
FeatureLevel
};
struct ActionData
{
ActionData();
2017-11-11 15:22:19 +10:00
%Docstring
Constructor for ActionData
%End
2017-04-19 15:51:02 +02:00
ActionData( QgsMapLayer *layer, QgsMapLayerAction *mapLayerAction = 0 );
2017-04-19 15:51:02 +02:00
ActionData( QgsMapLayer *layer, QgsFeatureId fid, QgsMapLayerAction *mapLayerAction = 0 );
2014-09-17 11:23:22 +02:00
bool mIsValid;
bool mAllResults;
bool mIsExternalAction;
2017-04-19 15:51:02 +02:00
QgsMapLayer *mLayer;
2014-09-17 11:23:22 +02:00
QgsFeatureId mFeatureId;
2014-09-17 16:15:39 +02:00
QgsIdentifyMenu::MenuLevel mLevel;
2017-04-19 15:51:02 +02:00
QgsMapLayerAction *mMapLayerAction;
2014-09-17 11:23:22 +02:00
};
2017-04-19 15:51:02 +02:00
explicit QgsIdentifyMenu( QgsMapCanvas *canvas );
%Docstring
QgsIdentifyMenu is a menu to be used to choose within a list of QgsMapTool.IdentifyReults
%End
2014-09-17 11:23:22 +02:00
~QgsIdentifyMenu();
void setAllowMultipleReturn( bool multipleReturn );
2017-04-19 15:51:02 +02:00
%Docstring
define if the menu executed can return multiple results (e.g. all results or all identified features of a vector layer)
%End
2014-09-17 11:23:22 +02:00
bool allowMultipleReturn();
void setExecWithSingleResult( bool execWithSingleResult );
2017-04-19 15:51:02 +02:00
%Docstring
define if the menu will be shown with a single idetify result
%End
2014-09-17 11:23:22 +02:00
bool execWithSingleResult();
void setExpressionContextScope( const QgsExpressionContextScope &scope );
%Docstring
2017-12-15 10:36:55 -04:00
Sets an expression context scope used to resolve underlying actions.
.. versionadded:: 3.0
%End
QgsExpressionContextScope expressionContextScope() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns an expression context scope used to resolve underlying actions.
.. versionadded:: 3.0
%End
2014-09-17 11:23:22 +02:00
void setShowFeatureActions( bool showFeatureActions );
2017-04-19 15:51:02 +02:00
%Docstring
define if attribute actions(1) and map layer actions(2) can be listed and run from the menu
2017-12-15 10:36:55 -04:00
2017-04-19 15:51:02 +02:00
.. note::
custom actions will be shown in any case if they exist.
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:class:`QgsAction`
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:class:`QgsMapLayerActionRegistry`
2017-04-19 15:51:02 +02:00
%End
2014-09-17 11:23:22 +02:00
bool showFeatureActions();
void setResultsIfExternalAction( bool resultsIfExternalAction );
2017-04-19 15:51:02 +02:00
%Docstring
setResultsIfExternalAction if set to false (default) the menu will not return any results if an external action has been triggered
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`setShowFeatureActions`
2017-04-19 15:51:02 +02:00
%End
2014-09-17 11:23:22 +02:00
bool resultsIfExternalAction();
void setMaxLayerDisplay( int maxLayerDisplay );
2017-04-19 15:51:02 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Defines the maximum number of layers displayed in the menu (default is 10).
2017-04-19 15:51:02 +02:00
.. note::
0 is unlimited.
%End
2014-09-17 11:23:22 +02:00
int maxLayerDisplay();
void setMaxFeatureDisplay( int maxFeatureDisplay );
2017-04-19 15:51:02 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Defines the maximum number of features displayed in the menu for vector layers (default is 10).
2017-04-19 15:51:02 +02:00
.. note::
0 is unlimited.
%End
2014-09-17 11:23:22 +02:00
int maxFeatureDisplay();
2017-04-19 15:51:02 +02:00
void addCustomAction( QgsMapLayerAction *action );
%Docstring
adds a new custom action to the menu
%End
2014-09-17 11:23:22 +02:00
void removeCustomActions();
2017-04-19 15:51:02 +02:00
%Docstring
remove all custom actions from the menu to be built
%End
2014-09-17 11:23:22 +02:00
2017-04-19 15:51:02 +02:00
QList<QgsMapToolIdentify::IdentifyResult> exec( const QList<QgsMapToolIdentify::IdentifyResult> &idResults, QPoint pos );
%Docstring
exec
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param idResults: the list of identify results to choose within
:param pos: the position where the menu will be executed
2017-04-19 15:51:02 +02:00
%End
protected:
virtual void closeEvent( QCloseEvent *e );
2017-04-19 15:51:02 +02:00
2014-09-17 11:23:22 +02:00
};
2017-04-19 15:51:02 +02:00
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/qgsidentifymenu.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/