47 QSize minimumSizeHint()
const override;
54 void setSceneTransform(
const QTransform &transform );
78 void setContextMenu( QMenu *menu );
87 void setCursorPosition( QPointF position );
94 void paintEvent( QPaintEvent *event )
override;
95 void mouseMoveEvent( QMouseEvent *event )
override;
96 void mousePressEvent( QMouseEvent *event )
override;
97 void mouseReleaseEvent( QMouseEvent *event )
override;
100 static const int VALID_SCALE_MULTIPLES[];
101 static const int VALID_SCALE_MAGNITUDES[];
103 Qt::Orientation mOrientation = Qt::Horizontal;
106 QTransform mTransform;
110 std::unique_ptr<QFontMetrics> mRulerFontMetrics;
112 double mScaleMinPixelsWidth = 0.0;
114 int mMinPixelsPerDivision;
115 int mPixelsBetweenLineAndText;
117 int mMinSpacingVerticalLabels;
119 int mDragGuideTolerance = 0;
121 double mDraggingGuideOldPosition = 0.0;
124 bool mCreatingGuide =
false;
125 QGraphicsLineItem *mGuideItem =
nullptr;
128 QPolygonF mGuideMarker;
130 QPointer<QMenu> mMenu;
133 int optimumScale(
double minPixelDiff,
int &magnitude,
int &multiple );
139 int optimumNumberDivisions(
double rulerScale,
int scaleMultiple );
142 void drawRotatedText( QPainter *painter, QPointF pos,
const QString &text );
149 void drawSmallDivisions( QPainter *painter,
double startPos,
int numDivisions,
double rulerScale,
double maxPos = 0 );
152 void drawMarkerPos( QPainter *painter );
154 void drawGuideMarkers( QPainter *painter,
QgsLayout *layout );
157 void drawGuideAtPos( QPainter *painter, QPoint pos );
159 void createTemporaryGuideItem();
161 QPointF convertLocalPointToLayout( QPoint localPoint )
const;
163 QPoint convertLayoutPointToLocal( QPointF layoutPoint )
const;