Qt Jambi Home

com.trolltech.qt.gui
Class QDateTimeEdit

java.lang.Object
  extended by com.trolltech.qt.QSignalEmitter
      extended by com.trolltech.qt.QtJambiObject
          extended by com.trolltech.qt.core.QObject
              extended by com.trolltech.qt.gui.QWidget
                  extended by com.trolltech.qt.gui.QAbstractSpinBox
                      extended by com.trolltech.qt.gui.QDateTimeEdit
All Implemented Interfaces:
QPaintDeviceInterface, QtJambiInterface
Direct Known Subclasses:
QDateEdit, QTimeEdit

public class QDateTimeEdit
extends QAbstractSpinBox

The QDateTimeEdit class provides a widget for editing dates and times.

QDateTimeEdit allows the user to edit dates by using the keyboard or the arrow keys to increase and decrease date and time values. The arrow keys can be used to move from section to section within the QDateTimeEdit box. Dates and times appear in accordance with the format set; see setDisplayFormat.

    QDateTimeEdit *dateEdit = new QDateTimeEdit(QDate::currentDate());
    dateEdit->setMinimumDate(QDate::currentDate().addDays(-365));
    dateEdit->setMaximumDate(QDate::currentDate().addDays(365));
    dateEdit->setDisplayFormat("yyyy.MM.dd");

Here we've created a new QDateTimeEdit object initialized 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.

The minimum value for QDateTimeEdit is 14 September 1752, and 2 January 4713BC for QDate. You can change this by calling setMinimumDate, setMaximumDate, setMinimumTime, and setMaximumTime.

Screenshot of a Windows XP style date time editing widgetA date time editing widget shown in the Windows XP widget style.
Screenshot of a Macintosh style date time editing widgetA date time editing widget shown in the Macintosh widget style.
Screenshot of a Plastique style date time editing widgetA date time editing widget shown in the Plastique widget style.

See Also:
QDateEdit, QTimeEdit, QDate, QTime

Nested Class Summary
static class QDateTimeEdit.Section
          Press link for info on QDateTimeEdit.Section
static class QDateTimeEdit.Sections
          This QFlag class provides flags for the int enum.
 
Nested classes/interfaces inherited from class com.trolltech.qt.gui.QAbstractSpinBox
QAbstractSpinBox.ButtonSymbols, QAbstractSpinBox.CorrectionMode, QAbstractSpinBox.StepEnabled, QAbstractSpinBox.StepEnabledFlag
 
Nested classes/interfaces inherited from class com.trolltech.qt.gui.QWidget
QWidget.RenderFlag, QWidget.RenderFlags
 
Nested classes/interfaces inherited from class com.trolltech.qt.QSignalEmitter
QSignalEmitter.AbstractSignal, QSignalEmitter.Signal0, QSignalEmitter.Signal1<A>, QSignalEmitter.Signal2<A,B>, QSignalEmitter.Signal3<A,B,C>, QSignalEmitter.Signal4<A,B,C,D>, QSignalEmitter.Signal5<A,B,C,D,E>, QSignalEmitter.Signal6<A,B,C,D,E,F>, QSignalEmitter.Signal7<A,B,C,D,E,F,G>, QSignalEmitter.Signal8<A,B,C,D,E,F,G,H>, QSignalEmitter.Signal9<A,B,C,D,E,F,G,H,I>
 
Field Summary
 QSignalEmitter.Signal1<QDate> dateChanged
          This signal is emitted whenever the date is changed.
 QSignalEmitter.Signal1<QDateTime> dateTimeChanged
          This signal is emitted whenever the date or time is changed.
 QSignalEmitter.Signal1<QTime> timeChanged
          This signal is emitted whenever the time is changed.
 
Fields inherited from class com.trolltech.qt.gui.QAbstractSpinBox
editingFinished
 
Fields inherited from class com.trolltech.qt.gui.QWidget
customContextMenuRequested
 
Constructor Summary
QDateTimeEdit()
          Equivalent to QDateTimeEdit(0).
QDateTimeEdit(QDate d)
          Equivalent to QDateTimeEdit(d, 0).
QDateTimeEdit(QDate d, QWidget parent)
          Constructs an empty date time editor with a parent.
QDateTimeEdit(QDateTime dt)
          Equivalent to QDateTimeEdit(dt, 0).
