mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-28 00:17:30 -05:00
Copy the same model as QgsMapCanvas uses, with separate classes for individual interaction tools instead of keeping all the logic in the QGraphicsView subclass (as is done with composer)
116 lines
3.1 KiB
Plaintext
116 lines
3.1 KiB
Plaintext
/************************************************************************
|
|
* This file has been generated automatically from *
|
|
* *
|
|
* src/gui/layout/qgslayoutview.h *
|
|
* *
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
class QgsLayoutView: QGraphicsView
|
|
{
|
|
%Docstring
|
|
A graphical widget to display and interact with QgsLayouts.
|
|
|
|
QgsLayoutView manages the layout interaction tools and mouse/key events.
|
|
|
|
.. versionadded:: 3.0
|
|
%End
|
|
|
|
%TypeHeaderCode
|
|
#include "qgslayoutview.h"
|
|
%End
|
|
public:
|
|
|
|
enum Tool
|
|
{
|
|
ToolSelect,
|
|
ToolAddItem,
|
|
};
|
|
|
|
QgsLayoutView( QWidget *parent /TransferThis/ = 0 );
|
|
%Docstring
|
|
Constructor for QgsLayoutView.
|
|
%End
|
|
|
|
QgsLayout *currentLayout();
|
|
%Docstring
|
|
Returns the current layout associated with the view.
|
|
.. seealso:: setCurrentLayout()
|
|
.. seealso:: layoutSet()
|
|
:rtype: QgsLayout
|
|
%End
|
|
|
|
void setCurrentLayout( QgsLayout *layout /KeepReference/ );
|
|
%Docstring
|
|
Sets the current ``layout`` to edit in the view.
|
|
.. seealso:: currentLayout()
|
|
.. seealso:: layoutSet()
|
|
%End
|
|
|
|
QgsLayoutViewTool *tool();
|
|
%Docstring
|
|
Returns the currently active tool for the view.
|
|
.. seealso:: setTool()
|
|
:rtype: QgsLayoutViewTool
|
|
%End
|
|
|
|
void setTool( QgsLayoutViewTool *tool );
|
|
%Docstring
|
|
Sets the ``tool`` currently being used in the view.
|
|
.. seealso:: unsetTool()
|
|
.. seealso:: tool()
|
|
%End
|
|
|
|
void unsetTool( QgsLayoutViewTool *tool );
|
|
%Docstring
|
|
Unsets the current view tool, if it matches the specified ``tool``.
|
|
|
|
This is called from destructor of view tools to make sure
|
|
that the tool won't be used any more.
|
|
You don't have to call it manually, QgsLayoutViewTool takes care of it.
|
|
%End
|
|
|
|
signals:
|
|
|
|
void layoutSet( QgsLayout *layout );
|
|
%Docstring
|
|
Emitted when a ``layout`` is set for the view.
|
|
.. seealso:: currentLayout()
|
|
.. seealso:: setCurrentLayout()
|
|
%End
|
|
|
|
void toolSet( QgsLayoutViewTool *tool );
|
|
%Docstring
|
|
Emitted when the current ``tool`` is changed.
|
|
.. seealso:: setTool()
|
|
%End
|
|
|
|
protected:
|
|
virtual void mousePressEvent( QMouseEvent *event );
|
|
|
|
virtual void mouseReleaseEvent( QMouseEvent *event );
|
|
|
|
virtual void mouseMoveEvent( QMouseEvent *event );
|
|
|
|
virtual void mouseDoubleClickEvent( QMouseEvent *event );
|
|
|
|
virtual void wheelEvent( QWheelEvent *event );
|
|
|
|
virtual void keyPressEvent( QKeyEvent *event );
|
|
|
|
virtual void keyReleaseEvent( QKeyEvent *event );
|
|
|
|
|
|
};
|
|
|
|
/************************************************************************
|
|
* This file has been generated automatically from *
|
|
* *
|
|
* src/gui/layout/qgslayoutview.h *
|
|
* *
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
************************************************************************/
|