17 #ifndef QGSLAYOUTVIEW_H
18 #define QGSLAYOUTVIEW_H
26 #include <QGraphicsView>
27 #include <QGraphicsRectItem>
38 class QgsLayoutViewSnapMarker;
39 class QgsLayoutReportSectionLabel;
54 if ( qobject_cast<QgsLayoutView *>( sipCpp ) )
55 sipType = sipType_QgsLayoutView;
63 Q_PROPERTY(
QgsLayout *currentLayout READ currentLayout WRITE setCurrentLayout NOTIFY layoutSet )
138 void setPreviewModeEnabled(
bool enabled );
144 bool previewModeEnabled()
const;
166 void scaleSafe(
double scale );
171 void setZoomLevel(
double level );
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 );
536 void mousePressEvent( QMouseEvent *event )
override;
537 void mouseReleaseEvent( QMouseEvent *event )
override;
538 void mouseMoveEvent( QMouseEvent *event )
override;
539 void mouseDoubleClickEvent( QMouseEvent *event )
override;
540 void wheelEvent( QWheelEvent *event )
override;
541 void keyPressEvent( QKeyEvent *event )
override;
542 void keyReleaseEvent( QKeyEvent *event )
override;
543 void resizeEvent( QResizeEvent *event )
override;
544 void scrollContentsBy(
int dx,
int dy )
override;
545 void dragEnterEvent( QDragEnterEvent *e )
override;
546 void paintEvent( QPaintEvent *event )
override;
550 void invalidateCachedRenders();
555 void wheelZoom( QWheelEvent *event );
557 QPointer< QgsLayoutViewTool > mTool;
563 QPoint mMouseCurrentXY;
567 std::unique_ptr< QgsLayoutViewMenuProvider > mMenuProvider;
569 QgsLayoutViewSnapMarker *mSnapMarker =
nullptr;
570 QgsLayoutReportSectionLabel *mSectionLabel =
nullptr;
572 QGraphicsLineItem *mHorizontalSnapLine =
nullptr;
573 QGraphicsLineItem *mVerticalSnapLine =
nullptr;
575 int mCurrentPage = 0;
579 bool mPaintingEnabled =
true;
581 friend class TestQgsLayoutView;
582 friend class QgsLayoutMouseHandles;
584 QGraphicsLineItem *createSnapLine()
const;
617 class GUI_EXPORT QgsLayoutViewSnapMarker :
public QGraphicsRectItem
621 QgsLayoutViewSnapMarker();
623 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.
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.
QgsLayout * currentLayout()
Returns the current layout associated with the view.
void zoomLevelChanged()
Emitted whenever the zoom level of the view is changed.
void willBeDeleted()
Emitted in the destructor when the view is about to be deleted, but is still in a perfectly valid sta...
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 layoutSet(QgsLayout *layout)
Emitted when a layout is set for the view.
int currentPage() const
Returns the page visible in the view.
ClipboardOperation
Clipboard operations.
@ ClipboardCopy
Copy items.
QgsLayoutViewTool * tool()
Returns the currently active tool for the view.
void toolSet(QgsLayoutViewTool *tool)
Emitted when the current tool is changed.
void pageChanged(int page)
Emitted when the page visible in the view is changed.
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...
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
#define SIP_KEEPREFERENCE