[kio Index] [kio Hierarchy] [Headers]
A ruler widget More...
#include <kruler.h>
Inherits: QFrame (qt)
The vertical ruler looks similar to this:
meters inches------ <----end mark-----> ------ -- - -- <---little mark---> -- -- - -- --- --- <---medium mark - -- -- -- tiny mark----> - -- ---- -- - ---- <-----big mark -- -- - |>-- <--ruler pointer--> |>--
To receive mouse clicks or mouse moves, the class has to be overloaded.
For performance reasons, the public methods doesn't call repaint(), than update except the public slot methods as described. so 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 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.
[public]
direction of the ruler. Has to be defined when constructing the widget. see KRuler();
[public]
minimum value reachable, default: 0calls update(), so the widget is painted after leaving the main event loop
[public]
returns the minimal value of the ruler pointer
[public]
maximum value of the ruler pointer, default: 100 .calls update(), so the widget is painted after leaving the main event loop
[public]
returns the maximal value of the ruler pointer.
[public]
sets minimal and maxmal values of the ruler pointer.calls update(), so the widget is painted after leaving to the main event loop.
[public]
set the value of the ruler pointer,the value is shown with ruler pointer painted. calls update(), the widget is painted after leaving to the main event loop.
[public]
distance of tiny marks.mostly used in inch system with distance of 1.
[public]
set the paint distance of the little marks.value is 1 in metric system and 2 in inch system.
[public]
set the paint distance of the medium marks.for inch styles it is twice the little mark distance, for metric styles it is five times.
[public]
set the paint distance of the big marks.for inch or metric styles it is twice the medium mark distance.
[public]
sets the value that is shown per little mark.for metric systems this is 1 per mark. Note: If you set the value for little marks the values for medium and big marks are updated accordingly in respect to
[public]
sets the value that is shown per little mark.for metric systems this is 5 display of little marks is disabled,
[public]
sets the value that is shown per little mark.for metric systems this is 1 display of little and medium marks marks is disabled,
[public]
paint number values of the little marks.
[public]
paint number values of the medium marks.
[public]
paint number values of the big marks.
[public]
paint number values of the little marks.
[public]
label which is drawn at the beginning of the visible part
[public]
convenience method:
[public]
currently not implemented
[public]
currently not implemented
[public]
currently not implemented
[public]
currently not implemented
[public]
Set the amount of pixel between two base marks.Calling this method your are able to stretch or shrink your ruler.
For pixel display the value is 10.0 marks per pixel ;-) for inches it is 9.0, and for centimetres ~2,835 -> 3.0 . If you like to magnify your part of display, you have to adjust HERE your markdistance. Notice: the floatingpoint type is only supported to give the possibility of having some floatingpoint values. It should be used with care, using values below 10.0 shows visible jumps of markpositions (e.g. 2.345). Using whole numbers is highly recommended. To use int values use setPixelPerMark((int)your_int_value); default: 1 mark per 10 pixels
[public]
the ruler may slide up and down "count" pixelsthis doesn't affect the position of the ruler pointer,
[public]
set ruler slide to "offset" from beginning.
[public slot]
sets the pointer to a new position.the offset is NOT updated.
[public slot]
sets the ruler marks to a new position.the pointer is NOT updated.
| Kdoc |