17 #ifndef QGSLAYOUTVIEW_H
18 #define QGSLAYOUTVIEW_H
27 #include <QGraphicsView>
28 #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 );
499 void zoomLevelChanged();
506 void cursorPosChanged( QPointF layoutPoint );
514 void pageChanged(
int page );
521 void statusMessage(
const QString &message );
533 void willBeDeleted();
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;
547 void showEvent( QShowEvent *event )
override;
551 void invalidateCachedRenders();
552 void updateDevicePixelFromScreen();
557 void wheelZoom( QWheelEvent *event );
559 QPointer< QgsLayoutViewTool > mTool;
565 QPoint mMouseCurrentXY;
569 std::unique_ptr< QgsLayoutViewMenuProvider > mMenuProvider;
571 QgsLayoutViewSnapMarker *mSnapMarker =
nullptr;
572 QgsLayoutReportSectionLabel *mSectionLabel =
nullptr;
574 QGraphicsLineItem *mHorizontalSnapLine =
nullptr;
575 QGraphicsLineItem *mVerticalSnapLine =
nullptr;
577 int mCurrentPage = 0;
581 bool mPaintingEnabled =
true;
583 double mScreenDpi = 96.0;
584 QMetaObject::Connection mScreenDpiChangedConnection;
586 friend class TestQgsLayoutView;
587 friend class QgsLayoutMouseHandles;
589 QGraphicsLineItem *createSnapLine()
const;
622 class GUI_EXPORT QgsLayoutViewSnapMarker :
public QGraphicsRectItem
626 QgsLayoutViewSnapMarker();
628 void paint( QPainter *painter,
const QStyleOptionGraphicsItem *option, QWidget *widget =
nullptr )
override;
639 #endif // QGSLAYOUTVIEW_H