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

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

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

__NOTOC__

Image:qt-logo.png

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

Image:trolltech-logo.png

Содержание

[править] Q3TimeEdit Class Reference
[ Qt3Support module]

The Q3TimeEdit class provides a time editor. Далее...

 #include <Q3TimeEdit>

This class is part of the Qt 3 support library. It is provided to keep old source code working. Мы настоятельно не рекомендуем использовать этот класс в новом коде. See Porting to Qt 4 for more information.

Inherits Q3DateTimeEditBase.

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

  • enum Display { Hours, Minutes, Seconds, AMPM }

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

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

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

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

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

  • virtual void setTime ( const QTime & time )
  • 19 открытых слотов, унаследованных от QWidget
  • 1 открытый слот, унаследованный от QObject

[править] Сигналы

  • 1 сигнал, унаследованный от QWidget
  • 1 сигнал, унаследованный от QObject

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

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

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

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

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

The Q3TimeEdit class provides a time editor.

Q3TimeEdit allows the user to edit times by using the keyboard or the arrow keys to increase/decrease time values. The arrow keys can be used to move from section to section within the Q3TimeEdit box. The user can automatically be moved to the next section once they complete a section using setAutoAdvance(). Times appear in hour, minute, second order. It is recommended that the Q3TimeEdit is initialised with a time, e.g.

 QTime timeNow = QTime::currentTime();
 Q3TimeEdit *timeEdit = new Q3TimeEdit(timeNow, this);
 timeEdit->setRange(timeNow, timeNow.addSecs(60 * 60));

Here we've created a Q3TimeEdit widget set to the current time. We've also set the minimum value to the current time and the maximum time to one hour from now.

The maximum and minimum values for a time value in the time editor default to the maximum and minimum values for a QTime. You can change this by calling setMinValue(), setMaxValue() or setRange().

Terminology: A QTimeWidget consists of three sections, one each for the hour, minute and second. You can change the separator character using setSeparator(), by default the separator is read from the system's settings.

center

See also QTime, Q3DateEdit, and Q3DateTimeEdit.


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

[править]
enum Q3TimeEdit::Display

This enum defines the sections that comprise a time


Константа Значение Описание
Q3TimeEdit::Hours 0x01 The hours section
Q3TimeEdit::Minutes 0x02 The minutes section
Q3TimeEdit::Seconds 0x04 The seconds section
Q3TimeEdit::AMPM 0x10 The AM/PM section

The values can be or'ed together to show any combination.


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

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

This property holds whether the editor automatically advances to the next section.

If autoAdvance is true, the editor will automatically advance focus to the next time section if a user has completed a section. По умолчанию равно false.

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

  • bool autoAdvance () const
  • virtual void setAutoAdvance ( bool advance )

[править]
display : Display

This property holds the sections that are displayed in the time edit.

The value can be any combination of the values in the Display enum. By default, the widget displays hours, minutes and seconds.

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

  • uint display () const
  • void setDisplay ( uint disp )

[править]
maxValue : QTime

This property holds the maximum time value.

Setting the maximum time value is equivalent to calling Q3TimeEdit::setRange( minValue(), t), where t is the maximum time. The default maximum time is 23:59:59.

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

  • QTime maxValue () const
  • virtual void setMaxValue ( const QTime & d )

See also minValue and setRange().

[править]
minValue : QTime

This property holds the minimum time value.

Setting the minimum time value is equivalent to calling Q3TimeEdit::setRange(t, maxValue()), where t is the minimum time. The default minimum time is 00:00:00.

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

  • QTime minValue () const
  • virtual void setMinValue ( const QTime & d )

See also maxValue and setRange().

[править]
time : QTime

This property holds the editor's time value.

When changing the time property, if the time is less than minValue(), or is greater than maxValue(), nothing happens.

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

  • QTime time () const
  • virtual void setTime ( const QTime & time )

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

[править]
Q3TimeEdit::Q3TimeEdit ( QWidget * parent = 0, const char * name = 0 )

Constructs an empty time edit with parent parent and called name.

[править]
Q3TimeEdit::Q3TimeEdit ( const QTime & time, QWidget * parent = 0, const char * name = 0 )

Constructs a time edit with the initial time value, time, parent parent and called name.

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

Удаляет объект и очищает любые выделенные ресурсы.

[править]
QString Q3TimeEdit::sectionFormattedText ( int sec ) [virtual protected]

Returns the formatted number for section sec. This will correspond to either the hour, minute or second section, depending on sec.

[править]
QString Q3TimeEdit::separator () const

Returns the editor's separator.

See also setSeparator().

[править]
void Q3TimeEdit::setHour ( int h ) [virtual protected]

Sets the hour to h, which must be a valid hour, i.e. in the range 0..24.

[править]
void Q3TimeEdit::setMinute ( int m ) [virtual protected]

Sets the minute to m, which must be a valid minute, i.e. in the range 0..59.

[править]
void Q3TimeEdit::setRange ( const QTime & min, const QTime & max ) [virtual]

Sets the valid input range for the editor to be from min to max inclusive. If min is invalid no minimum time is set. Similarly, if max is invalid no maximum time is set.

[править]
void Q3TimeEdit::setSecond ( int s ) [virtual protected]

Sets the second to s, which must be a valid second, i.e. in the range 0..59.

[править]
void Q3TimeEdit::setSeparator ( const QString & s ) [virtual]

Sets the separator to s. Note that currently only the first character of s is used.

See also separator().

[править]
void Q3TimeEdit::valueChanged ( const QTime & time ) [signal]

This signal is emitted whenever the editor's value changes. The time parameter is the new value.



Copyright © 2007 Trolltech Trademarks
Qt 4.3.2