QGIS API Documentation
2.2.0-Valmiera
|
A class to show paper scale and the current cursor position. More...
#include <qgscomposerruler.h>
Public Types | |
enum | Direction { Horizontal = 0, Vertical } |
Signals | |
void | cursorPosChanged (QPointF) |
Is emitted when mouse cursor coordinates change. |
Public Member Functions | |
QgsComposerRuler (QgsComposerRuler::Direction d) | |
~QgsComposerRuler () | |
QSize | minimumSizeHint () const |
void | setSceneTransform (const QTransform &transform) |
void | updateMarker (const QPointF &pos) |
void | setComposition (QgsComposition *c) |
QgsComposition * | composition () |
int | rulerSize () |
Protected Member Functions | |
void | paintEvent (QPaintEvent *event) |
void | mouseMoveEvent (QMouseEvent *event) |
void | mouseReleaseEvent (QMouseEvent *event) |
void | mousePressEvent (QMouseEvent *event) |
Private Member Functions | |
void | setSnapLinePosition (const QPointF &pos) |
int | optimumScale (double minPixelDiff, int &magnitude, int &multiple) |
int | optimumNumberDivisions (double rulerScale, int scaleMultiple) |
void | drawRotatedText (QPainter *painter, QPointF pos, const QString &text) |
void | drawSmallDivisions (QPainter *painter, double startPos, int numDivisions, double rulerScale, double maxPos=0) |
void | drawMarkerPos (QPainter *painter) |
Private Attributes | |
Direction | mDirection |
QTransform | mTransform |
QPointF | mMarkerPos |
QgsComposition * | mComposition |
QGraphicsLineItem * | mLineSnapItem |
QList< QPair< QgsComposerItem *, QgsComposerItem::ItemPositionMode > > | mSnappedItems |
QFont * | mRulerFont |
QFontMetrics * | mRulerFontMetrics |
double | mScaleMinPixelsWidth |
int | mRulerMinSize |
int | mMinPixelsPerDivision |
int | mPixelsBetweenLineAndText |
int | mTextBaseline |
int | mMinSpacingVerticalLabels |
Static Private Attributes | |
static const int | validScaleMultiples [] = {1, 2, 5} |
static const int | validScaleMagnitudes [] = {1, 10, 100, 1000, 10000} |
A class to show paper scale and the current cursor position.
Definition at line 10 of file qgscomposerruler.h.
Definition at line 15 of file qgscomposerruler.h.
QgsComposerRuler::QgsComposerRuler | ( | QgsComposerRuler::Direction | d | ) |
Definition at line 15 of file qgscomposerruler.cpp.
References mMinPixelsPerDivision, mMinSpacingVerticalLabels, mPixelsBetweenLineAndText, mRulerFont, mRulerFontMetrics, mRulerMinSize, mScaleMinPixelsWidth, mTextBaseline, and RULER_FONT_SIZE.
QgsComposerRuler::~QgsComposerRuler | ( | ) |
Definition at line 45 of file qgscomposerruler.cpp.
References mRulerFont, and mRulerFontMetrics.
|
inline |
Definition at line 30 of file qgscomposerruler.h.
|
signal |
Is emitted when mouse cursor coordinates change.
Referenced by mouseMoveEvent().
|
private |
Definition at line 212 of file qgscomposerruler.cpp.
References Horizontal, mDirection, mMarkerPos, and mRulerMinSize.
Referenced by paintEvent().
|
private |
Definition at line 226 of file qgscomposerruler.cpp.
Referenced by paintEvent().
|
private |
Definition at line 235 of file qgscomposerruler.cpp.
References Horizontal, mDirection, mRulerMinSize, and mTransform.
Referenced by paintEvent().
QSize QgsComposerRuler::minimumSizeHint | ( | ) | const |
Definition at line 51 of file qgscomposerruler.cpp.
References mRulerMinSize.
|
protected |
Definition at line 366 of file qgscomposerruler.cpp.
References cursorPosChanged(), Horizontal, mDirection, mTransform, setSnapLinePosition(), and updateMarker().
|
protected |
Definition at line 411 of file qgscomposerruler.cpp.
References QgsComposition::addSnapLine(), Horizontal, mComposition, mDirection, mLineSnapItem, mSnappedItems, mTransform, and QgsComposition::nearestSnapLine().
|
protected |
Definition at line 387 of file qgscomposerruler.cpp.
References Horizontal, mComposition, mDirection, mLineSnapItem, mSnappedItems, mTransform, and QgsComposition::removeSnapLine().
|
private |
Definition at line 313 of file qgscomposerruler.cpp.
References mMinPixelsPerDivision, and mTransform.
Referenced by paintEvent().
|
private |
Definition at line 288 of file qgscomposerruler.cpp.
References COUNT_VALID_MAGNITUDES, COUNT_VALID_MULTIPLES, mTransform, validScaleMagnitudes, and validScaleMultiples.
Referenced by paintEvent().
|
protected |
Definition at line 56 of file qgscomposerruler.cpp.
References drawMarkerPos(), drawRotatedText(), drawSmallDivisions(), Horizontal, mComposition, mDirection, mMinSpacingVerticalLabels, mPixelsBetweenLineAndText, mRulerFont, mRulerFontMetrics, mRulerMinSize, mScaleMinPixelsWidth, mTextBaseline, mTransform, QgsComposition::numPages(), optimumNumberDivisions(), optimumScale(), QgsComposition::paperHeight(), qgsDoubleNear(), and QgsComposition::spaceBetweenPages().
|
inline |
Definition at line 32 of file qgscomposerruler.h.
|
inline |
Definition at line 29 of file qgscomposerruler.h.
Referenced by QgsComposerView::setComposition().
void QgsComposerRuler::setSceneTransform | ( | const QTransform & | transform | ) |
Definition at line 358 of file qgscomposerruler.cpp.
References mTransform.
Referenced by QgsComposerView::updateRulers().
|
private |
Definition at line 437 of file qgscomposerruler.cpp.
References Horizontal, QgsComposerItem::LowerLeft, mComposition, mDirection, QgsComposerItem::Middle, QgsComposerItem::MiddleLeft, mLineSnapItem, mSnappedItems, mTransform, QgsComposition::numPages(), QgsComposition::paperHeight(), QgsComposition::paperWidth(), QgsComposition::spaceBetweenPages(), QgsComposerItem::UpperLeft, QgsComposerItem::UpperMiddle, and QgsComposerItem::UpperRight.
Referenced by mouseMoveEvent().
|
inline |
Definition at line 27 of file qgscomposerruler.h.
Referenced by mouseMoveEvent(), and QgsComposerView::mouseMoveEvent().
|
private |
Definition at line 47 of file qgscomposerruler.h.
Referenced by mousePressEvent(), mouseReleaseEvent(), paintEvent(), and setSnapLinePosition().
|
private |
Definition at line 44 of file qgscomposerruler.h.
Referenced by drawMarkerPos(), drawSmallDivisions(), mouseMoveEvent(), mousePressEvent(), mouseReleaseEvent(), paintEvent(), and setSnapLinePosition().
|
private |
Definition at line 48 of file qgscomposerruler.h.
Referenced by mousePressEvent(), mouseReleaseEvent(), and setSnapLinePosition().
|
private |
Definition at line 46 of file qgscomposerruler.h.
Referenced by drawMarkerPos().
|
private |
Definition at line 56 of file qgscomposerruler.h.
Referenced by optimumNumberDivisions(), and QgsComposerRuler().
|
private |
Definition at line 59 of file qgscomposerruler.h.
Referenced by paintEvent(), and QgsComposerRuler().
|
private |
Definition at line 57 of file qgscomposerruler.h.
Referenced by paintEvent(), and QgsComposerRuler().
|
private |
Definition at line 52 of file qgscomposerruler.h.
Referenced by paintEvent(), QgsComposerRuler(), and ~QgsComposerRuler().
|
private |
Definition at line 53 of file qgscomposerruler.h.
Referenced by paintEvent(), QgsComposerRuler(), and ~QgsComposerRuler().
|
private |
Definition at line 55 of file qgscomposerruler.h.
Referenced by drawMarkerPos(), drawSmallDivisions(), minimumSizeHint(), paintEvent(), and QgsComposerRuler().
|
private |
Definition at line 54 of file qgscomposerruler.h.
Referenced by paintEvent(), and QgsComposerRuler().
|
private |
Definition at line 50 of file qgscomposerruler.h.
Referenced by mousePressEvent(), mouseReleaseEvent(), and setSnapLinePosition().
|
private |
Definition at line 58 of file qgscomposerruler.h.
Referenced by paintEvent(), and QgsComposerRuler().
|
private |
Definition at line 45 of file qgscomposerruler.h.
Referenced by drawSmallDivisions(), mouseMoveEvent(), mousePressEvent(), mouseReleaseEvent(), optimumNumberDivisions(), optimumScale(), paintEvent(), setSceneTransform(), and setSnapLinePosition().
|
staticprivate |
Definition at line 42 of file qgscomposerruler.h.
Referenced by optimumScale().
|
staticprivate |
Definition at line 41 of file qgscomposerruler.h.
Referenced by optimumScale().