-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Action on double click layout item #59566
base: master
Are you sure you want to change the base?
Conversation
🪟 Windows buildsDownload Windows builds of this PR for testing. 🪟 Windows Qt6 buildsDownload Windows Qt6 builds of this PR for testing. |
* | ||
* \since QGIS 3.42 | ||
*/ | ||
enum class MouseHandlesAction : int |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'll need to add the python compatibility code to this (ie SIP_MONKEYPATCH_SCOPEENUM_UNNEST), to maintain existing API.
See eg
Line 508 in c61ed98
enum class FeatureCountState SIP_MONKEYPATCH_SCOPEENUM_UNNEST( QgsVectorDataProvider, FeatureCountState ) : int |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it really necessary? QgsGraphicsViewMouseHandles is not part of the PyQGIS API
Nice work, this is a great API feature to have! |
Description
Add
QgsLayoutItemAbstractGuiMetadata::handleDoubleClick
to define an action that will be called when a layout item is double clicked.This new method takes two arguments : a
QgsLayoutItem
, and aQgis::MouseHandlesAction
(new enum that replacesQgsGraphicsViewMouseHandles::MouseAction
), which allow to define custom behavior if a specific mouse handle is doublecliked (could be used to resize a QgsLayoutItemLabel to fit the current text for instance).As an example, this PR fixes #46462.