17#ifndef QGSLAYOUTVIEW_H
18#define QGSLAYOUTVIEW_H
27#include <QGraphicsView>
28#include <QGraphicsRectItem>
38class QgsLayoutViewSnapMarker;
39class QgsLayoutReportSectionLabel;
55 if ( qobject_cast<QgsLayoutView *>( sipCpp ) )
56 sipType = sipType_QgsLayoutView;
64 Q_PROPERTY(
QgsLayout *currentLayout READ currentLayout WRITE setCurrentLayout NOTIFY layoutSet )
139 void setPreviewModeEnabled(
bool enabled );
145 bool previewModeEnabled()
const;
167 void scaleSafe(
double scale );
172 void setZoomLevel(
double level );
210 QList< QgsLayoutItemPage * > visiblePages()
const;
216 QList< int > visiblePageNumbers()
const;
244 void copySelectedItems( ClipboardOperation operation );
251 void copyItems(
const QList< QgsLayoutItem * > &items, ClipboardOperation operation );
261 QList< QgsLayoutItem * > pasteItems( PasteMode mode );
272 QList< QgsLayoutItem * > pasteItems( QPointF layoutPoint );
278 bool hasItemsInClipboard()
const;
284 QPointF deltaForKeyEvent( QKeyEvent *event );
291 void setPaintingEnabled(
bool enabled );
SIP_SKIP
297 void setSectionLabel(
const QString &label );
350 void emitZoomLevelChanged();
379 void invertSelection();
387 void selectNextItemAbove();
395 void selectNextItemBelow();
403 void raiseSelectedItems();
411 void lowerSelectedItems();
419 void moveSelectedItemsToTop();
427 void moveSelectedItemsToBottom();
434 void lockSelectedItems();
440 void unlockAllItems();
446 void deleteSelectedItems();
452 void deleteItems(
const QList< QgsLayoutItem * > &items );
458 void groupSelectedItems();
464 void ungroupSelectedItems();
480 void pushStatusMessage(
const QString &message );
537 void mousePressEvent( QMouseEvent *event )
override;
538 void mouseReleaseEvent( QMouseEvent *event )
override;
539 void mouseMoveEvent( QMouseEvent *event )
override;
540 void mouseDoubleClickEvent( QMouseEvent *event )
override;
541 void wheelEvent( QWheelEvent *event )
override;
542 void keyPressEvent( QKeyEvent *event )
override;
543 void keyReleaseEvent( QKeyEvent *event )
override;
544 void resizeEvent( QResizeEvent *event )
override;
545 void scrollContentsBy(
int dx,
int dy )
override;
546 void dragEnterEvent( QDragEnterEvent *e )
override;
547 void paintEvent( QPaintEvent *event )
override;
551 void invalidateCachedRenders();
556 void wheelZoom( QWheelEvent *event );
560 QPointer< QgsLayoutViewTool > mTool;
566 QPoint mMouseCurrentXY;
570 std::unique_ptr< QgsLayoutViewMenuProvider > mMenuProvider;
572 QgsLayoutViewSnapMarker *mSnapMarker =
nullptr;
573 QgsLayoutReportSectionLabel *mSectionLabel =
nullptr;
575 QGraphicsLineItem *mHorizontalSnapLine =
nullptr;
576 QGraphicsLineItem *mVerticalSnapLine =
nullptr;
578 int mCurrentPage = 0;
582 bool mPaintingEnabled =
true;
584 friend class TestQgsLayoutView;
585 friend class QgsLayoutMouseHandles;
587 QGraphicsLineItem *createSnapLine()
const;
620class GUI_EXPORT QgsLayoutViewSnapMarker :
public QGraphicsRectItem
624 QgsLayoutViewSnapMarker();
626 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.
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...
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 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...
A utility class for dynamic handling of changes to screen properties.
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
#define SIP_KEEPREFERENCE