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 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204
|
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/layout/qgslayoutviewtool.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
%ModuleHeaderCode
#include <qgslayoutviewtooladditem.h>
%End
class QgsLayoutViewTool : QObject
{
%Docstring(signature="appended")
Abstract base class for all layout view tools.
Layout view tools are user interactive tools for manipulating and adding items
to :py:class:`QgsLayoutView` widgets.
.. versionadded:: 3.0
%End
%TypeHeaderCode
#include "qgslayoutviewtool.h"
%End
%ConvertToSubClassCode
if ( dynamic_cast<QgsLayoutViewToolAddItem *>( sipCpp ) != NULL )
sipType = sipType_QgsLayoutViewToolAddItem;
else
sipType = NULL;
%End
public:
enum Flag
{
FlagSnaps,
};
typedef QFlags<QgsLayoutViewTool::Flag> Flags;
~QgsLayoutViewTool();
QgsLayoutViewTool::Flags flags() const;
%Docstring
Returns the current combination of flags set for the tool.
.. seealso:: :py:func:`setFlags`
%End
virtual void layoutMoveEvent( QgsLayoutViewMouseEvent *event );
%Docstring
Mouse move event for overriding. Default implementation does nothing.
%End
virtual void layoutDoubleClickEvent( QgsLayoutViewMouseEvent *event );
%Docstring
Mouse double-click event for overriding. Default implementation does nothing.
%End
virtual void layoutPressEvent( QgsLayoutViewMouseEvent *event );
%Docstring
Mouse press event for overriding. Default implementation does nothing.
Note that subclasses must ensure that they correctly handle cases
when a layoutPressEvent is called without a corresponding
layoutReleaseEvent (e.g. due to tool being changed mid way
through a press-release operation).
%End
virtual void layoutReleaseEvent( QgsLayoutViewMouseEvent *event );
%Docstring
Mouse release event for overriding. Default implementation does nothing.
Note that subclasses must ensure that they correctly handle cases
when a layoutPressEvent is called without a corresponding
layoutReleaseEvent (e.g. due to tool being changed mid way
through a press-release operation).
%End
virtual void wheelEvent( QWheelEvent *event );
%Docstring
Mouse wheel event for overriding. Default implementation does nothing.
%End
virtual void keyPressEvent( QKeyEvent *event );
%Docstring
Key press event for overriding. Default implementation does nothing.
%End
virtual void keyReleaseEvent( QKeyEvent *event );
%Docstring
Key release event for overriding. Default implementation does nothing.
%End
void setAction( QAction *action );
%Docstring
Associates an ``action`` with this tool. When the setLayoutTool
method of :py:class:`QgsLayoutView` is called the action's state will be set to on.
Usually this will cause a toolbutton to appear pressed in and
the previously used toolbutton to pop out.
.. seealso:: :py:func:`action`
%End
QAction *action();
%Docstring
Returns the action associated with the tool or ``None`` if no action is associated.
.. seealso:: :py:func:`setAction`
%End
void setCursor( const QCursor &cursor );
%Docstring
Sets a user defined ``cursor`` for use when the tool is active.
%End
virtual void activate();
%Docstring
Called when tool is set as the currently active layout tool.
Overridden implementations must take care to call the base class implementation.
%End
virtual void deactivate();
%Docstring
Called when tool is deactivated.
Overridden implementations must take care to call the base class implementation.
%End
QString toolName() const;
%Docstring
Returns a user-visible, translated name for the tool.
%End
QgsLayoutView *view() const;
%Docstring
Returns the view associated with the tool.
.. seealso:: :py:func:`layout`
%End
QgsLayout *layout() const;
%Docstring
Returns the layout associated with the tool.
.. seealso:: :py:func:`view`
%End
virtual QList< QgsLayoutItem * > ignoredSnapItems() const;
%Docstring
Returns a list of items which should be ignored while snapping events
for this tool.
%End
signals:
void activated();
%Docstring
Emitted when the tool is activated.
%End
void deactivated();
%Docstring
Emitted when the tool is deactivated.
%End
void itemFocused( QgsLayoutItem *item );
%Docstring
Emitted when an ``item`` is "focused" by the tool, i.e. it should become the active
item and should have its properties displayed in any designer windows.
%End
protected:
void setFlags( QgsLayoutViewTool::Flags flags );
%Docstring
Sets the combination of ``flags`` that will be used for the tool.
.. seealso:: :py:func:`flags`
%End
QgsLayoutViewTool( QgsLayoutView *view /TransferThis/, const QString &name );
%Docstring
Constructor for QgsLayoutViewTool, taking a layout ``view`` and
tool ``name`` as parameters.
%End
bool isClickAndDrag( QPoint startViewPoint, QPoint endViewPoint ) const;
%Docstring
Returns ``True`` if a mouse press/release operation which started at
``startViewPoint`` and ended at ``endViewPoint`` should be considered
a "click and drag". If ``False`` is returned, the operation should be
instead treated as just a click on ``startViewPoint``.
%End
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/layout/qgslayoutviewtool.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
|