QDateTimeEdit(QDateTime dt, QWidget parent)
          Constructs an empty date time editor with a parent.
QDateTimeEdit(QTime t)
          Equivalent to QDateTimeEdit(t, 0).
QDateTimeEdit(QTime t, QWidget parent)
          Constructs an empty date time editor with a parent.
QDateTimeEdit(QWidget parent)
          Constructs an empty date time editor with a parent.
 
Method Summary
 boolean calendarPopup()
          Returns the current calender popup showing mode..
 void clear()
          This function is reimplemented for internal reasons.
 void clearMaximumDate()
          Resets the maximum date of the date time edit.
 void clearMaximumTime()
          Resets the maximum time of the date time edit.
 void clearMinimumDate()
          Resets the minimum date of the date time edit.
 void clearMinimumTime()
          Resets the minimum time of the date time edit.
 QDateTimeEdit.Section currentSection()
          Returns the current section of the spinbox setCurrentSection().
 int currentSectionIndex()
          Returns the current section index of the spinbox.
 QDate date()
          Returns the QDate that is set in the QDateTimeEdit.
 QDateTime dateTime()
          Returns the QDateTime that is set in the QDateTimeEdit.
protected  QDateTime dateTimeFromText(java.lang.String text)
          Returns an appropriate datetime for the given text.
 QDateTimeEdit.Sections displayedSections()
          Returns the currently displayed fields of the date time edit.
 java.lang.String displayFormat()
          Returns the format used to display the time/date of the date time edit.
 boolean event(QEvent event)
          This function is reimplemented for internal reasons.
 java.lang.String fixup(java.lang.String input)
          This function is reimplemented for internal reasons.
protected  void focusInEvent(QFocusEvent event)
          This function is reimplemented for internal reasons.
protected  boolean focusNextPrevChild(boolean next)
          This function is reimplemented for internal reasons.
static QDateTimeEdit fromNativePointer(QNativePointer nativePointer)
          This function returns the QDateTimeEdit instance pointed to by nativePointer
protected  void keyPressEvent(QKeyEvent event)
          This function is reimplemented for internal reasons.
 QDate maximumDate()
          Returns the maximum date of the date time edit.
 QTime maximumTime()
          Returns the maximum time of the date time edit.
 QDate minimumDate()
          Returns the minimum date of the date time edit.
 QTime minimumTime()
          Returns the minimum time of the date time edit.
protected  void mousePressEvent(QMouseEvent event)
          This function is reimplemented for internal reasons.
protected  void paintEvent(QPaintEvent event)
          This function is reimplemented for internal reasons.
 QDateTimeEdit.Section sectionAt(int index)
          Returns the Section at index.
 int sectionCount()
          Returns the number of sections displayed.
 java.lang.String sectionText(QDateTimeEdit.Section section)
          Returns the text from the given section.
 void setCalendarPopup(boolean enable)
          Sets the current calender popup showing mode.
 void setCurrentSection(QDateTimeEdit.Section section)
          Sets the current section of the spinbox setCurrentSection() to section.
 void setCurrentSectionIndex(int index)
          Sets the current section index of the spinbox to index.
 void setDate(QDate date)
          Sets the QDate that is set in the QDateTimeEdit to date.
 void setDateRange(QDate min, QDate max)
          Convenience function to set minimum and maximum date with one function call.
 void setDateTime(QDateTime dateTime)
          Sets the QDateTime that is set in the QDateTimeEdit to dateTime.
 void setDisplayFormat(java.lang.String format)
          Sets the format used to display the time/date of the date time edit to format.
 void setMaximumDate(QDate max)
          Sets the maximum date of the date time edit to max.
 void setMaximumTime(QTime max)
          Sets the maximum time of the date time edit to max.
 void setMinimumDate(QDate min)
          Sets the minimum date of the date time edit to min.
 void setMinimumTime(QTime min)
          Sets the minimum time of the date time edit to min.
 void setSelectedSection(QDateTimeEdit.Section section)
          Selects section.
 void setTime(QTime time)
          Sets the QTime that is set in the QDateTimeEdit to time.
 void setTimeRange(QTime min, QTime max)
          Convenience function to set minimum and maximum time with one function call.
 QSize sizeHint()
          This function is reimplemented for internal reasons.
 void stepBy(int steps)
          This function is reimplemented for internal reasons.
