|
|
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.
enum |
direction of the ruler. Has to be defined when constructing the widget. see KRuler();
|
Constructor, requires the direction to paint to. parent, name, f and allowLines are handed through to QFrame. The default look is a raised widget, but may be changed with the QFrame methods.
Parameters:
dir | direction of the ruler |
parent | will be handed over to QFrame |
name | will be handed over to QFrame |
f | will be handed over to QFrame |
allowLines | will be handed over to QFrame |
|
Constructor, requires the direction to paint to and an initial width. The width sets the fixed width of the widget. This is usefull, if you want to draw the ruler bigger or smaller than the default size. Note: The size of the marks doesn't change. parent, name, f and allowLines are handed through to QFrame
Parameters:
dir | direction of the ruler |
widgetWidth | fixed width of the widget |
parent | will be handed over to QFrame |
name | will be handed over to QFrame |
f | will be handed over to QFrame |
allowLines | will be handed over to QFrame |
~ |
Destructor.
void |
minimum value reachable, default: 0 calls update(), so the widget is painted after leaving the main event loop
inline int |
[const]
returns the minimal value of the ruler pointer
void |
maximum value of the ruler pointer, default: 100 . calls update(), so the widget is painted after leaving the main event loop
inline int |
[const]
returns the maximal value of the ruler pointer.
void |
sets minimal and maxmal values of the ruler pointer. calls update(), so the widget is painted after leaving to the main event loop.
void |
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.
void |
distance of tiny marks. mostly used in inch system with distance of 1.
void |
set the paint distance of the little marks. value is 1 in metric system and 2 in inch system.
void |
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. default: 5
void |
set the paint distance of the big marks. for inch or metric styles it is twice the medium mark distance. default: 10
void |
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 the values set in "setXXMarkDistance(int)"
void |
sets the value that is shown per little mark. for metric systems this is 5 display of little marks is disabled, big marks are updated
void |
sets the value that is shown per little mark. for metric systems this is 1 display of little and medium marks marks is disabled,
void |
paint number values of the little marks. default: false
void |
paint number values of the medium marks. default: false
void |
paint number values of the big marks. default: true
void |
paint number values of the little marks. default: true
void |
label which is drawn at the beginning of the visible part of the ruler
void |
convenience method: sets up the necessary tasks for the provided styles
void |
currently not implemented
inline paint_style |
[const]
currently not implemented
void |
currently not implemented
inline paint_style |
[const]
currently not implemented
void |
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
void |
the ruler may slide up and down "count" pixels this doesn't affect the position of the ruler pointer, only the visual part of the ruler is moved
void |
set ruler slide to "offset" from beginning. like "slideup" or "slidedown" with an absolute offset
void |
[slot]
sets the pointer to a new position. the offset is NOT updated. repaint() is called afterwards
void |
[slot]
sets the ruler marks to a new position. the pointer is NOT updated. repaint() is called afterwards