Qt:Документация 4.3.2/qdial

Материал из Wiki.crossplatform.ru

Перейти к: навигация, поиск
40px Внимание: Актуальная версия перевода документации находится здесь

__NOTOC__

Image:qt-logo.png

Главная · Все классы · Основные классы · Классы по группам · Модули · Функции

Image:trolltech-logo.png

Содержание

[править] QDial Class Reference
[модуль QtGui ]

The QDial class provides a rounded range control (like a speedometer or potentiometer). More...

 #include <QDial>

Inherits QAbstractSlider.

[править] Свойства

  • 11 свойства унаследованных от QAbstractSlider
  • 56 свойства унаследованных от QWidget
  • 1 свойство унаследованное от QObject

[править] Открытые функции

  • 22 открытых функций унаследованных от QAbstractSlider
  • 201 открытых функций унаследованных от QWidget
  • 29 открытых функций унаследованных от QObject
  • 12 открытых функций унаследованных от QPaintDevice

[править] Открытые слоты

  • 2 открытых слотов унаследованных от QAbstractSlider
  • 19 открытых слотов унаследованных от QWidget
  • 1 открытый слот унаследованный от QObject

[править] Защищенные функции

  • 3 защищенных функций унаследованных от QAbstractSlider
  • 38 защищенных функций унаследованных от QWidget
  • 7 защищенных функций унаследованных от QObject
  • 1 защищенная функция унаследованна от QPaintDevice

[править] Дополнительные унаследованные члены

  • 6 сигнала унаследованных от QAbstractSlider
  • 1 сигнал унаследованный от QWidget
  • 1 сигнал унаследованный от QObject
  • 4 статических открытых члена унаследованных от QWidget
  • 5 статических открытых члена унаследованных от QObject
  • 1 защищенный слот унаследованный от QWidget

[править] Подробное описание

The QDial class provides a rounded range control (like a speedometer or potentiometer).

QDial is used when the user needs to control a value within a program-definable range, and the range either wraps around (for example, with angles measured from 0 to 359 degrees) or the dialog layout needs a square widget.

Since QDial inherits from QAbstractSlider, the dial behaves in a similar way to a slider. When wrapping() is false (the default setting) there is no real difference between a slider and a dial. They both share the same signals, slots and member functions. Which one you use depends on the expectations of your users and on the type of application.

The dial initially emits valueChanged() signals continuously while the slider is being moved; you can make it emit the signal less often by disabling the tracking property. The sliderMoved() signal is emitted continuously even when tracking is disabled.

The dial also emits sliderPressed() and sliderReleased() signals when the mouse button is pressed and released. Note that the dial's value can change without these signals being emitted since the keyboard and wheel can also be used to change the value.

Unlike the slider, QDial attempts to draw a "nice" number of notches rather than one per line step. If possible, the number of notches drawn is one per line step, but if there aren't enough pixels to draw every one, QDial will skip notches to try and draw a uniform set (e.g. by drawing every second or third notch).

Like the slider, the dial makes the QAbstractSlider functions setValue(), addLine(), subtractLine(), addPage() and subtractPage() available as slots.

The dial's keyboard interface is fairly simple: The left/up and right/down arrow keys adjust the dial's value by the defined singleStep, Page Up and Page Down by the defined pageStep, and the Home and End keys set the value to the defined minimum and maximum values.


Файл:Plastique-dial.png center center
Dials shown in various widget styles (from left to right): Plastique, Windows XP, Macintosh.

See also QScrollBar, QSpinBox, QSlider, GUI Design Handbook: Slider, and Sliders Example.


[править] Описание свойств

[править]
notchSize : const int

This property holds the current notch size.

The notch size is in range control units, not pixels, and if possible it is a multiple of singleStep() that results in an on-screen notch size near notchTarget().

Функции доступа:

  • int notchSize () const

See also notchTarget() and singleStep().

[править]
notchTarget : qreal

This property holds the target number of pixels between notches.

The notch target is the number of pixels QDial attempts to put between each notch.

The actual size may differ from the target size.

The default notch target is 3.7 pixels.

Функции доступа:

  • qreal notchTarget () const
  • void setNotchTarget ( double target )

[править]
notchesVisible : bool

This property holds whether the notches are shown.

If the property is true, a series of notches are drawn around the dial to indicate the range of values available; otherwise no notches are shown.

By default, this property is disabled.

Функции доступа:

  • bool notchesVisible () const
  • void setNotchesVisible ( bool visible )

[править]
wrapping : bool

This property holds whether wrapping is enabled.

If true, wrapping is enabled; otherwise some space is inserted at the bottom of the dial to separate the ends of the range of valid values.

If enabled, the arrow can be oriented at any angle on the dial. If disabled, the arrow will be restricted to the upper part of the dial; if it is rotated into the space at the bottom of the dial, it will be clamped to the closest end of the valid range of values.

By default this property is false.

Функции доступа:

  • bool wrapping () const
  • void setWrapping ( bool on )

[править] Описание функций-членов

[править]
QDial::QDial ( QWidget * parent = 0 )

Constructs a dial.

The parent argument is sent to the QAbstractSlider constructor.

[править]
QDial::~QDial ()

Destroys the dial.

[править]
void QDial::initStyleOption ( QStyleOptionSlider * option ) const [protected]

Initialize option with the values from this QDial. This method is useful for subclasses when they need a QStyleOptionSlider, but don't want to fill in all the information themselves.

See also QStyleOption::initFrom().


Copyright © 2007 Trolltech Trademarks
Qt 4.3.2