protected  QAbstractSpinBox.StepEnabled stepEnabled()
          This function is reimplemented for internal reasons.
protected  java.lang.String textFromDateTime(QDateTime dt)
          This virtual function is used by the date time edit whenever it needs to display dt.
 QTime time()
          Returns the QTime that is set in the QDateTimeEdit.
 QValidator.State validate(QValidator.QValidationData input)
          Equivalent to validate(input, ).
protected  void wheelEvent(QWheelEvent event)
          This function is reimplemented for internal reasons.
 
Methods inherited from class com.trolltech.qt.gui.QAbstractSpinBox
alignment, buttonSymbols, changeEvent, closeEvent, contextMenuEvent, correctionMode, focusOutEvent, hasAcceptableInput, hasFrame, hideEvent, initStyleOption, interpretText, isAccelerated, isReadOnly, keyboardTracking, keyReleaseEvent, lineEdit, minimumSizeHint, mouseMoveEvent, mouseReleaseEvent, resizeEvent, selectAll, setAccelerated, setAlignment, setAlignment, setButtonSymbols, setCorrectionMode, setFrame, setKeyboardTracking, setLineEdit, setReadOnly, setSpecialValueText, setWrapping, showEvent, specialValueText, stepDown, stepUp, text, timerEvent, wrapping
 
Methods inherited from class com.trolltech.qt.gui.QWidget
acceptDrops, accessibleDescription, accessibleName, actionEvent, actions, activateWindow, addAction, addActions, adjustSize, autoFillBackground, backgroundRole, baseSize, childAt, childAt, childrenRect, childrenRegion, clearFocus, clearMask, close, contentsRect, contextMenuPolicy, createWinId, cursor, depth, destroy, destroy, destroy, devType, dragEnterEvent, dragLeaveEvent, dragMoveEvent, dropEvent, ensurePolished, enterEvent, focusNextChild, focusPolicy, focusPreviousChild, focusProxy, focusWidget, font, fontInfo, fontMetrics, foregroundRole, frameGeometry, frameSize, geometry, getContentsMargins, grabKeyboard, grabMouse, grabMouse, grabShortcut, grabShortcut, hasFocus, hasMouseTracking, height, heightForWidth, heightMM, hide, inputContext, inputMethodEvent, inputMethodQuery, insertAction, insertActions, isActiveWindow, isAncestorOf, isEnabled, isEnabledTo, isFullScreen, isHidden, isLeftToRight, isMaximized, isMinimized, isModal, isRightToLeft, isVisible, isVisibleTo, isWindow, isWindowModified, keyboardGrabber, layout, layoutDirection, leaveEvent, locale, logicalDpiX, logicalDpiY, lower, mapFrom, mapFromGlobal, mapFromParent, mapTo, mapToGlobal, mapToParent, mask, maximumHeight, maximumSize, maximumWidth, metric, minimumHeight, minimumSize, minimumWidth, mouseDoubleClickEvent, mouseGrabber, move, move, moveEvent, nextInFocusChain, normalGeometry, numColors, overrideWindowFlags, overrideWindowFlags, overrideWindowState, overrideWindowState, paintEngine, paintingActive, palette, parentWidget, physicalDpiX, physicalDpiY, pos, raise, rect, releaseKeyboard, releaseMouse, releaseShortcut, removeAction, render, render, render, render, render, repaint, repaint, repaint, repaint, resetInputContext, resize, resize, restoreGeometry, saveGeometry, scroll, scroll, setAcceptDrops, setAccessibleDescription, setAccessibleName, setAttribute, setAttribute, setAutoFillBackground, setBackgroundRole, setBaseSize, setBaseSize, setContentsMargins, setContentsMargins, setContextMenuPolicy, setCursor, setDisabled, setEnabled, setFixedHeight, setFixedSize, setFixedSize, setFixedWidth, setFocus, setFocus, setFocusPolicy, setFocusProxy, setFont, setForegroundRole, setGeometry, setGeometry, setHidden, setInputContext, setLayout, setLayoutDirection, setLocale, setMask, setMask, setMaximumHeight, setMaximumSize, setMaximumSize, setMaximumWidth, setMinimumHeight, setMinimumSize, setMinimumSize, setMinimumWidth, setMouseTracking, setPalette, setParent, setParent, setParent, setShortcutAutoRepeat, setShortcutAutoRepeat, setShortcutEnabled, setShortcutEnabled, setSizeIncrement, setSizeIncrement, setSizePolicy, setSizePolicy, setStatusTip, setStyle, setStyleSheet, setTabOrder, setToolTip, setUpdatesEnabled, setVisible, setWhatsThis, setWindowFlags, setWindowFlags, setWindowIcon, setWindowIconText, setWindowModality, setWindowModified, setWindowOpacity, setWindowRole, setWindowState, setWindowState, setWindowTitle, show, showFullScreen, showMaximized, showMinimized, showNormal, size, sizeIncrement, sizePolicy, stackUnder, statusTip, style, styleSheet, tabletEvent, testAttribute, toolTip, underMouse, unsetCursor, unsetLayoutDirection, unsetLocale, update, update, update, update, updateGeometry, updateMicroFocus, updatesEnabled, visibleRegion, whatsThis, width, widthMM, window, windowFlags, windowIcon, windowIconText, windowModality, windowOpacity, windowRole, windowState, windowTitle, windowType, winId, x, y
 
