17#ifndef QGSLAYOUTVIEW_H
18#define QGSLAYOUTVIEW_H
29#include <QGraphicsRectItem>
30#include <QGraphicsView>
40class QgsLayoutViewSnapMarker;
41class QgsLayoutReportSectionLabel;
55 if ( qobject_cast<QgsLayoutView *>( sipCpp ) )
56 sipType = sipType_QgsLayoutView;
209 QList<QgsLayoutItemPage *> visiblePages()
const;
215 QList<int> visiblePageNumbers()
const;
243 void copySelectedItems( ClipboardOperation operation );
250 void copyItems(
const QList<QgsLayoutItem *> &items, ClipboardOperation operation );
260 QList<QgsLayoutItem *> pasteItems( PasteMode mode );
271 QList<QgsLayoutItem *> pasteItems( QPointF layoutPoint );
277 bool hasItemsInClipboard()
const;
283 QPointF deltaForKeyEvent( QKeyEvent *event );
290 void setPaintingEnabled(
bool enabled )
SIP_SKIP;
296 void setSectionLabel(
const QString &label );
349 void emitZoomLevelChanged();
378 void invertSelection();
386 void selectNextItemAbove();
394 void selectNextItemBelow();
402 void raiseSelectedItems();
410 void lowerSelectedItems();
418 void moveSelectedItemsToTop();
426 void moveSelectedItemsToBottom();
433 void lockSelectedItems();
439 void unlockAllItems();
445 void deleteSelectedItems();
451 void deleteItems(
const QList<QgsLayoutItem *> &items );
457 void groupSelectedItems();
463 void ungroupSelectedItems();
479 void pushStatusMessage(
const QString &message );
540 void wheelEvent( QWheelEvent *event )
override;
546 void paintEvent( QPaintEvent *event )
override;
550 void invalidateCachedRenders();
554 void wheelZoom( QWheelEvent *event );
558 QPointer<QgsLayoutViewTool> mTool;
564 QPoint mMouseCurrentXY;
568 std::unique_ptr<QgsLayoutViewMenuProvider> mMenuProvider;
570 QgsLayoutViewSnapMarker *mSnapMarker =
nullptr;
571 QgsLayoutReportSectionLabel *mSectionLabel =
nullptr;
573 QGraphicsLineItem *mHorizontalSnapLine =
nullptr;
574 QGraphicsLineItem *mVerticalSnapLine =
nullptr;
576 int mCurrentPage = 0;
580 bool mPaintingEnabled =
true;
585 QGraphicsLineItem *createSnapLine()
const;
617class GUI_EXPORT QgsLayoutViewSnapMarker :
public QGraphicsRectItem
620 QgsLayoutViewSnapMarker();
622 void paint( QPainter *painter,
const QStyleOptionGraphicsItem *option, QWidget *widget =
nullptr )
override;
Alignment
Alignment options.
Distribution
Distribution options.
Base class for graphical items within a QgsLayout.
A custom ruler widget for use with QgsLayoutView, displaying the current zoom and position of the vis...
A graphical widget to display and interact with QgsLayouts.
QgsLayoutView(QWidget *parent=nullptr)
Constructor for QgsLayoutView.
void cursorPosChanged(QPointF layoutPoint)
Emitted when the mouse cursor coordinates change within the view.
@ PasteModeCenter
Paste items in center of view.
@ PasteModeInPlace
Paste items in place.
@ PasteModeCursor
Paste items at cursor position.
void mouseMoveEvent(QMouseEvent *event) override
QgsLayout * currentLayout
void setMenuProvider(QgsLayoutViewMenuProvider *provider)
Sets a provider for context menus.
void dragEnterEvent(QDragEnterEvent *e) override
void resizeEvent(QResizeEvent *event) override
void mouseReleaseEvent(QMouseEvent *event) override
friend class QgsLayoutMouseHandles
QgsPreviewEffect::PreviewMode previewMode() const
Returns the preview mode which may be used to modify the view's appearance.
void setTool(QgsLayoutViewTool *tool)
Sets the tool currently being used in the view.
void zoomLevelChanged()
Emitted whenever the zoom level of the view is changed.
friend class TestQgsLayoutView
void willBeDeleted()
Emitted in the destructor when the view is about to be deleted, but is still in a perfectly valid sta...
void setHorizontalRuler(QgsLayoutRuler *ruler)
Sets a horizontal ruler to synchronize with the view state.
void setPreviewMode(QgsPreviewEffect::PreviewMode mode)
Sets the preview mode which should be used to modify the view's appearance.
void keyPressEvent(QKeyEvent *event) override
QgsLayout * currentLayout()
Returns the current layout associated with the view.
void statusMessage(const QString &message)
Emitted when the view has a message for display in a parent window's status bar.
void itemFocused(QgsLayoutItem *item)
Emitted when an item is "focused" in the view, i.e.
void setPreviewModeEnabled(bool enabled)
Sets whether a preview effect should be used to alter the view's appearance.
void layoutSet(QgsLayout *layout)
Emitted when a layout is set for the view.
void setCurrentLayout(QgsLayout *layout)
Sets the current layout to edit in the view.
int currentPage() const
Returns the page visible in the view.
void wheelEvent(QWheelEvent *event) override
ClipboardOperation
Clipboard operations.
@ ClipboardCopy
Copy items.
bool previewModeEnabled() const
Returns true if a preview effect is being used to alter the view's appearance.
void setVerticalRuler(QgsLayoutRuler *ruler)
Sets a vertical ruler to synchronize with the view state.
QgsLayoutViewTool * tool()
Returns the currently active tool for the view.
void setZoomLevel(double level)
Sets the zoom level for the view, where a zoom level of 1.0 corresponds to 100%.
void unsetTool(QgsLayoutViewTool *tool)
Unsets the current view tool, if it matches the specified tool.
void toolSet(QgsLayoutViewTool *tool)
Emitted when the current tool is changed.
void mouseDoubleClickEvent(QMouseEvent *event) override
void scaleSafe(double scale)
Scales the view in a safe way, by limiting the acceptable range of the scale applied.
void pageChanged(int page)
Emitted when the page visible in the view is changed.
void scrollContentsBy(int dx, int dy) override
void paintEvent(QPaintEvent *event) override
void keyReleaseEvent(QKeyEvent *event) override
QgsLayoutViewMenuProvider * menuProvider() const
Returns the provider for context menus.
void mousePressEvent(QMouseEvent *event) override
Base class for layouts, which can contain items such as maps, labels, scalebars, etc.
A graphics effect which can be applied to a widget to simulate various printing and color blindness m...
A utility class for dynamic handling of changes to screen properties.
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
#define SIP_KEEPREFERENCE