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;
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;
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;
634 #endif // QGSLAYOUTVIEW_H
A custom ruler widget for use with QgsLayoutView, displaying the current zoom and position of the vis...
Base class for graphical items within a QgsLayout.
A graphical widget to display and interact with QgsLayouts.
Paste items in center of view.
Paste items at cursor position.
int currentPage() const
Returns the page visible in the view.
ClipboardOperation
Clipboard operations.
A graphics effect which can be applied to a widget to simulate various printing and color blindness m...
Distribution
Distribution options.
#define SIP_KEEPREFERENCE
Base class for layouts, which can contain items such as maps, labels, scalebars, etc.
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
Alignment
Alignment options.