QGIS/python/gui/auto_generated/layout/qgslayoutview.sip.in

621 lines
14 KiB
Plaintext
Raw Normal View History

2017-07-04 11:43:29 +10:00
/************************************************************************
* 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
2017-12-15 10:36:55 -04:00
A graphical widget to display and interact with QgsLayouts.
2017-07-04 11:43:29 +10:00
2017-12-15 10:36:55 -04:00
QgsLayoutView manages the layout interaction tools and mouse/key events.
2017-07-04 11:43:29 +10:00
.. versionadded:: 3.0
%End
%TypeHeaderCode
#include "qgslayoutview.h"
2018-10-23 08:04:00 +10:00
%End
%ConvertToSubClassCode
if ( qobject_cast<QgsLayoutView *>( sipCpp ) )
sipType = sipType_QgsLayoutView;
else
sipType = NULL;
2017-07-04 11:43:29 +10:00
%End
public:
enum ClipboardOperation
{
ClipboardCut,
ClipboardCopy,
};
enum PasteMode
{
PasteModeCursor,
PasteModeCenter,
PasteModeInPlace,
};
2017-07-04 11:43:29 +10:00
QgsLayoutView( QWidget *parent /TransferThis/ = 0 );
%Docstring
2017-12-15 10:36:55 -04:00
Constructor for QgsLayoutView.
2017-07-04 11:43:29 +10:00
%End
~QgsLayoutView();
2017-07-04 11:43:29 +10:00
QgsLayout *currentLayout();
%Docstring
2017-12-15 10:36:55 -04:00
Returns the current layout associated with the view.
.. seealso:: :py:func:`setCurrentLayout`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`layoutSet`
2017-07-04 11:43:29 +10:00
%End
2017-07-04 11:43:29 +10:00
void setCurrentLayout( QgsLayout *layout /KeepReference/ );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the current ``layout`` to edit in the view.
.. seealso:: :py:func:`currentLayout`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`layoutSet`
2017-07-04 11:43:29 +10:00
%End
QgsLayoutViewTool *tool();
%Docstring
2017-12-15 10:36:55 -04:00
Returns the currently active tool for the view.
.. seealso:: :py:func:`setTool`
%End
void setTool( QgsLayoutViewTool *tool );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the ``tool`` currently being used in the view.
.. seealso:: :py:func:`unsetTool`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`tool`
%End
void unsetTool( QgsLayoutViewTool *tool );
%Docstring
2017-12-15 10:36:55 -04:00
Unsets the current view tool, if it matches the specified ``tool``.
2017-12-15 10:36:55 -04:00
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
2017-10-06 12:46:22 +10:00
void setPreviewModeEnabled( bool enabled );
%Docstring
2017-12-15 10:36:55 -04:00
Sets whether a preview effect should be used to alter the view's appearance.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param enabled: Set to true to enable the preview effect on the view.
.. seealso:: :py:func:`setPreviewMode`
2017-10-06 12:46:22 +10:00
%End
bool previewModeEnabled() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns true if a preview effect is being used to alter the view's appearance.
.. seealso:: :py:func:`setPreviewModeEnabled`
2017-10-06 12:46:22 +10:00
%End
void setPreviewMode( QgsPreviewEffect::PreviewMode mode );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the preview ``mode`` which should be used to modify the view's appearance. Preview modes are only used
if previewModeEnabled() is true.
.. seealso:: :py:func:`setPreviewModeEnabled`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`previewMode`
2017-10-06 12:46:22 +10:00
%End
QgsPreviewEffect::PreviewMode previewMode() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the preview mode which may be used to modify the view's appearance. Preview modes are only used
if previewModeEnabled() is true.
.. seealso:: :py:func:`setPreviewMode`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`previewModeEnabled`
2017-10-06 12:46:22 +10:00
%End
void scaleSafe( double scale );
%Docstring
2017-12-15 10:36:55 -04:00
Scales the view in a safe way, by limiting the acceptable range
of the scale applied. The ``scale`` parameter specifies the zoom factor to scale the view by.
%End
void setZoomLevel( double level );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the zoom ``level`` for the view, where a zoom level of 1.0 corresponds to 100%.
%End
2017-07-11 14:21:35 +10:00
void setHorizontalRuler( QgsLayoutRuler *ruler );
%Docstring
2017-12-15 10:36:55 -04:00
Sets a horizontal ``ruler`` to synchronize with the view state.
.. seealso:: :py:func:`setVerticalRuler`
2017-07-11 14:21:35 +10:00
%End
void setVerticalRuler( QgsLayoutRuler *ruler );
%Docstring
2017-12-15 10:36:55 -04:00
Sets a vertical ``ruler`` to synchronize with the view state.
.. seealso:: :py:func:`setHorizontalRuler`
2017-07-11 14:21:35 +10:00
%End
void setMenuProvider( QgsLayoutViewMenuProvider *provider /Transfer/ );
%Docstring
2017-12-15 10:36:55 -04:00
Sets a ``provider`` for context menus. Ownership of the provider is transferred to the view.
.. seealso:: :py:func:`menuProvider`
%End
QgsLayoutViewMenuProvider *menuProvider() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the provider for context menus. Returned value may be None if no provider is set.
.. seealso:: :py:func:`setMenuProvider`
%End
int currentPage() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the page visible in the view. This method
considers the page at the center of the view as the current visible
page.
.. seealso:: :py:func:`pageChanged`
%End
QList< QgsLayoutItemPage * > visiblePages() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns a list of page items which are currently visible in the view.
.. seealso:: :py:func:`visiblePageNumbers`
%End
QList< int > visiblePageNumbers() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns a list of page numbers for pages which are currently visible in the view.
.. seealso:: :py:func:`visiblePages`
%End
2017-10-03 21:48:18 +10:00
void alignSelectedItems( QgsLayoutAligner::Alignment alignment );
%Docstring
2017-12-15 10:36:55 -04:00
Aligns all selected items using the specified ``alignment``.
.. seealso:: :py:func:`distributeSelectedItems`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`resizeSelectedItems`
%End
void distributeSelectedItems( QgsLayoutAligner::Distribution distribution );
%Docstring
2017-12-15 10:36:55 -04:00
Distributes all selected items using the specified ``distribution``.
.. seealso:: :py:func:`alignSelectedItems`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`resizeSelectedItems`
%End
void resizeSelectedItems( QgsLayoutAligner::Resize resize );
%Docstring
2017-12-15 10:36:55 -04:00
Resizes all selected items using the specified ``resize`` mode.
.. seealso:: :py:func:`alignSelectedItems`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`distributeSelectedItems`
2017-10-03 21:48:18 +10:00
%End
void copySelectedItems( ClipboardOperation operation );
%Docstring
2017-12-15 10:36:55 -04:00
Cuts or copies the selected items, respecting the specified ``operation``.
.. seealso:: :py:func:`copyItems`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`pasteItems`
%End
void copyItems( const QList< QgsLayoutItem * > &items, ClipboardOperation operation );
%Docstring
2017-12-15 10:36:55 -04:00
Cuts or copies the a list of ``items``, respecting the specified ``operation``.
.. seealso:: :py:func:`copySelectedItems`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`pasteItems`
%End
QList< QgsLayoutItem * > pasteItems( PasteMode mode );
%Docstring
2017-12-15 10:36:55 -04:00
Pastes items from clipboard, using the specified ``mode``.
2017-12-15 10:36:55 -04:00
A list of pasted items is returned.
.. seealso:: :py:func:`copySelectedItems`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`hasItemsInClipboard`
%End
QList< QgsLayoutItem * > pasteItems( QPointF layoutPoint );
%Docstring
2017-12-15 10:36:55 -04:00
Pastes items from clipboard, at the specified ``layoutPoint``,
in layout units.
A list of pasted items is returned.
.. seealso:: :py:func:`copySelectedItems`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`hasItemsInClipboard`
%End
bool hasItemsInClipboard() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns true if the current clipboard contains layout items.
.. seealso:: :py:func:`pasteItems`
%End
2017-10-17 20:21:53 +10:00
QPointF deltaForKeyEvent( QKeyEvent *event );
%Docstring
2017-12-15 10:36:55 -04:00
Returns the delta (in layout coordinates) by which to move items
for the given key ``event``.
%End
void setSectionLabel( const QString &label );
%Docstring
Sets a section ``label``, to display above the first page shown in the
view.
2017-10-17 20:21:53 +10:00
%End
public slots:
void zoomFull();
%Docstring
2017-12-15 10:36:55 -04:00
Zooms the view to the full extent of the layout.
.. seealso:: :py:func:`zoomIn`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`zoomOut`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`zoomActual`
%End
void zoomWidth();
%Docstring
2017-12-15 10:36:55 -04:00
Zooms the view to the full width of the layout.
.. seealso:: :py:func:`zoomIn`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`zoomOut`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`zoomActual`
%End
void zoomIn();
%Docstring
2017-12-15 10:36:55 -04:00
Zooms in to the view by a preset amount.
.. seealso:: :py:func:`zoomFull`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`zoomOut`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`zoomActual`
%End
void zoomOut();
%Docstring
2017-12-15 10:36:55 -04:00
Zooms out of the view by a preset amount.
.. seealso:: :py:func:`zoomFull`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`zoomIn`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`zoomActual`
%End
void zoomActual();
%Docstring
2017-12-15 10:36:55 -04:00
Zooms to the actual size of the layout.
.. seealso:: :py:func:`zoomFull`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`zoomIn`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`zoomOut`
%End
void emitZoomLevelChanged();
2017-10-03 11:38:03 +10:00
void selectAll();
%Docstring
2017-12-15 10:36:55 -04:00
Selects all items in the view.
.. seealso:: :py:func:`deselectAll`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`invertSelection`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`selectNextItemAbove`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`selectNextItemBelow`
2017-10-03 11:38:03 +10:00
%End
void deselectAll();
%Docstring
2017-12-15 10:36:55 -04:00
Deselects all items in the view.
.. seealso:: :py:func:`selectAll`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`invertSelection`
2017-10-03 11:38:03 +10:00
%End
void invertSelection();
%Docstring
2017-12-15 10:36:55 -04:00
Inverts the current selection, selecting deselected items
and deselecting and selected items.
.. seealso:: :py:func:`selectAll`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`deselectAll`
2017-10-03 15:06:47 +10:00
%End
void selectNextItemAbove();
%Docstring
2017-12-15 10:36:55 -04:00
Selects the next item above the existing selection, by item z order.
.. seealso:: :py:func:`selectNextItemBelow`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`selectAll`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`deselectAll`
2017-10-03 15:06:47 +10:00
%End
void selectNextItemBelow();
%Docstring
2017-12-15 10:36:55 -04:00
Selects the next item below the existing selection, by item z order.
.. seealso:: :py:func:`selectNextItemAbove`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`selectAll`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`deselectAll`
%End
void raiseSelectedItems();
%Docstring
2017-12-15 10:36:55 -04:00
Raises the selected items up the z-order.
.. seealso:: :py:func:`lowerSelectedItems`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`moveSelectedItemsToTop`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`moveSelectedItemsToBottom`
%End
void lowerSelectedItems();
%Docstring
2017-12-15 10:36:55 -04:00
Lowers the selected items down the z-order.
.. seealso:: :py:func:`raiseSelectedItems`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`moveSelectedItemsToTop`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`moveSelectedItemsToBottom`
%End
void moveSelectedItemsToTop();
%Docstring
2017-12-15 10:36:55 -04:00
Raises the selected items to the top of the z-order.
.. seealso:: :py:func:`raiseSelectedItems`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`lowerSelectedItems`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`moveSelectedItemsToBottom`
%End
void moveSelectedItemsToBottom();
%Docstring
2017-12-15 10:36:55 -04:00
Lowers the selected items to the bottom of the z-order.
.. seealso:: :py:func:`raiseSelectedItems`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`lowerSelectedItems`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`moveSelectedItemsToTop`
%End
void lockSelectedItems();
%Docstring
2017-12-15 10:36:55 -04:00
Locks any selected items, preventing them from being interacted with
by mouse interactions.
.. seealso:: :py:func:`unlockAllItems`
%End
void unlockAllItems();
%Docstring
2017-12-15 10:36:55 -04:00
Unlocks all locked items in the layout.
.. seealso:: :py:func:`lockSelectedItems`
2017-10-03 11:38:03 +10:00
%End
2017-10-04 08:29:31 +10:00
void deleteSelectedItems();
%Docstring
2017-12-15 10:36:55 -04:00
Deletes all selected items.
.. seealso:: :py:func:`deleteItems`
%End
void deleteItems( const QList< QgsLayoutItem * > &items );
%Docstring
2017-12-15 10:36:55 -04:00
Delete the specified ``items``.
.. seealso:: :py:func:`deleteSelectedItems`
2017-10-04 08:29:31 +10:00
%End
2017-10-09 13:05:19 +10:00
void groupSelectedItems();
%Docstring
2017-12-15 10:36:55 -04:00
Groups all selected items.
.. seealso:: :py:func:`ungroupSelectedItems`
2017-10-09 13:05:19 +10:00
%End
void ungroupSelectedItems();
%Docstring
2017-12-15 10:36:55 -04:00
Ungroups all selected items.
.. seealso:: :py:func:`groupSelectedItems`
2017-10-09 13:05:19 +10:00
%End
void viewChanged();
2017-07-11 14:21:35 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Updates associated rulers and other widgets after view extent or zoom has changed.
This should be called after calling any of the QGraphicsView
base class methods which alter the view's zoom level or extent,
i.e. QGraphicsView.fitInView().
2017-07-11 14:21:35 +10:00
%End
void pushStatusMessage( const QString &message );
%Docstring
2017-12-15 10:36:55 -04:00
Pushes a new status bar ``message`` to the view. This causes statusMessage()
to be emitted, which should cause the message to appear in the status bar
for the parent window.
.. seealso:: :py:func:`statusMessage`
%End
2017-07-04 11:43:29 +10:00
signals:
void layoutSet( QgsLayout *layout );
%Docstring
2017-12-15 10:36:55 -04:00
Emitted when a ``layout`` is set for the view.
.. seealso:: :py:func:`currentLayout`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`setCurrentLayout`
%End
void toolSet( QgsLayoutViewTool *tool );
%Docstring
2017-12-15 10:36:55 -04:00
Emitted when the current ``tool`` is changed.
.. seealso:: :py:func:`setTool`
2017-07-04 11:43:29 +10:00
%End
void zoomLevelChanged();
%Docstring
2017-12-15 10:36:55 -04:00
Is emitted whenever the zoom level of the view is changed.
%End
void cursorPosChanged( QPointF layoutPoint );
%Docstring
2017-12-15 10:36:55 -04:00
Is emitted when the mouse cursor coordinates change within the view.
The ``layoutPoint`` argument indicates the cursor position within
the layout coordinate system.
%End
void pageChanged( int page );
%Docstring
2017-12-15 10:36:55 -04:00
Emitted when the page visible in the view is changed. This signal
considers the page at the center of the view as the current visible
page.
.. seealso:: :py:func:`currentPage`
%End
void statusMessage( const QString &message );
%Docstring
2017-12-15 10:36:55 -04:00
Emitted when the view has a ``message`` for display in a parent window's
status bar.
.. seealso:: :py:func:`pushStatusMessage`
%End
void itemFocused( QgsLayoutItem *item );
%Docstring
2017-12-15 10:36:55 -04:00
Emitted when an ``item`` is "focused" in the view, i.e. it becomes the active
item and should have its properties displayed in any designer windows.
%End
void willBeDeleted();
%Docstring
Emitted in the destructor when the view is about to be deleted,
but is still in a perfectly valid state.
%End
2017-07-04 11:43:29 +10:00
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 );
virtual void resizeEvent( QResizeEvent *event );
virtual void scrollContentsBy( int dx, int dy );
virtual void dragEnterEvent( QDragEnterEvent *e );
virtual void paintEvent( QPaintEvent *event );
2017-07-04 11:43:29 +10:00
};
class QgsLayoutViewMenuProvider
{
%Docstring
2017-12-15 10:36:55 -04:00
Interface for a QgsLayoutView context menu.
2017-12-15 10:36:55 -04:00
Implementations of this interface can be made to allow QgsLayoutView
instances to provide custom context menus (opened upon right-click).
2017-12-05 20:04:14 -04:00
.. seealso:: :py:class:`QgsLayoutView`
2017-12-15 10:36:55 -04:00
.. versionadded:: 3.0
%End
%TypeHeaderCode
#include "qgslayoutview.h"
%End
public:
virtual ~QgsLayoutViewMenuProvider();
virtual QMenu *createContextMenu( QWidget *parent /Transfer/, QgsLayout *layout, QPointF layoutPoint ) const = 0 /Factory/;
%Docstring
Returns a newly created menu instance (or null pointer on error)
%End
};
2017-07-24 19:30:09 +10:00
2017-07-04 11:43:29 +10:00
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/layout/qgslayoutview.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/