Methods inherited from class com.trolltech.qt.core.QObject
blockSignals, childEvent, children, connectSlotsByName, customEvent, disposeLater, dumpObjectInfo, dumpObjectTree, dynamicPropertyNames, eventFilter, findChild, findChild, findChild, findChildren, findChildren, findChildren, findChildren, installEventFilter, isWidgetType, killTimer, moveToThread, objectName, parent, property, removeEventFilter, setObjectName, setParent, setProperty, signalsBlocked, startTimer, thread
 
Methods inherited from class com.trolltech.qt.QtJambiObject
dispose, disposed, finalize, reassignNativeResources, tr, tr, tr
 
Methods inherited from class com.trolltech.qt.QSignalEmitter
disconnect, disconnect, signalSender
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.trolltech.qt.QtJambiInterface
disableGarbageCollection, nativeId, nativePointer, reenableGarbageCollection, setJavaOwnership
 

Field Detail

dateChanged

public final QSignalEmitter.Signal1<QDate> dateChanged

This signal is emitted whenever the date is changed. The new date is passed in date.

Compatible Slot Signatures:
void mySlot(com.trolltech.qt.core.QDate date)
void mySlot()


dateTimeChanged

public final QSignalEmitter.Signal1<QDateTime> dateTimeChanged

This signal is emitted whenever the date or time is changed. The new date and time is passed in date.

Compatible Slot Signatures:
void mySlot(com.trolltech.qt.core.QDateTime date)
void mySlot()


timeChanged

public final QSignalEmitter.Signal1<QTime> timeChanged

This signal is emitted whenever the time is changed. The new time is passed in date.

Compatible Slot Signatures:
void mySlot(com.trolltech.qt.core.QTime date)
void mySlot()

Constructor Detail

QDateTimeEdit

public QDateTimeEdit(QTime t)

Equivalent to QDateTimeEdit(t, 0).


QDateTimeEdit

public QDateTimeEdit(QTime t,
                     QWidget parent)

Constructs an empty date time editor with a parent. The value is set to t.


QDateTimeEdit

public QDateTimeEdit(QDateTime dt)

Equivalent to QDateTimeEdit(dt, 0).


QDateTimeEdit

public QDateTimeEdit(QDateTime dt,
                     QWidget parent)

Constructs an empty date time editor with a parent. The value is set to dt.


QDateTimeEdit

public QDateTimeEdit()

Equivalent to QDateTimeEdit(0).


QDateTimeEdit

public QDateTimeEdit(QWidget parent)

Constructs an empty date time editor with a parent.


QDateTimeEdit

public QDateTimeEdit(QDate d)

Equivalent to QDateTimeEdit(d, 0).


QDateTimeEdit

public QDateTimeEdit(QDate d,
                     QWidget parent)

Constructs an empty date time editor with a parent. The value is set to d.

Method Detail

calendarPopup

public final boolean calendarPopup()

Returns the current calender popup showing mode..

The calendar popup will be shown upon clicking the arrow button. This property is valid only if there is a valid date display format.

See Also:
setCalendarPopup, setDisplayFormat

clearMaximumDate

public final void clearMaximumDate()

Resets the maximum date of the date time edit.

