# class KRuler | A ruler widget. More...
Definition | `#include <kruler.h>`
Inherits | QFrame (qt) [public ]
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

#### Public Slots

- void slotNewValue (int)
- void slotNewOffset (int)
- void slotEndOffset (int)

## Detailed Description

A ruler widget.

The vertical ruler looks similar to this:

        meters                       inches

        ------   <--- end mark  ---> ------
            --                            -
            --   <---little mark--->     --
            --                            -
            --                          ---
           ---   <---medium mark          -
            --                           --
            --        tiny mark---->      -
            --                         ----
            --                            -
          ----   <-----big mark          --
            --                            -
          |>--   <--ruler pointer-->   |>--

There are tiny marks, little marks, medium marks, and big marks along the ruler.

To receive mouse clicks or mouse moves, the class has to be overloaded.

For performance reasons, the public methods don't call QWidget::repaint(). (Slots do, see documentation below.) All the changed settings will be painted once after leaving to the main event loop. For performance painting the slot methods should be used, they do a fast QWidget::repaint() call after changing the values. For setting multiple values like minValue(), maxValue(), offset() etc. using the public methods is recommended so the widget will be painted only once when entering the main event loop.

void slotNewValue (int) | ### slotNewValue

[slot]

Sets the pointer to a new position.

The offset is NOT updated. QWidget::repaint() is called afterwards.

void slotNewOffset (int) | ### slotNewOffset

[slot]

Sets the ruler marks to a new position.

The pointer is NOT updated. QWidget::repaint() is called afterwards.

void slotEndOffset (int) | ### slotEndOffset

[slot]

void drawContents (QPainter *) | ### drawContents

[protected virtual]

Reimplemented from QFrame for internal purposes..

- Author: Jörg Habenicht
- Generated: root@i386.ports.openbsd.org on Wed Apr 25 13:58:24 2001, using kdoc 2.0a53.