Eneboo - Documentación para desarrolladores
Tipos públicos | Slots públicos | Señales | Métodos públicos | Slots protegidos | Métodos protegidos | Propiedades
Referencia de la Clase QTimeEdit

The QTimeEdit class provides a time editor. Más...

#include <qdatetimeedit.h>

Diagrama de herencias de QTimeEdit
QDateTimeEditBase QDateTimeEditBase QWidget QWidget QWidget QWidget QPaintDevice QObject QPaintDevice QObject QPaintDevice QObject QPaintDevice QObject QPaintDevice QObject QPaintDevice QObject QPaintDevice QObject QPaintDevice QObject

Lista de todos los miembros.

Tipos públicos

enum  Display {
  Hours = 0x01, Minutes = 0x02, Seconds = 0x04, AMPM = 0x10,
  Hours = 0x01, Minutes = 0x02, Seconds = 0x04, AMPM = 0x10
}
enum  Display {
  Hours = 0x01, Minutes = 0x02, Seconds = 0x04, AMPM = 0x10,
  Hours = 0x01, Minutes = 0x02, Seconds = 0x04, AMPM = 0x10
}

Slots públicos

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

Señales

void valueChanged (const QTime &time)
void valueChanged (const QTime &time)

Métodos públicos

 QTimeEdit (QWidget *parent=0, const char *name=0)
 QTimeEdit (const QTime &time, QWidget *parent=0, const char *name=0)
 ~QTimeEdit ()
QSize sizeHint () const
QSize minimumSizeHint () const
QTime time () const
virtual void setAutoAdvance (bool advance)
bool autoAdvance () const
virtual void setMinValue (const QTime &d)
QTime minValue () const
virtual void setMaxValue (const QTime &d)
QTime maxValue () const
virtual void setRange (const QTime &min, const QTime &max)
QString separator () const
virtual void setSeparator (const QString &s)
uint display () const
void setDisplay (uint disp)
void removeFirstNumber (int sec)
 QTimeEdit (QWidget *parent=0, const char *name=0)
 QTimeEdit (const QTime &time, QWidget *parent=0, const char *name=0)
 ~QTimeEdit ()
QSize sizeHint () const
QSize minimumSizeHint () const
QTime time () const
virtual void setAutoAdvance (bool advance)
bool autoAdvance () const
virtual void setMinValue (const QTime &d)
QTime minValue () const
virtual void setMaxValue (const QTime &d)
QTime maxValue () const
virtual void setRange (const QTime &min, const QTime &max)
QString separator () const
virtual void setSeparator (const QString &s)
uint display () const
void setDisplay (uint disp)
void removeFirstNumber (int sec)

Slots protegidos

void updateButtons ()
void updateButtons ()

Métodos protegidos

bool event (QEvent *e)
void timerEvent (QTimerEvent *e)
void resizeEvent (QResizeEvent *)
void stepUp ()
void stepDown ()
QString sectionFormattedText (int sec)
void addNumber (int sec, int num)
void removeLastNumber (int sec)
bool setFocusSection (int s)
virtual bool outOfRange (int h, int m, int s) const
virtual void setHour (int h)
virtual void setMinute (int m)
virtual void setSecond (int s)
bool event (QEvent *e)
void timerEvent (QTimerEvent *e)
void resizeEvent (QResizeEvent *)
void stepUp ()
void stepDown ()
QString sectionFormattedText (int sec)
void addNumber (int sec, int num)
void removeLastNumber (int sec)
bool setFocusSection (int s)
virtual bool outOfRange (int h, int m, int s) const
virtual void setHour (int h)
virtual void setMinute (int m)
virtual void setSecond (int s)

Propiedades

QTime time
 the editor's time value.
bool autoAdvance
 whether the editor automatically advances to the next section
QTime maxValue
 the maximum time value
QTime minValue
 the minimum time value
Display display
 the sections that are displayed in the time edit

Descripción detallada

The QTimeEdit class provides a time editor.

QTimeEdit 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 QTimeEdit 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 QTimeEdit is initialised with a time, e.g.

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

Here we've created a QTimeEdit 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.

datetimewidgets.png Date Time Widgets

Ver también:
QTime QDateEdit QDateTimeEdit

Documentación de las enumeraciones miembro de la clase

This enum defines the sections that comprise a time