When setting this property the minimumDate is adjusted if necessary to ensure that the range remains valid. If the date is not a valid QDate object, this function does nothing.

See Also:
minimumDate, minimumTime, maximumTime, setDateRange

clearMaximumTime

public final void clearMaximumTime()

Resets the maximum time of the date time edit.

When setting this property, the minimumTime is adjusted if necessary to ensure that the range remains valid. If the time is not a valid QTime object, this function does nothing.

See Also:
minimumTime, minimumDate, maximumDate, setTimeRange

clearMinimumDate

public final void clearMinimumDate()

Resets the minimum date of the date time edit.

When setting this property the maximumDate is adjusted if necessary, to ensure that the range remains valid. If the date is not a valid QDate object, this function does nothing.

See Also:
minimumTime, maximumTime, setDateRange

clearMinimumTime

public final void clearMinimumTime()

Resets the minimum time of the date time edit.

When setting this property the maximumTime is adjusted if necessary, to ensure that the range remains valid. If the time is not a valid QTime object, this function does nothing.

See Also:
maximumTime, minimumDate, maximumDate, setTimeRange

currentSection

public final QDateTimeEdit.Section currentSection()

Returns the current section of the spinbox setCurrentSection().

See Also:
setCurrentSection

currentSectionIndex

public final int currentSectionIndex()

Returns the current section index of the spinbox.

If the format is 'yyyy/MM/dd', the displayText is '2001/05/21' and the cursorPosition is 5 currentSectionIndex returns 1. If the cursorPosition is 3 currentSectionIndex is 0 etc.

setCurrentSection()

See Also:
setCurrentSectionIndex, currentSection

date

public final QDate date()

Returns the QDate that is set in the QDateTimeEdit.

See Also:
setDate, time

dateTime

public final QDateTime dateTime()

Returns the QDateTime that is set in the QDateTimeEdit.

See Also:
setDateTime, minimumDate, minimumTime, maximumDate, maximumTime

displayFormat

public final java.lang.String displayFormat()

Returns the format used to display the time/date of the date time edit.

This format is the same as the one used described in QDateTime::toString() and QDateTime::fromString()

Example format strings(assuming that the date is 2nd of July 1969):

FormatResult
dd.MM.yyyy02.07.1969
MMM d yyJul 2 69
MMMM d yyJuly 2 69

If you specify an invalid format the format will not be set.

See Also:
setDisplayFormat, QDateTime::toString, displayedSections

displayedSections

public final QDateTimeEdit.Sections displayedSections()

Returns the currently displayed fields of the date time edit.

Returns a bit set of the displayed sections for this format. setDisplayFormat(), displayFormat


maximumDate

public final QDate maximumDate()

Returns the maximum date of the date time edit.

When setting this property the minimumDate is adjusted if necessary to ensure that the range remains valid. If the date is not a valid QDate object, this function does nothing.

See Also:
setMaximumDate, minimumDate, minimumTime, maximumTime, setDateRange

maximumTime

public final QTime maximumTime()

Returns the maximum time of the date time edit.

When setting this property, the minimumTime is adjusted if necessary to ensure that the range remains valid. If the time is not a valid QTime object, this function does nothing.

See Also:
setMaximumTime, minimumTime, minimumDate, maximumDate, setTimeRange

minimumDate

public final QDate minimumDate()

Returns the minimum date of the date time edit.

When setting this property the maximumDate is adjusted if necessary, to ensure that the range remains valid. If the date is not a valid QDate object, this function does nothing.

See Also:
setMinimumDate, minimumTime, maximumTime, setDateRange

minimumTime

public final QTime minimumTime()

Returns the minimum time of the date time edit.

When setting this property the maximumTime is adjusted if necessary, to ensure that the range remains valid. If the time is not a valid QTime object, this function does nothing.

See Also:
setMinimumTime, maximumTime, minimumDate, maximumDate, setTimeRange

sectionAt

public final QDateTimeEdit.Section sectionAt(int index)

Returns the Section at index.

If the format is 'yyyy/MM/dd', sectionAt(0) returns YearSection, sectionAt(1) returns MonthSection, and sectionAt(2) returns YearSection,


sectionCount

public final int sectionCount()

Returns the number of sections displayed. If the format is 'yyyy/yy/yyyy', sectionCount returns 3.


sectionText

public final java.lang.String sectionText(QDateTimeEdit.Section section)

