Qgis button
Import
from pyqgis_wrapper.application import QgisZoomOut, QgisZoomIn, QgisPan, QgisIdentify
QgisActionButton(canvas, toolbar, name, checkable=True, parent=None)
¶
Bases: abc.ABC
Base class for the canvas button
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
canvas
|
qgis.gui.QgsMapCanvas
|
Canvas to link the button to |
required |
toolbar
|
qgis.PyQt.QtWidgets.QToolBar
|
Toolbar in which the button will appear |
required |
name
|
str
|
Name of the button |
required |
checkable
|
bool
|
If True the button will have an on/off state, defaults to True |
True
|
parent
|
typing.Optional[qgis.PyQt.QtWidgets.QWidget]
|
Parent to use for display a centedred message Fallback to the canavs if n parent is provided, defaults to None |
None
|
Source code in pyqgis_wrapper/application/qgis_app.py
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 | |
create_action(name, checkable)
¶
Create an action button and connect it to an event.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Name of the button |
required |
checkable
|
bool
|
If True the button will have an on/off state |
required |
Source code in pyqgis_wrapper/application/qgis_app.py
88 89 90 91 92 93 94 95 96 97 98 99 | |
create_tool()
abstractmethod
¶
Create a tool to be triggered when an event occurs.
Source code in pyqgis_wrapper/application/qgis_app.py
101 102 103 104 105 106 | |
on_trigger()
abstractmethod
¶
Call to the tool when the event occurs.
Source code in pyqgis_wrapper/application/qgis_app.py
108 109 110 111 112 113 | |
QgisZoomOut(canvas, toolbar, name, checkable=True, parent=None)
¶
Bases: pyqgis_wrapper.application.qgis_app.QgisActionButton
Zoom out button
Source code in pyqgis_wrapper/application/qgis_app.py
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 | |
create_tool()
¶
Create a tool to be triggered when an event occurs.
Source code in pyqgis_wrapper/application/qgis_app.py
139 140 141 142 143 | |
on_trigger()
¶
Call to the tool when the event occurs.
Source code in pyqgis_wrapper/application/qgis_app.py
145 146 147 148 149 | |
QgisZoomIn(canvas, toolbar, name, checkable=True, parent=None)
¶
Bases: pyqgis_wrapper.application.qgis_app.QgisActionButton
Zoom In button
Source code in pyqgis_wrapper/application/qgis_app.py
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 | |
create_tool()
¶
Create a tool to be triggered when an event occurs.
Source code in pyqgis_wrapper/application/qgis_app.py
121 122 123 124 125 | |
on_trigger()
¶
Call to the tool when the event occurs.
Source code in pyqgis_wrapper/application/qgis_app.py
127 128 129 130 131 | |
QgisPan(canvas, toolbar, name, checkable=True, parent=None)
¶
Bases: pyqgis_wrapper.application.qgis_app.QgisActionButton
Pan button
Source code in pyqgis_wrapper/application/qgis_app.py
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 | |
create_tool()
¶
Create a tool to be triggered when an event occurs.
Source code in pyqgis_wrapper/application/qgis_app.py
157 158 159 160 161 | |
on_trigger()
¶
Call to the tool when the event occurs.
Source code in pyqgis_wrapper/application/qgis_app.py
163 164 165 166 167 | |
QgisIdentify(canvas, toolbar, name, checkable=True, parent=None)
¶
Bases: pyqgis_wrapper.application.qgis_app.QgisActionButton
Identify button
Source code in pyqgis_wrapper/application/qgis_app.py
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 | |
create_tool()
¶
Create a tool to be triggered when an event occurs.
Source code in pyqgis_wrapper/application/qgis_app.py
175 176 177 178 179 180 181 182 | |
on_trigger()
¶
Call to the tool when the event occurs.
Source code in pyqgis_wrapper/application/qgis_app.py
184 185 186 187 188 | |
on_click(point, button)
¶
Identify the active layer (vector or raster) at the clicked position.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
point
|
qgis.core.QgsPointXY
|
Coordinates of the mouse event |
required |
button
|
qgis.PyQt.QtCore.Qt.MouseButton
|
Button clicked (unused) but i have to use it for the events to work. |
required |
Source code in pyqgis_wrapper/application/qgis_app.py
190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 | |