#include <QicsRuler.h>
Inherits QFrame.
Public Member Functions | |
| QicsRuler (Qt::Orientation orient, QWidget *parent=0) | |
| Qt::Orientation | orientation () const |
| void | setOrientation (Qt::Orientation orient) |
| void | setMetrix (double mm) |
Protected Member Functions | |
| virtual void | paintEvent (QPaintEvent *event) |
Protected Attributes | |
| Qt::Orientation | m_orient |
| double | m_mm |
Ruler is visual-only class which helps identify a size in metrical units rather then in pixels. It can be helpful when dealing with objects which should be measured in millimeters/centimeters, for exapmle, page size while previewing printer output.
Rulers used to show real page size in centimeters
You can choose ruler's orientation while constructing it or by setOrientation method. Horizontal and vertical orientations are supported.
| QicsRuler::QicsRuler | ( | Qt::Orientation | orient, | |
| QWidget * | parent = 0 | |||
| ) |
Constructor. Specify the ruler's orientation in orient parameter. It can be set to Qt::Horizontal or Qt::Vertical.
| Qt::Orientation QicsRuler::orientation | ( | ) | const [inline] |
Returns ruler's orientation (Qt::Horizontal or Qt::Vertical).
| void QicsRuler::setOrientation | ( | Qt::Orientation | orient | ) |
Sets ruler's orientation (Qt::Horizontal or Qt::Vertical). Ruler will be rotated accordingly to match current orientation.
| void QicsRuler::setMetrix | ( | double | mm | ) |
Makes the ruler to represent metrical scale in the range from 0 to mm milimeters.
| virtual void QicsRuler::paintEvent | ( | QPaintEvent * | event | ) | [protected, virtual] |
Paints ruler and its scale. You can reimplement this method to create your own scale.