Returns the text from the given section.

### note about not working when not Acceptable

See Also:
currentSection

setCalendarPopup

public final void setCalendarPopup(boolean enable)

Sets the current calender popup showing mode. to enable.

The calendar popup will be shown upon clicking the arrow button. This property is valid only if there is a valid date display format.

See Also:
calendarPopup, setDisplayFormat

setCurrentSection

public final void setCurrentSection(QDateTimeEdit.Section section)

Sets the current section of the spinbox setCurrentSection() to section.

See Also:
currentSection

setCurrentSectionIndex

public final void setCurrentSectionIndex(int index)

Sets the current section index of the spinbox to index.

If the format is 'yyyy/MM/dd', the displayText is '2001/05/21' and the cursorPosition is 5 currentSectionIndex returns 1. If the cursorPosition is 3 currentSectionIndex is 0 etc.

setCurrentSection()

See Also:
currentSectionIndex, currentSection

setDate

public final void setDate(QDate date)

Sets the QDate that is set in the QDateTimeEdit to date.

See Also:
date, time

setDateRange

public final void setDateRange(QDate min,
                               QDate max)

Convenience function to set minimum and maximum date with one function call.

    setDateRange(min, max);

is analogous to:

    setMinimumDate(min);
    setMaximumDate(max);

If either min or max are not valid, this function does nothing.

See Also:
setMinimumDate, maximumDate, setMaximumDate, clearMinimumDate, setMinimumTime, maximumTime, setMaximumTime, clearMinimumTime, QDate::isValid

setDateTime

public final void setDateTime(QDateTime dateTime)

Sets the QDateTime that is set in the QDateTimeEdit to dateTime.

See Also:
dateTime, minimumDate, minimumTime, maximumDate, maximumTime

setDisplayFormat

public final void setDisplayFormat(java.lang.String format)

Sets the format used to display the time/date of the date time edit to format.

This format is the same as the one used described in QDateTime::toString() and QDateTime::fromString()

Example format strings(assuming that the date is 2nd of July 1969):

FormatResult
dd.MM.yyyy02.07.1969
MMM d yyJul 2 69
MMMM d yyJuly 2 69

If you specify an invalid format the format will not be set.

See Also:
displayFormat, QDateTime::toString, displayedSections

setMaximumDate

public final void setMaximumDate(QDate max)

Sets the maximum date of the date time edit to max.

When setting this property the minimumDate is adjusted if necessary to ensure that the range remains valid. If the date is not a valid QDate object, this function does nothing.

See Also:
maximumDate, minimumDate, minimumTime, maximumTime, setDateRange

setMaximumTime

public final void setMaximumTime(QTime max)

Sets the maximum time of the date time edit to max.

When setting this property, the minimumTime is adjusted if necessary to ensure that the range remains valid. If the time is not a valid QTime object, this function does nothing.

See Also:
maximumTime, minimumTime, minimumDate, maximumDate, setTimeRange

setMinimumDate

public final void setMinimumDate(QDate min)

Sets the minimum date of the date time edit to min.

When setting this property the maximumDate is adjusted if necessary, to ensure that the range remains valid. If the date is not a valid QDate object, this function does nothing.

See Also:
minimumDate, minimumTime, maximumTime, setDateRange

setMinimumTime

public final void setMinimumTime(QTime min)

Sets the minimum time of the date time edit to min.

When setting this property the maximumTime is adjusted if necessary, to ensure that the range remains valid. If the time is not a valid QTime object, this function does nothing.

See Also:
minimumTime, maximumTime, minimumDate, maximumDate, setTimeRange

setSelectedSection

public final void setSelectedSection(QDateTimeEdit.Section section)

Selects section. If section doesn't exist in the currently displayed sections this function does nothing. If section is NoSection this function will unselect all text in the editor. Otherwise this function will move the cursor and the current section to the selected section.

See Also:
currentSection

setTime

public final void setTime(QTime time)

Sets the QTime that is set in the QDateTimeEdit to time.

See Also:
time, date

setTimeRange

public final void setTimeRange(QTime min,
                               QTime max)

Convenience function to set minimum and maximum time with one function call.

    setTimeRange(min, max);

is analogous to:

    setMinimumTime(min);
    setMaximumTime(max);

If either min or max are not valid, this function does nothing.

See Also:
setMinimumDate, maximumDate, setMaximumDate, clearMinimumDate, setMinimumTime, maximumTime, setMaximumTime, clearMinimumTime, QTime::isValid

time

public final QTime time()

Returns the QTime that is set in the QDateTimeEdit.

See Also:
setTime, date

clear

public void clear()

This function is reimplemented for internal reasons.

Overrides:
clear in class QAbstractSpinBox

dateTimeFromText

protected QDateTime dateTimeFromText(java.lang.String text)

Returns an appropriate datetime for the given text.

This virtual function is used by the datetime edit whenever it needs to interpret text entered by the user as a value.

See Also:
textFromDateTime, validate

event

public boolean event(QEvent event)

This function is reimplemented for internal reasons.

Overrides:
event in class QAbstractSpinBox
See Also:
closeEvent, focusInEvent, focusOutEvent, enterEvent, keyPressEvent, keyReleaseEvent, leaveEvent, mouseDoubleClickEvent, mouseMoveEvent, mousePressEvent, mouseReleaseEvent, moveEvent, paintEvent, resizeEvent, QObject::event, QObject::timerEvent

fixup

public java.lang.String fixup(java.lang.String input)

This function is reimplemented for internal reasons.

Overrides:
fixup in class QAbstractSpinBox

focusInEvent

protected void focusInEvent(QFocusEvent event)

This function is reimplemented for internal reasons.

Overrides:
focusInEvent in class QAbstractSpinBox
See Also:
focusOutEvent, setFocusPolicy, keyPressEvent, keyReleaseEvent, event, QFocusEvent

focusNextPrevChild

protected boolean focusNextPrevChild(boolean next)

This function is reimplemented for internal reasons.

Overrides:
focusNextPrevChild in class QWidget
See Also:
focusNextChild, focusPreviousChild

keyPressEvent

protected void keyPressEvent(QKeyEvent event)

This function is reimplemented for internal reasons.

Overrides:
keyPressEvent in class QAbstractSpinBox
See Also:
keyReleaseEvent, QKeyEvent::ignore, setFocusPolicy, focusInEvent, focusOutEvent, event, QKeyEvent, Tetrix Example

mousePressEvent

protected void mousePressEvent(QMouseEvent event)

This function is reimplemented for internal reasons.

Overrides:
mousePressEvent in class QAbstractSpinBox
See Also:
mouseReleaseEvent, mouseDoubleClickEvent, mouseMoveEvent, event, QMouseEvent, Example

paintEvent

protected void paintEvent(QPaintEvent event)

This function is reimplemented for internal reasons.

Overrides:
paintEvent in class QAbstractSpinBox
See Also:
event, repaint, update, QPainter, QPixmap, QPaintEvent, Analog Clock Example

sizeHint

public QSize sizeHint()

This function is reimplemented for internal reasons.

Overrides:
sizeHint in class QAbstractSpinBox
See Also:
QSize::isValid, minimumSizeHint, sizePolicy, setMinimumSize, updateGeometry

stepBy

public void stepBy(int steps)

This function is reimplemented for internal reasons.

Overrides:
stepBy in class QAbstractSpinBox

stepEnabled

protected QAbstractSpinBox.StepEnabled stepEnabled()

This function is reimplemented for internal reasons.

Overrides:
stepEnabled in class QAbstractSpinBox
See Also:
QSpinBox::minimum, QSpinBox::maximum, wrapping

textFromDateTime

protected java.lang.String textFromDateTime(QDateTime dt)

This virtual function is used by the date time edit whenever it needs to display dt.

If you reimplement this, you may also need to reimplement valueFromText() and validate.

See Also:
dateTimeFromText, validate

validate

public QValidator.State validate(QValidator.QValidationData input)

Equivalent to validate(input, ).

Overrides:
validate in class QAbstractSpinBox

wheelEvent

protected void wheelEvent(QWheelEvent event)

This function is reimplemented for internal reasons.

Overrides:
wheelEvent in class QAbstractSpinBox
See Also:
QWheelEvent::ignore, QWheelEvent::accept, event, QWheelEvent

fromNativePointer

public static QDateTimeEdit fromNativePointer(QNativePointer nativePointer)
This function returns the QDateTimeEdit instance pointed to by nativePointer

Parameters:
nativePointer - the QNativePointer of which object should be returned.

Qt Jambi Home