48 QSize minimumSizeHint()
const override;
55 void setSceneTransform(
const QTransform &transform );
79 void setContextMenu( QMenu *menu );
88 void setCursorPosition( QPointF position );
95 void paintEvent( QPaintEvent *event )
override;
96 void mouseMoveEvent( QMouseEvent *event )
override;
97 void mousePressEvent( QMouseEvent *event )
override;
98 void mouseReleaseEvent( QMouseEvent *event )
override;
101 static const int VALID_SCALE_MULTIPLES[];
102 static const int VALID_SCALE_MAGNITUDES[];
104 Qt::Orientation mOrientation = Qt::Horizontal;
107 QTransform mTransform;
111 std::unique_ptr< QFontMetrics > mRulerFontMetrics;
113 double mScaleMinPixelsWidth = 0.0;
115 int mMinPixelsPerDivision;
116 int mPixelsBetweenLineAndText;
118 int mMinSpacingVerticalLabels;
120 int mDragGuideTolerance = 0;
122 double mDraggingGuideOldPosition = 0.0;
125 bool mCreatingGuide =
false;
126 QGraphicsLineItem *mGuideItem =
nullptr;
129 QPolygonF mGuideMarker;
131 QPointer< QMenu > mMenu;
134 int optimumScale(
double minPixelDiff,
int &magnitude,
int &multiple );
140 int optimumNumberDivisions(
double rulerScale,
int scaleMultiple );
143 void drawRotatedText( QPainter *painter, QPointF pos,
const QString &text );
150 void drawSmallDivisions( QPainter *painter,
double startPos,
int numDivisions,
double rulerScale,
double maxPos = 0 );
153 void drawMarkerPos( QPainter *painter );
155 void drawGuideMarkers( QPainter *painter,
QgsLayout *layout );
158 void drawGuideAtPos( QPainter *painter, QPoint pos );
160 void createTemporaryGuideItem();
162 QPointF convertLocalPointToLayout( QPoint localPoint )
const;
164 QPoint convertLayoutPointToLocal( QPointF layoutPoint )
const;