ICS

QicsTable Documentation Set

QicsRuler Class Reference

Ruler widget is intended to show size of some object/part of screen in metric system. More...

#include <QicsRuler.h>

Inherits QFrame.

List of all members.

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


Detailed Description

Ruler widget is intended to show size of some object/part of screen in metric system.

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.png

Rulers used to show real page size in centimeters

To use the ruler, set its appropriate screen geometry in pixels and then set its size in metrical units by setMetrix method . Ruler's scale will be repainted accordingly to match metrical and pixel sizes.

You can choose ruler's orientation while constructing it or by setOrientation method. Horizontal and vertical orientations are supported.


Constructor & Destructor Documentation

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.


Member Function Documentation

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.


The documentation for this class was generated from the following file:

All trademarks and copyrights on this page are properties of their respective owners.
The rest is copyright ©1999-2006 Integrated Computer Solutions, Inc.