File: qgsidentifymenu.sip.in

package info (click to toggle)
qgis 3.22.16%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,186,020 kB
  • sloc: cpp: 1,275,562; python: 194,091; xml: 15,597; perl: 3,471; sh: 3,368; sql: 2,485; ansic: 2,219; yacc: 1,056; lex: 574; javascript: 504; lisp: 411; makefile: 227
file content (171 lines) | stat: -rw-r--r-- 5,199 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
/************************************************************************
 * This file has been generated automatically from                      *
 *                                                                      *
 * src/gui/qgsidentifymenu.h                                            *
 *                                                                      *
 * Do not edit manually ! Edit header and run scripts/sipify.pl again   *
 ************************************************************************/





class QgsIdentifyMenu : QMenu
{
%Docstring(signature="appended")
The QgsIdentifyMenu class builds a menu to be used with identify results (:py:class:`QgsMapToolIdentify`).
It is customizable and can display attribute actions (:py:class:`QgsAction`) as well as map layer actions (\see QgsMapLayerAction).
It can also embed custom map layer actions, defined for this menu exclusively.
If used in a :py:class:`QgsMapToolIdentify`, it is accessible via :py:func:`QgsMapToolIdentify.identifyMenu()` and can be customized in the map tool sub-class.
%End

%TypeHeaderCode
#include "qgsidentifymenu.h"
%End
  public:
    enum MenuLevel
    {
      LayerLevel,
      FeatureLevel
    };

    struct ActionData
    {
      ActionData();
%Docstring
Constructor for ActionData
%End

      ActionData( QgsMapLayer *layer, QgsMapLayerAction *mapLayerAction = 0 );

      ActionData( QgsMapLayer *layer, QgsFeatureId fid, QgsMapLayerAction *mapLayerAction = 0 );

      bool mIsValid;
      bool mAllResults;
      bool mIsExternalAction;
      QgsMapLayer *mLayer;
      QgsFeatureId mFeatureId;
      QgsIdentifyMenu::MenuLevel mLevel;
      QgsMapLayerAction *mMapLayerAction;
    };

    explicit QgsIdentifyMenu( QgsMapCanvas *canvas );
%Docstring
QgsIdentifyMenu is a menu to be used to choose within a list of QgsMapTool.IdentifyReults
%End

    ~QgsIdentifyMenu();

    void setAllowMultipleReturn( bool multipleReturn );
%Docstring
define if the menu executed can return multiple results (e.g. all results or all identified features of a vector layer)
%End
    bool allowMultipleReturn();

    void setExecWithSingleResult( bool execWithSingleResult );
%Docstring
define if the menu will be shown with a single identify result
%End
    bool execWithSingleResult();

    void setExpressionContextScope( const QgsExpressionContextScope &scope );
%Docstring
Sets an expression context scope used to resolve underlying actions.

.. versionadded:: 3.0
%End

    QgsExpressionContextScope expressionContextScope() const;
%Docstring
Returns an expression context scope used to resolve underlying actions.

.. versionadded:: 3.0
%End

    void setShowFeatureActions( bool showFeatureActions );
%Docstring
define if attribute actions(1) and map layer actions(2) can be listed and run from the menu

.. note::

   custom actions will be shown in any case if they exist.

.. note::

   (1) attribute actions are defined by the user in the layer properties :py:class:`QgsAction`

.. note::

   (2) map layer actions are built-in c++ actions or actions which are defined by a Python plugin :py:class:`QgsMapLayerActionRegistry`
%End
    bool showFeatureActions();

    void setResultsIfExternalAction( bool resultsIfExternalAction );
%Docstring
setResultsIfExternalAction if set to ``False`` (default) the menu will not return any results if an external action has been triggered

.. note::

   external action can be either custom actions or feature / map layer actions (:py:func:`setShowFeatureActions`)
%End
    bool resultsIfExternalAction();

    void setMaxLayerDisplay( int maxLayerDisplay );
%Docstring
Defines the maximum number of layers displayed in the menu (default is 10).

.. note::

   0 is unlimited.
%End
    int maxLayerDisplay();

    void setMaxFeatureDisplay( int maxFeatureDisplay );
%Docstring
Defines the maximum number of features displayed in the menu for vector layers (default is 10).

.. note::

   0 is unlimited.
%End
    int maxFeatureDisplay();

    void addCustomAction( QgsMapLayerAction *action );
%Docstring
adds a new custom action to the menu
%End

    void removeCustomActions();
%Docstring
remove all custom actions from the menu to be built
%End

    QList<QgsMapToolIdentify::IdentifyResult> exec( const QList<QgsMapToolIdentify::IdentifyResult> &idResults, QPoint pos );
%Docstring
exec

:param idResults: the list of identify results to choose within
:param pos: the position where the menu will be executed
%End

    static void styleHighlight( QgsHighlight *highlight );
%Docstring
Applies style from the settings to the highlight

.. versionadded:: 3.8
%End

  protected:
    virtual void closeEvent( QCloseEvent *e );


};


/************************************************************************
 * This file has been generated automatically from                      *
 *                                                                      *
 * src/gui/qgsidentifymenu.h                                            *
 *                                                                      *
 * Do not edit manually ! Edit header and run scripts/sipify.pl again   *
 ************************************************************************/