Q3DateEdit Class ReferenceThe Q3DateEdit class provides a date editor. Далее... #include <Q3DateEdit> Данный класс является частью библиотеки поддержки Qt 3. Он предоставлен для поддержки ранее написанного кода. Мы настоятельно не рекомендуем использовать этот класс в новом коде. Для получения дополнительной информации смотрите Портирование на Qt 4. Inherits: Q3DateTimeEditBase. Открытые типы
Свойства
Открытые функции
Переопределённые открытые функции
Открытые слоты
Сигналы
Защищенные функции
Переопределённые защищённые функции
Защищённые слоты
Дополнительные унаследованные члены
Подробное описаниеThe Q3DateEdit class provides a date editor. Q3DateEdit allows the user to edit dates by using the keyboard or the arrow keys to increase/decrease date values. The arrow keys can be used to move from section to section within the Q3DateEdit box. Dates appear in accordance with the local date/time settings or in year, month, day order if the system doesn't provide this information. It is recommended that the Q3DateEdit be initialised with a date, e.g. Q3DateEdit *dateEdit = new Q3DateEdit(QDate::currentDate(), this); dateEdit->setRange(QDate::currentDate().addDays(-365), QDate::currentDate().addDays( 365)); dateEdit->setOrder(Q3DateEdit::MDY); dateEdit->setAutoAdvance(true); Here we've created a new Q3DateEdit object initialised with today's date and restricted the valid date range to today plus or minus 365 days. We've set the order to month, day, year. If the auto advance property is true (as we've set it here) when the user completes a section of the date, e.g. enters two digits for the month, they are automatically taken to the next section. The maximum and minimum values for a date value in the date editor default to the maximum and minimum values for a QDate. You can change this by calling setMinValue(), setMaxValue() or setRange(). Terminology: A Q3DateEdit widget comprises three 'sections', one each for the year, month and day. You can change the separator character using Q3DateTimeEditor::setSeparator(), by default the separator will be taken from the systems settings. If that is not possible, it defaults to "-". See also QDate, Q3TimeEdit, and Q3DateTimeEdit. Описание типов-членовenum Q3DateEdit::OrderThis enum defines the order in which the sections that comprise a date appear.
Описание свойствautoAdvance : boolThis property holds whether the editor automatically advances to the next section. If autoAdvance is true, the editor will automatically advance focus to the next date section if a user has completed a section. По умолчанию равно false. Функции доступа:
date : QDateThis property holds the editor's date value. If the date property is not valid, the editor displays all zeroes and Q3DateEdit::date() will return an invalid date. It is strongly recommended that the editor is given a default date value (e.g. currentDate()). That way, attempts to set the date property to an invalid date will fail. When changing the date property, if the date is less than minValue(), or is greater than maxValue(), nothing happens. Функции доступа:
maxValue : QDateThis property holds the editor's maximum value. Setting the maximum date value for the editor is equivalent to calling Q3DateEdit::setRange(minValue(), d), where d is the maximum date. The default maximum date is 8000-12-31. Функции доступа:
See also minValue and setRange(). minValue : QDateThis property holds the editor's minimum value. Setting the minimum date value is equivalent to calling Q3DateEdit::setRange(d, maxValue()), where d is the minimum date. The default minimum date is 1752-09-14. Функции доступа:
See also maxValue and setRange(). order : OrderThis property holds the order in which the year, month and day appear. The default order is locale dependent. Функции доступа:
See also Order. Описание функций-членовQ3DateEdit::Q3DateEdit ( QWidget * parent = 0, const char * name = 0 )Constructs an empty date editor which is a child of parent and called name name. Q3DateEdit::Q3DateEdit ( const QDate & date, QWidget * parent = 0, const char * name = 0 )Это перегруженная функция. Constructs a date editor with the initial value date, parent parent and called name. The date editor is initialized with date. Q3DateEdit::~Q3DateEdit ()Удаляет объект и освобождает все выделенные ему ресурсы. bool Q3DateEdit::event ( QEvent * e ) [virtual protected]Переопределено от QObject::event(). void Q3DateEdit::fix () [virtual protected]Attempts to fix any invalid date entries. The rules applied are as follows:
QSize Q3DateEdit::minimumSizeHint () const [virtual]Переопределено от QWidget::minimumSizeHint(). void Q3DateEdit::resizeEvent ( QResizeEvent * ) [virtual protected]Переопределено от QWidget::resizeEvent(). QString Q3DateEdit::sectionFormattedText ( int sec ) [virtual protected]Returns the formatted number for section sec. This will correspond to either the year, month or day section, depending on the current display order. See also setOrder(). QString Q3DateEdit::separator () constReturns the editor's separator. Смотрите также setSeparator(). void Q3DateEdit::setDay ( int day ) [virtual protected]Sets the day to day, which must be a valid day. The function will ensure that the day set is valid for the month and year. void Q3DateEdit::setMonth ( int month ) [virtual protected]Sets the month to month, which must be a valid month, i.e. between 1 and 12. void Q3DateEdit::setRange ( const QDate & min, const QDate & max ) [virtual]Sets the valid input range for the editor to be from min to max inclusive. If min is invalid no minimum date will be set. Similarly, if max is invalid no maximum date will be set. void Q3DateEdit::setSeparator ( const QString & s ) [virtual]Sets the separator to s. Note that currently only the first character of s is used. Смотрите также separator(). void Q3DateEdit::setYear ( int year ) [virtual protected]Sets the year to year, which must be a valid year. The range currently supported is from 1752 to 8000. See also QDate. QSize Q3DateEdit::sizeHint () const [virtual]Переопределено от QWidget::sizeHint(). void Q3DateEdit::timerEvent ( QTimerEvent * ) [virtual protected]Переопределено из QObject::timerEvent(). void Q3DateEdit::updateButtons () [protected slot]Enables/disables the push buttons according to the min/max date for this widget. void Q3DateEdit::valueChanged ( const QDate & date ) [signal]This signal is emitted whenever the editor's value changes. The date parameter is the new value. |
Попытка перевода Qt документации. Если есть желание присоединиться, или если есть замечания или пожелания, то заходите на форум: Перевод Qt документации на русский язык... Люди внесшие вклад в перевод: Команда переводчиков |