Hours The hours section Minutes The minutes section Seconds The seconds section AMPM The AM/PM section

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

Valores de enumeraciones:
Hours 
Minutes 
Seconds 
AMPM 
Hours 
Minutes 
Seconds 
AMPM 
Valores de enumeraciones:
Hours 
Minutes 
Seconds 
AMPM 
Hours 
Minutes 
Seconds 
AMPM 

Documentación del constructor y destructor

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

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

QTimeEdit::QTimeEdit ( const QTime time,
QWidget parent = 0,
const char *  name = 0 
)

Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Constructs a time edit with the initial time value, time, parent parent and called name.

QTimeEdit::~QTimeEdit ( )

Destroys the object and frees any allocated resources.

QTimeEdit::QTimeEdit ( QWidget parent = 0,
const char *  name = 0 
)
QTimeEdit::QTimeEdit ( const QTime time,
QWidget parent = 0,
const char *  name = 0 
)
QTimeEdit::~QTimeEdit ( )

Documentación de las funciones miembro

void QTimeEdit::addNumber ( int  sec,
int  num 
) [protected, virtual]

Implementa QDateTimeEditBase.

void QTimeEdit::addNumber ( int  sec,
int  num 
) [protected, virtual]

Implementa QDateTimeEditBase.

bool QTimeEdit::autoAdvance ( ) const
bool QTimeEdit::autoAdvance ( ) const
uint QTimeEdit::display ( ) const
uint QTimeEdit::display ( ) const
bool QTimeEdit::event ( QEvent e) [protected, virtual]

Reimplementado de QWidget.

bool QTimeEdit::event ( QEvent e) [protected, virtual]

This is the main event handler; it handles event e. You can reimplement this function in a subclass, but we recommend using one of the specialized event handlers instead.

The main event handler first passes an event through all event filters that have been installed. If none of the filters intercept the event, it calls one of the specialized event handlers.

Key press and release events are treated differently from other events. event() checks for Tab and Shift+Tab and tries to move the focus appropriately. If there is no widget to move the focus to (or the key press is not Tab or Shift+Tab), event() calls keyPressEvent().

This function returns TRUE if it is able to pass the event over to someone (i.e. someone wanted the event); otherwise returns FALSE.

Ver también:
closeEvent(), focusInEvent(), focusOutEvent(), enterEvent(), keyPressEvent(), keyReleaseEvent(), leaveEvent(), mouseDoubleClickEvent(), mouseMoveEvent(), mousePressEvent(), mouseReleaseEvent(), moveEvent(), paintEvent(), resizeEvent(), QObject::event(), QObject::timerEvent()

Reimplementado de QWidget.

QTime QTimeEdit::maxValue ( ) const
QTime QTimeEdit::maxValue ( ) const
QSize QTimeEdit::minimumSizeHint ( ) const [virtual]

Reimplementado de QWidget.

QSize QTimeEdit::minimumSizeHint ( ) const [virtual]

Reimplementado de QWidget.

QTime QTimeEdit::minValue ( ) const
QTime QTimeEdit::minValue ( ) const
bool QTimeEdit::outOfRange ( int  h,
int  m,
int  s 
) const [protected, virtual]
virtual bool QTimeEdit::outOfRange ( int  h,
int  m,
int  s 
) const [protected, virtual]
void QTimeEdit::removeFirstNumber ( int  sec)
void QTimeEdit::removeFirstNumber ( int  sec)
void QTimeEdit::removeLastNumber ( int  sec) [protected, virtual]

Implementa QDateTimeEditBase.

void QTimeEdit::removeLastNumber ( int  sec) [protected, virtual]

Implementa QDateTimeEditBase.

void QTimeEdit::resizeEvent ( QResizeEvent ) [protected, virtual]

Reimplementado de QWidget.

void QTimeEdit::resizeEvent ( QResizeEvent ) [protected, virtual]

This event handler can be reimplemented in a subclass to receive widget resize events. When resizeEvent() is called, the widget already has its new geometry. The old size is accessible through QResizeEvent::oldSize().

The widget will be erased and receive a paint event immediately after processing the resize event. No drawing need be (or should be) done inside this handler.

Widgets that have been created with the WNoAutoErase flag will not be erased. Nevertheless, they will receive a paint event for their entire area afterwards. Again, no drawing needs to be done inside this handler.

