The QDial class provides a rounded rangecontrol (like a speedometer or potentiometer). More...
#include <qdial.h>
Inherits QRangeControl and QWidget.
Type | Name | READ | WRITE | Options |
---|---|---|---|---|
bool | tracking | tracking | setTracking | |
bool | wrapping | wrapping | setWrapping | |
int | notchSize | notchSize | ||
double | notchTarget | notchTarget | setNotchTarget | |
bool | notchesVisible | notchesVisible | setNotchesVisible | |
int | minValue | minValue | setMinValue | |
int | maxValue | maxValue | setMaxValue | |
int | lineStep | lineStep | setLineStep | |
int | pageStep | pageStep | setPageStep | |
int | value | value | setValue |
Q dial is used when the user needs to control a value within a program-definable range, and the range either wraps around (typically, 0-359 degrees) or the dialog layout needs a square widget.
Both API- and UI-wise, the dial is very like a slider. Indeed, when wrapping() is FALSE (the default) there is no hard difference between a slider and a dial. They have the same signals, slots and member functions, all of which do the same things. Which one to use depends only on your taste and on the application.
The dial initially emits valueChanged() signals continuously while the slider is being moved; you can make it emit the signal less often by calling setTracking( FALSE ). dialMoved() is emitted continuously even when tracking() is FALSE.
The slider also emits dialPressed() and dialReleased() signals when the mouse button is pressed and released. But note that the dial's value can change without these signals being emitted; the keyboard and wheel can be used to change the value.
Unlike the slider, QDial attempts to draw a "nice" number of notches rather than one per lineStep(). If possible, that number is lineStep(), but if there aren't enough pixels to draw every, QDial will draw every second, third or something. notchSize() returns the number of units per notch, hopefully a multiple of lineStep(); setNotchTarget() sets the target distance between neighbouring notches in pixels. The default is 3.75 pixels.
Like the slider, the dial makes the QRangeControl functions setValue(), addLine(), substractLine(), addPage() and subtractPage() available as slots.
The dial's keyboard interface is fairly simple: The left/up and right/down arrow keys move by lineStep(), page up and page down by pageStep() and Home and End to minValue() and maxValue().
See also QScrollBar, QSpinBox and GUI Design Handbook: Slider
Constructs a dial with the default range of QRangeControl.
Constructs a dial whose value can never be smaller than minValue or greater than maxValue, whose line step size is lineStep and page step size is pageStep, and whose value is initially value.
value is forced to be within the legal range.
Destructs the dial.
[slot]
Moves the dial one lineStep() upwards.
[slot]
Moves the dial one pageStep() upwards.
[signal]
This signal is emitted whenever the dial value changes. The frequency of this signal is not influenced by setTracking().
See also valueChanged(int).
[signal]
This signal is emitted when the use begins mouse interaction with the dial.
See also dialReleased().
[signal]
This signal is emitted when the use ends mouse interaction with the dial.
See also dialPressed().
[virtual protected]
Reimplemented for internal reasons; the API is not affected.
Reimplemented from QWidget.
[virtual protected]
Reimplemented for internal reasons; the API is not affected.
Reimplemented from QWidget.
[virtual protected]
Reimplemented for internal reasons; the API is not affected.
Reimplemented from QWidget.
Reimplemented for internal reasons; the API is not affected.
Reimplemented for internal reasons; the API is not affected.
Reimplemented for internal reasons; the API is not affected.
[virtual]
Reimplemented for internal reasons; the API is not affected.
Reimplemented from QWidget.
[virtual protected]
Reimplemented for internal reasons; the API is not affected.
Reimplemented from QWidget.
[virtual protected]
Reimplemented for internal reasons; the API is not affected.
Reimplemented from QWidget.
[virtual protected]
Reimplemented for internal reasons; the API is not affected.
Reimplemented from QWidget.
Returns the current notch size. This is in range control units, not pixels, and if possible it is a multiple of lineStep() that results in an on-screen notch size near notchTarget().
See also notchTarget() and lineStep().
Returns the target size of the notch; this is the number of pixels QDial attempts to put between each little line.
The actual size differs a bit from the target.
Retuns TRUE if notches are shown, else FALSE;.
Reimplemented for internal reasons; the API is not affected.
[virtual protected]
Reimplemented for internal reasons; the API is not affected.
Reimplemented from QWidget.
[virtual protected]
Reimplemented to ensure tick-marks are consistent with the new range.
Reimplemented from QRangeControl.
[virtual protected]
Paints the dial.
[virtual protected]
Reimplemented for internal reasons; the API is not affected.
Reimplemented from QWidget.
Sets the line step to i.
Calls the virtual stepChange() function if the new line step is different from the previous setting.
See also lineStep(), QRangeControl::setSteps(), setPageStep() and setRange().
A convenience function which just calls setRange( minValue(), i )
See also setRange().
A convenience function which just calls setRange( i, maxValue() )
See also setRange().
[virtual]
Sets the dial to use a notch size as close to target pixels as possible. QDial will find a suitable number close to this, based on the dial's on-screen size, range and lineStep().
See also notchTarget() and notchSize().
[virtual slot]
Enables or disables showing of notches. If b is TRUE, the notches are shown, else not.
Sets the page step to i.
Calls the virtual stepChange() function if the new page step is different from the previous setting.
See also pageStep(), QRangeControl::setSteps(), setLineStep() and setRange().
[virtual slot]
If enable is TRUE, tracking is enabled. This means that the arrow can be moved using the mouse. Else this is not possible.
[virtual slot]
Makes QRangeControl::setValue() available as a slot.
[virtual slot]
If enable is TRUE, wrapping is enabled. This means that the arrow can be turned around 360°. Else there is some space at the bottom which is skipped by the arrow.
[virtual]
Reimplemented for internal reasons; the API is not affected.
Reimplemented from QWidget.
[slot]
Moves the dial one lineStep() downwards.
[slot]
Moves the dial one pageStep() downwards.
Returns TRUE if tracking is enabled, or FALSE if tracking is disabled.
Tracking is initially enabled.
See also setTracking().
Reimplemented for internal reasons; the API is not affected.
[virtual protected]
Reimplemented to ensure the display is correct and to emit the valueChanged(int) signal when appropriate.
Reimplemented from QRangeControl.
[signal]
This signal is emitted whenever the dial value changes. The frequency of this signal is influenced by setTracking().
[virtual protected]
Reimplemented for internal reasons; the API is not affected.
Reimplemented from QWidget.
Returns TRUE if wrapping is enabled, else FALSE.
See also QDial::setWrapping().
Search the documentation, FAQ, qt-interest archive and more (uses
www.trolltech.com):
This file is part of the Qt toolkit, copyright © 1995-2000 Trolltech, all rights reserved.
Copyright © 2000 Trolltech | Trademarks | Qt version 2.2.1
|