Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add framework to allow for flexible interaction blocking with map canvas
- Loading branch information
1 parent
baec06c
commit 3ebd097
Showing
9 changed files
with
201 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# The following has been generated automatically from src/gui/qgsmapcanvasinteractionblocker.h | ||
# monkey patching scoped based enum | ||
QgsMapCanvasInteractionBlocker.Interaction.MapPanOnSingleClick.__doc__ = "A map pan interaction caused by a single click and release on the map canvas" | ||
QgsMapCanvasInteractionBlocker.Interaction.__doc__ = '\n\n' + '* ``MapPanOnSingleClick``: ' + QgsMapCanvasInteractionBlocker.Interaction.MapPanOnSingleClick.__doc__ | ||
# -- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
python/gui/auto_generated/qgsmapcanvasinteractionblocker.sip.in
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/************************************************************************ | ||
* This file has been generated automatically from * | ||
* * | ||
* src/gui/qgsmapcanvasinteractionblocker.h * | ||
* * | ||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | ||
************************************************************************/ | ||
|
||
|
||
|
||
|
||
class QgsMapCanvasInteractionBlocker | ||
{ | ||
%Docstring | ||
An interface for objects which block interactions with a QgsMapCanvas. | ||
|
||
.. versionadded:: 3.14 | ||
%End | ||
|
||
%TypeHeaderCode | ||
#include "qgsmapcanvasinteractionblocker.h" | ||
%End | ||
public: | ||
|
||
enum class Interaction | ||
{ | ||
MapPanOnSingleClick, | ||
}; | ||
|
||
virtual ~QgsMapCanvasInteractionBlocker(); | ||
|
||
virtual bool blockCanvasInteraction( Interaction interaction ) const = 0; | ||
%Docstring | ||
Returns ``True`` if the specified ``interaction`` should be blocked. | ||
%End | ||
|
||
}; | ||
|
||
/************************************************************************ | ||
* This file has been generated automatically from * | ||
* * | ||
* src/gui/qgsmapcanvasinteractionblocker.h * | ||
* * | ||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | ||
************************************************************************/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/*************************************************************************** | ||
qgsmapcanvasinteractionblocker.h | ||
-------------------------------- | ||
begin : May 2020 | ||
copyright : (C) 2020 by Nyall Dawson | ||
email : nyall dot dawson at gmail dot com | ||
***************************************************************************/ | ||
|
||
/*************************************************************************** | ||
* * | ||
* This program is free software; you can redistribute it and/or modify * | ||
* it under the terms of the GNU General Public License as published by * | ||
* the Free Software Foundation; either version 2 of the License, or * | ||
* (at your option) any later version. * | ||
* * | ||
***************************************************************************/ | ||
|
||
#ifndef QGSMAPCANVASINTERACTIONBLOCKER_H | ||
#define QGSMAPCANVASINTERACTIONBLOCKER_H | ||
|
||
#include "qgis_gui.h" | ||
|
||
/** | ||
* \class QgsMapCanvasInteractionBlocker | ||
* \ingroup gui | ||
* An interface for objects which block interactions with a QgsMapCanvas. | ||
* \since QGIS 3.14 | ||
*/ | ||
class GUI_EXPORT QgsMapCanvasInteractionBlocker | ||
{ | ||
public: | ||
|
||
enum class Interaction : int | ||
{ | ||
MapPanOnSingleClick = 1 << 0, //!< A map pan interaction caused by a single click and release on the map canvas | ||
}; | ||
|
||
virtual ~QgsMapCanvasInteractionBlocker() = default; | ||
|
||
/** | ||
* Returns TRUE if the specified \a interaction should be blocked. | ||
*/ | ||
virtual bool blockCanvasInteraction( Interaction interaction ) const = 0; | ||
|
||
}; | ||
|
||
#endif // QGSMAPCANVASINTERACTIONBLOCKER_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters