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

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

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



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



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

The Q3DateTimeEdit class combines a Q3DateEdit and Q3TimeEdit widget into a single widget for editing datetimes. More...

 #include <Q3DateTimeEdit>

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.

Наследует QWidget.

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

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

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

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

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

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

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

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

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

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

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

The Q3DateTimeEdit class combines a Q3DateEdit and Q3TimeEdit widget into a single widget for editing datetimes.

Q3DateTimeEdit consists of a Q3DateEdit and Q3TimeEdit widget placed side by side and offers the functionality of both. The user can edit the date and time by using the keyboard or the arrow keys to increase/decrease date or time values. The Tab key can be used to move from section to section within the Q3DateTimeEdit widget, and the user can be moved automatically when they complete a section using setAutoAdvance(). The datetime can be set with setDateTime().

The date format is read from the system's locale settings. It is set to year, month, day order if that is not possible. See Q3DateEdit::setOrder() to change this. Times appear in the order hours, minutes, seconds using the 24 hour clock.

It is recommended that the Q3DateTimeEdit is initialised with a datetime, e.g.

 Q3DateTimeEdit *dateTimeEdit = new Q3DateTimeEdit(QDateTime::currentDateTime(), this);

Here we've created a new Q3DateTimeEdit set to the current date and time, and set the date to have a minimum date of now and a maximum date of a week from now.

Terminology: A Q3DateEdit widget consists of three 'sections', one each for the year, month and day. Similarly a Q3TimeEdit consists of three sections, one each for the hour, minute and second. The character that separates each date section is specified with setDateSeparator(); similarly setTimeSeparator() is used for the time sections.


See also Q3DateEdit and Q3TimeEdit.

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

dateTime : QDateTime

This property holds the editor's datetime value.

The datetime edit's datetime which may be an invalid datetime.

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

  • QDateTime dateTime () const
  • virtual void setDateTime ( const QDateTime & dt )

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

Q3DateTimeEdit::Q3DateTimeEdit ( QWidget * parent = 0, const char * name = 0 )

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

Q3DateTimeEdit::Q3DateTimeEdit ( const QDateTime & datetime, QWidget * parent = 0, const char * name = 0 )

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

Q3DateTimeEdit::~Q3DateTimeEdit ()

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

bool Q3DateTimeEdit::autoAdvance () const

Returns true if auto-advance is enabled, otherwise returns false.

See also setAutoAdvance().

Q3DateEdit * Q3DateTimeEdit::dateEdit ()

Returns the internal widget used for editing the date part of the datetime.

void Q3DateTimeEdit::setAutoAdvance ( bool advance ) [virtual]

Sets the auto advance property of the editor to advance. If set to true, the editor will automatically advance focus to the next date or time section if the user has completed a section.

See also autoAdvance().

Q3TimeEdit * Q3DateTimeEdit::timeEdit ()

Returns the internal widget used for editing the time part of the datetime.

void Q3DateTimeEdit::valueChanged ( const QDateTime & datetime ) [signal]

This signal is emitted every time the date or time changes. The datetime argument is the new datetime.

Copyright © 2007 Trolltech Trademarks
Qt 4.3.2