The default implementation calls updateMask() if the widget has automatic masking enabled.

Ver también:
moveEvent(), event(), resize(), QResizeEvent, paintEvent()

Reimplementado de QWidget.

QString QTimeEdit::sectionFormattedText ( int  sec) [protected, virtual]

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

Implementa QDateTimeEditBase.

QString QTimeEdit::sectionFormattedText ( int  sec) [protected, virtual]

Implementa QDateTimeEditBase.

QString QTimeEdit::separator ( ) const
QString QTimeEdit::separator ( ) const

Returns the editor's separator.

void QTimeEdit::setAutoAdvance ( bool  advance) [virtual]
virtual void QTimeEdit::setAutoAdvance ( bool  advance) [virtual]
void QTimeEdit::setDisplay ( uint  disp)
void QTimeEdit::setDisplay ( uint  disp)
bool QTimeEdit::setFocusSection ( int  sec) [protected, virtual]

Implementa QDateTimeEditBase.

bool QTimeEdit::setFocusSection ( int  s) [protected, virtual]

Implementa QDateTimeEditBase.

void QTimeEdit::setHour ( int  h) [protected, virtual]

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

virtual void QTimeEdit::setHour ( int  h) [protected, virtual]
virtual void QTimeEdit::setMaxValue ( const QTime d) [inline, virtual]
virtual void QTimeEdit::setMaxValue ( const QTime d) [inline, virtual]
void QTimeEdit::setMinute ( int  m) [protected, virtual]

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

virtual void QTimeEdit::setMinute ( int  m) [protected, virtual]
virtual void QTimeEdit::setMinValue ( const QTime d) [inline, virtual]
virtual void QTimeEdit::setMinValue ( const QTime d) [inline, virtual]
virtual void QTimeEdit::setRange ( const QTime min,
const QTime max 
) [virtual]
void QTimeEdit::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.

virtual void QTimeEdit::setSecond ( int  s) [protected, virtual]
void QTimeEdit::setSecond ( int  s) [protected, virtual]

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

virtual void QTimeEdit::setSeparator ( const QString s) [virtual]
void QTimeEdit::setSeparator ( const QString s) [virtual]

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

virtual void QTimeEdit::setTime ( const QTime time) [virtual, slot]
void QTimeEdit::setTime ( const QTime time) [virtual, slot]
QSize QTimeEdit::sizeHint ( ) const [virtual]

Reimplementado de QWidget.

QSize QTimeEdit::sizeHint ( ) const [virtual]

Reimplementado de QWidget.

void QTimeEdit::stepDown ( ) [protected, virtual]

Implementa QDateTimeEditBase.

void QTimeEdit::stepDown ( ) [protected, virtual]

Implementa QDateTimeEditBase.

void QTimeEdit::stepUp ( ) [protected, virtual]

Implementa QDateTimeEditBase.

void QTimeEdit::stepUp ( ) [protected, virtual]

Implementa QDateTimeEditBase.

QTime QTimeEdit::time ( ) const
QTime QTimeEdit::time ( ) const
void QTimeEdit::timerEvent ( QTimerEvent ) [protected, virtual]

This event handler can be reimplemented in a subclass to receive timer events for the object.

QTimer provides a higher-level interface to the timer functionality, and also more general information about timers.

Ver también:
startTimer(), killTimer(), killTimers(), event()

Reimplementado de QObject.

void QTimeEdit::timerEvent ( QTimerEvent e) [protected, virtual]

Reimplementado de QObject.

void QTimeEdit::updateButtons ( ) [protected, slot]
void QTimeEdit::updateButtons ( ) [protected, slot]
void QTimeEdit::valueChanged ( const QTime time) [signal]

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

void QTimeEdit::valueChanged ( const QTime time) [signal]

Documentación de propiedades

bool QTimeEdit::autoAdvance [read, write]

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. The default is FALSE.

Display QTimeEdit::display [read, write]

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.

QTime QTimeEdit::maxValue [read, write]

the maximum time value

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

Ver también:
minValue setRange()
QTime QTimeEdit::minValue [read, write]

the minimum time value

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

Ver también:
maxValue setRange()
QTime QTimeEdit::time [read, write]

the editor's time value.

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


La documentación para esta clase fue generada a partir de los siguientes ficheros:
 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Propiedades Amigas 'defines'