42 #include <qplatformdefs.h> 43 #include <private/qabstractspinbox_p.h> 44 #include <private/qdatetime_p.h> 45 #include <private/qlineedit_p.h> 60 #ifndef QT_NO_ACCESSIBILITY 68 #if defined(Q_OS_SYMBIAN) 70 #include <private/qt_s60_p.h> 74 #ifdef QABSTRACTSPINBOX_QSBDEBUG 75 # define QASBDEBUG qDebug 77 # define QASBDEBUG if (false) qDebug 208 return d->buttonSymbols;
214 if (
d->buttonSymbols != buttonSymbols) {
216 d->updateEditFieldGeometry();
277 return d->specialValueText;
285 d->cachedSizeHint =
QSize();
346 d->readOnly = enable;
347 d->edit->setReadOnly(enable);
377 return d->keyboardTracking;
383 d->keyboardTracking = enable;
409 d->updateEditFieldGeometry();
428 d->accelerate = accelerate;
434 return d->accelerate;
477 return d->correctionMode;
495 return d->edit->hasAcceptableInput();
519 return (Qt::Alignment)
d->edit->alignment();
526 d->edit->setAlignment(flag);
538 if (!
d->specialValue()) {
539 const int tmp =
d->edit->displayText().size() -
d->suffix.size();
540 d->edit->setSelection(tmp, -(tmp -
d->prefix.size()));
542 d->edit->selectAll();
554 d->edit->setText(
d->prefix +
d->suffix);
555 d->edit->setCursorPosition(
d->prefix.size());
585 if (
d->variantCompare(
d->value,
d->maximum) < 0) {
588 if (
d->variantCompare(
d->value,
d->minimum) > 0) {
656 QString tmp =
d->edit->displayText();
657 int cursorPos =
d->edit->cursorPosition();
658 bool dontstep =
false;
660 if (
d->pendingEmit) {
668 d->setValue(
d->bound(
d->value + (
d->singleStep * steps), old, steps), e);
670 d->emitSignals(e, old);
709 if (!
d->edit->validator())
710 d->edit->setValidator(
d->validator);
712 if (
d->edit->parent() !=
this)
713 d->edit->setParent(
this);
715 d->edit->setFrame(
false);
716 d->edit->setFocusProxy(
this);
717 d->edit->setAcceptDrops(
false);
723 this,
SLOT(_q_editorCursorPositionChanged(
int,
int)));
725 d->updateEditFieldGeometry();
755 return d->edit->inputMethodQuery(query);
765 switch (event->
type()) {
768 d->cachedSizeHint =
d->cachedMinimumSizeHint =
QSize();
772 d->updateEditFieldGeometry();
777 if (
const QHoverEvent *he = static_cast<const QHoverEvent *>(event))
778 d->updateHoverControl(he->pos());
781 if (
d->edit->event(event))
784 #ifdef QT_KEYPAD_NAVIGATION 785 case QEvent::EnterEditFocus:
786 case QEvent::LeaveEditFocus:
787 if (QApplication::keypadNavigationEnabled()) {
788 const bool b =
d->edit->event(event);
789 d->edit->setSelection(
d->edit->displayText().size() -
d->suffix.size(),0);
790 if (event->
type() == QEvent::LeaveEditFocus)
798 return d->edit->event(event);
814 if (
d->ignoreUpdateEdit) {
815 d->ignoreUpdateEdit =
false;
829 switch (event->
type()) {
832 d->spinClickThresholdTimerInterval =
835 d->updateEditFieldGeometry();
864 d->updateEditFieldGeometry();
875 if (
d->cachedSizeHint.isEmpty()) {
879 int h =
d->edit->sizeHint().height();
882 s =
d->prefix +
d->textFromValue(
d->minimum) +
d->suffix +
QLatin1Char(
' ');
885 s =
d->prefix +
d->textFromValue(
d->maximum) +
d->suffix +
QLatin1Char(
' ');
888 if (
d->specialValueText.size()) {
889 s =
d->specialValueText;
911 return d->cachedSizeHint;
921 if (
d->cachedMinimumSizeHint.isEmpty()) {
925 int h =
d->edit->minimumSizeHint().height();
947 return d->cachedMinimumSizeHint;
991 if (!event->
text().
isEmpty() &&
d->edit->cursorPosition() <
d->prefix.size())
992 d->edit->setCursorPosition(
d->prefix.size());
995 bool isPgUpOrDown =
false;
996 switch (event->
key()) {
1000 isPgUpOrDown =
true;
1003 #ifdef QT_KEYPAD_NAVIGATION 1004 if (QApplication::keypadNavigationEnabled()) {
1006 if (!hasEditFocus() && (
event->key() ==
Qt::Key_Up 1022 if (
d->spinClickTimerId == -1)
1025 if(
d->spinClickThresholdTimerId == -1 &&
d->spinClickTimerId == -1) {
1026 d->updateState(up,
true);
1029 #ifndef QT_NO_ACCESSIBILITY 1034 #ifdef QT_KEYPAD_NAVIGATION 1037 if (QApplication::keypadNavigationEnabled() && !hasEditFocus()) {
1043 if (QApplication::keypadNavigationEnabled() && !hasEditFocus()) {
1051 d->edit->d_func()->control->clearUndo();
1058 #ifdef QT_KEYPAD_NAVIGATION 1060 if (QApplication::keypadNavigationEnabled()) {
1062 setEditFocus(!hasEditFocus());
1067 #ifdef Q_WS_X11 // only X11 1081 int currentPos =
d->edit->cursorPosition();
1084 if ((currentPos == 0 && !
d->prefix.isEmpty()) || text.
size() -
d->suffix.size() <= currentPos) {
1087 d->edit->setSelection(currentPos, text.
size() -
d->suffix.size() - currentPos);
1090 if ((currentPos == text.
size() && !
d->suffix.isEmpty()) || currentPos <= d->prefix.size()) {
1093 d->edit->setSelection(currentPos,
d->prefix.size() - currentPos);
1102 #ifndef QT_NO_SHORTCUT 1112 d->edit->event(event);
1114 d->ignoreUpdateEdit =
true;
1128 d->edit->event(event);
1136 #ifndef QT_NO_WHEELEVENT 1139 const int steps = (
event->delta() > 0 ? 1 : -1);
1154 d->edit->event(event);
1173 d->edit->event(event);
1177 #ifdef QT_KEYPAD_NAVIGATION 1179 if (!QApplication::keypadNavigationEnabled())
1229 #if defined(Q_OS_SYMBIAN) 1230 TTimeIntervalMicroSeconds32 initialTime;
1231 TTimeIntervalMicroSeconds32 time;
1232 S60->wsSession().GetKeyboardRepeatRate(initialTime, time);
1233 ret = time.Int() / 1000;
1234 #elif defined(Q_OS_WIN) && !defined(Q_OS_WINCE) 1236 if (SystemParametersInfo(SPI_GETKEYBOARDSPEED, 0, &time, 0) !=
FALSE)
1237 ret =
static_cast<int>(1000 /
static_cast<int>(time));
1250 bool doStep =
false;
1251 if (event->
timerId() ==
d->spinClickThresholdTimerId) {
1253 d->spinClickThresholdTimerId = -1;
1254 d->effectiveSpinRepeatRate =
d->buttonState &
Keyboard 1256 :
d->spinClickTimerInterval;
1257 d->spinClickTimerId =
startTimer(
d->effectiveSpinRepeatRate);
1259 }
else if (event->
timerId() ==
d->spinClickTimerId) {
1260 if (
d->accelerate) {
1261 d->acceleration =
d->acceleration + (int)(
d->effectiveSpinRepeatRate * 0.05);
1262 if (
d->effectiveSpinRepeatRate -
d->acceleration >= 10) {
1264 d->spinClickTimerId =
startTimer(
d->effectiveSpinRepeatRate -
d->acceleration);
1272 if (
d->buttonState &
Up) {
1278 }
else if (
d->buttonState &
Down) {
1297 #ifdef QT_NO_CONTEXTMENU 1324 delete static_cast<QMenu *
>(menu);
1325 if (that && action) {
1328 }
else if (action == down) {
1330 }
else if (action == selAll) {
1335 #endif // QT_NO_CONTEXTMENU 1346 d->updateHoverControl(event->
pos());
1349 if (
d->spinClickTimerId != -1 &&
d->buttonSymbols !=
NoButtons) {
1352 d->updateState(
true);
1354 d->updateState(
false);
1373 d->updateHoverControl(event->
pos());
1378 d->updateState(
true);
1380 d->updateState(
false);
1393 if ((
d->buttonState &
Mouse) != 0)
1407 spinClickTimerInterval(100), spinClickThresholdTimerId(-1), spinClickThresholdTimerInterval(-1),
1408 effectiveSpinRepeatRate(1), buttonState(
None), cachedText(
QLatin1String(
"\x01")),
1439 q->update(lastHoverRect);
1459 q->initStyleOption(&opt);
1479 int size = text.
size();
1480 bool changed =
false;
1491 text = text.
mid(from, size);
1494 const int s = text.
size();
1497 (*pos) -= (s - text.
size());
1506 q->initStyleOption(&opt);
1581 bool allowSelection =
true;
1585 allowSelection =
false;
1594 allowSelection =
false;
1602 * (newpos < pos ? -1 : 1)) - newpos + pos
1636 q->initStyleOption(&opt);
1691 q->stepBy(up ? 1 : -1);
1692 #ifndef QT_NO_ACCESSIBILITY 1718 if (
d->buttonState &
Up) {
1720 }
else if (
d->buttonState &
Down) {
1725 if (
d->buttonState) {
1735 option->
frame =
d->frame;
1762 const bool wasMin = old ==
minimum;
1763 const bool wasMax = old ==
maximum;
1767 const bool wrapped = (oldcmp > 0 && steps < 0) || (oldcmp < 0 && steps > 0);
1769 v = ((wasMax && !wrapped && steps > 0) || (steps < 0 && !wasMin && wrapped))
1771 }
else if (wrapped && (maxcmp > 0 || mincmp < 0)) {
1772 v = ((wasMax && steps > 0) || (!wasMin && steps < 0)) ?
minimum :
maximum;
1773 }
else if (mincmp < 0) {
1871 q->updateGeometry();
1948 bool doInterpret =
true;
1951 const int oldpos = pos;
1956 QASBDEBUG() <<
"QAbstractSpinBoxPrivate::interpret() text '" 1958 <<
"' >> '" << copy <<
'\'' 1959 <<
"' >> '" << tmp <<
'\'';
2049 qWarning(
"QAbstractSpinBox: Internal error: Different types (%s vs %s) (%s:%d)",
2051 switch (arg1.
type()) {
2078 qWarning(
"QAbstractSpinBox: Internal error: Different types (%s vs %s) (%s:%d)",
2080 switch (arg1.
type()) {
2086 int days = a2.
daysTo(a1);
2087 int secs = a2.
secsTo(a1);
2089 if (days < 0 || secs < 0 || msecs < 0) {
2115 switch (arg1.
type()) {
2120 int daysInt = (int)days;
2123 + (days * (24 * 3600 * 1000)));
2127 default: ret = arg1;
break;
2140 switch (arg1.
type()) {
2142 a1 = (double)arg1.
toInt();
2143 a2 = (double)arg2.
toInt();
2157 return (a1 != 0 && a2 != 0) ? (a1 / a2) : 0.0;
2162 switch (arg2.
type()) {
2215 Q_ASSERT_X(0,
"QAbstractSpinBoxPrivate::variantCompare",
2227 Q_ASSERT(variantCompare(min, max) <= 0);
2228 if (variantCompare(min, value) < 0) {
2229 const int compMax = variantCompare(value, max);
2230 return (compMax < 0 ? value : max);
2239 #include "moc_qabstractspinbox.cpp" 2241 #endif // QT_NO_SPINBOX The QVariant class acts like a union for the most common Qt data types.
QDateTime addSecs(int secs) const
Returns a QDateTime object containing a datetime s seconds later than the datetime of this object (or...
int startTimer(int interval)
Starts a timer and returns a timer identifier, or returns zero if it could not start a timer...
QSize minimumSizeHint() const
Reimplemented Function
int daysTo(const QDateTime &) const
Returns the number of days from this datetime to the other datetime.
uint ignoreCursorPositionChanged
void focusInEvent(QFocusEvent *event)
Reimplemented Function
ButtonSymbols buttonSymbols() const
static void updateAccessibility(QObject *, int who, Event reason)
Notifies accessibility clients about a change in object's accessibility information.
bool isAccelerated() const
int width(const QString &, int len=-1) const
Returns the width in pixels of the first len characters of text.
virtual StepEnabled stepEnabled() const
Virtual function that determines whether stepping up and down is legal at any given time...
int selectionStart() const
selectionStart() returns the index of the first selected character in the line edit or -1 if no text ...
bool blockSignals(bool b)
If block is true, signals emitted by this object are blocked (i.e., emitting a signal will not invoke...
The QKeyEvent class describes a key event.
virtual QString textFromValue(const QVariant &n) const
Virtual method called that calls the public textFromValue() functions in the subclasses.
void hideEvent(QHideEvent *event)
Reimplemented Function
void mouseReleaseEvent(QMouseEvent *event)
Reimplemented Function
virtual QStyle::SubControl newHoverControl(const QPoint &pos)
Returns the hover control at pos.
SubControl
This enum describes the available sub controls.
virtual void fixup(QString &input) const
This virtual function is called by the QAbstractSpinBox if the input is not validated to QValidator::...
The QFontMetrics class provides font metrics information.
#define QT_END_NAMESPACE
This macro expands to.
static QString fromAscii(const char *, int size=-1)
Returns a QString initialized with the first size characters from the string str. ...
void initStyleOption(QStyleOptionSpinBox *option) const
Initialize option with the values from this QSpinBox.
bool isNull() const
Returns true if this is a NULL variant, false otherwise.
QSpinBoxValidator(QAbstractSpinBox *qptr, QAbstractSpinBoxPrivate *dptr)
QStyle::State state
the style flags that are used when drawing the control
bool updateHoverControl(const QPoint &pos)
Updates the old and new hover control.
void init()
Initialises the QAbstractSpinBoxPrivate object.
The QWheelEvent class contains parameters that describe a wheel event.
virtual void stepBy(int steps)
Virtual function that is called whenever the user triggers a step.
virtual QRect subControlRect(ComplexControl cc, const QStyleOptionComplex *opt, SubControl sc, const QWidget *widget=0) const =0
Returns the rectangle containing the specified subControl of the given complex control (with the styl...
static int getKeyboardAutoRepeatRate()
Used when acceleration is turned on.
static QSize globalStrut()
static int variantCompare(const QVariant &arg1, const QVariant &arg2)
QVariant operator-(const QVariant &arg1, const QVariant &arg2)
Subtracts two variants and returns the result.
The QHoverEvent class contains parameters that describe a mouse event.
int length() const
Returns the number of characters in this string.
QString & prepend(QChar c)
virtual void timerEvent(QTimerEvent *)
This event handler can be reimplemented in a subclass to receive timer events for the object...
virtual QVariant valueFromText(const QString &input) const
Virtual method called that calls the public valueFromText() functions in the subclasses.
QValidator::State validate(QString &input, int &) const
Checks for specialValueText, prefix, suffix and calls the virtual QAbstractSpinBox::validate function...
QAbstractSpinBox(QWidget *parent=0)
Constructs an abstract spinbox with the given parent with default wrapping , and alignment properties...
virtual int styleHint(StyleHint stylehint, const QStyleOption *opt=0, const QWidget *widget=0, QStyleHintReturn *returnData=0) const =0
Returns an integer representing the specified style hint for the given widget described by the provid...
QDateTime toDateTime() const
Returns the variant as a QDateTime if the variant has type() DateTime , Date , or String ; otherwise ...
void interpretText()
This function interprets the text of the spin box.
QSize expandedTo(const QSize &) const
Returns a size holding the maximum width and height of this size and the given otherSize.
void keyPressEvent(QKeyEvent *event)
This function handles keyboard input.
bool startsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string starts with s; otherwise returns false.
bool readOnly
whether the spin box is read only.
static QString tr(const char *sourceText, const char *comment=0, int n=-1)
void wheelEvent(QWheelEvent *event)
Reimplemented Function
The QDate class provides date functions.
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
void setLineEdit(QLineEdit *edit)
Sets the line edit of the spinbox to be lineEdit instead of the current line edit widget...
int msec() const
Returns the millisecond part (0 to 999) of the time.
QAbstractSpinBox::StepEnabled stepEnabled
which buttons of the spin box that are enabled
void mouseMoveEvent(QMouseEvent *event)
Reimplemented Function
virtual void updateEditFieldGeometry()
void setSpecialValueText(const QString &txt)
QStyle::SubControls activeSubControls
This variable holds a bitwise OR of the sub-controls that are active for the complex control...
int spinClickThresholdTimerId
The QString class provides a Unicode character string.
QString specialValueText() const
#define QDATETIMEEDIT_TIME_MIN
void mousePressEvent(QMouseEvent *event)
Reimplemented Function
ButtonSymbols
This enum type describes the symbols that can be displayed on the buttons in a spin box...
bool frame
whether the spin box has a frame
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
const QPoint & pos() const
Returns the position of the mouse cursor, relative to the widget that received the event...
void setObjectName(const QString &name)
static QVariant variantBound(const QVariant &min, const QVariant &value, const QVariant &max)
int toInt(bool *ok=0) const
Returns the variant as an int if the variant has type() Int , Bool , ByteArray , Char ...
void stepUp()
Steps up by one linestep Calling this slot is analogous to calling stepBy(1);.
void reset()
Resets the state of the spinbox.
Qt::KeyboardModifiers modifiers() const
Returns the keyboard modifier flags that existed immediately after the event occurred.
int key() const
Returns the code of the key that was pressed or released.
void changeEvent(QEvent *event)
Reimplemented Function
void setAccelerated(bool on)
void keyReleaseEvent(QKeyEvent *event)
Reimplemented Function
The QTime class provides clock time functions.
#define QT_BEGIN_NAMESPACE
This macro expands to.
The QValidator class provides validation of input text.
CorrectionMode
This enum type describes the mode the spinbox will use to correct an QValidator::Intermediate value i...
virtual void interpret(EmitPolicy ep)
Interprets text and emits signals.
void truncate(int pos)
Truncates the string at the given position index.
bool frame
whether the spin box draws itself with a frame
QStyle::SubControl hoverControl
QValidator::State cachedState
Qt::Alignment alignment() const
QString trimmed() const Q_REQUIRED_RESULT
Returns a string that has whitespace removed from the start and the end.
int size() const
Returns the number of characters in this string.
static bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
Creates a connection of the given type from the signal in the sender object to the method in the rece...
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
void _q_editorTextChanged(const QString &)
Slot connected to the line edit's textChanged(const QString &) signal.
void setTime(const QTime &time)
Sets the time part of this datetime to time.
void stepDown()
Steps down by one linestep Calling this slot is analogous to calling stepBy(-1);. ...
QString text
the line edit's text
void initFrom(const QWidget *w)
The QStyleOptionSpinBox class is used to describe the parameters necessary for drawing a spin box...
QSize size() const
Returns the size of the rectangle.
void setSelection(int, int)
Selects text from position start and for length characters.
The QHideEvent class provides an event which is sent after a widget is hidden.
int spinClickThresholdTimerInterval
int secsTo(const QDateTime &) const
Returns the number of seconds from this datetime to the other datetime.
void setValidator(const QValidator *)
Sets this line edit to only accept input that the validator, v, will accept.
void selectAll()
Selects all the text in the spinbox except the prefix and suffix.
The QResizeEvent class contains event parameters for resize events.
Q_CORE_EXPORT void qWarning(const char *,...)
~QAbstractSpinBox()
Called when the QAbstractSpinBox is destroyed.
void setSize(const QSize &s)
Sets the size of the rectangle to the given size.
int timerId() const
Returns the unique timer identifier, which is the same identifier as returned from QObject::startTime...
void editingFinished()
This signal is emitted editing is finished.
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal...
void updateState(bool up, bool fromKeyboard=false)
Updates the state of the spinbox.
double operator/(const QVariant &arg1, const QVariant &arg2)
#define FALSE
Synonym for false.
void fixup(QString &) const
Calls the virtual QAbstractSpinBox::fixup function.
void resizeEvent(QResizeEvent *event)
Reimplemented Function
The QAbstractSpinBox class provides a spinbox and a line edit to display values.
void focusOutEvent(QFocusEvent *event)
Reimplemented Function
The QShowEvent class provides an event that is sent when a widget is shown.
QString stripped(const QString &text, int *pos=0) const
Strips any prefix/suffix from text.
virtual void setRange(const QVariant &min, const QVariant &max)
Convenience function to set min/max values.
const char * typeName() const
Returns the name of the type stored in the variant.
Qt::MouseButton button() const
Returns the button that caused the event.
QLineEdit * lineEdit() const
This function returns a pointer to the line edit of the spin box.
QAbstractSpinBoxPrivate()
QVariant operator*(const QVariant &arg1, double multiplier)
Multiplies arg1 by multiplier and returns the result.
QSpinBoxValidator * validator
bool hasAcceptableInput() const
The QMouseEvent class contains parameters that describe a mouse event.
void setButtonSymbols(ButtonSymbols bs)
virtual void updateEdit()
Updates the line edit to reflect the current value of the spin box.
virtual QSize sizeFromContents(ContentsType ct, const QStyleOption *opt, const QSize &contentsSize, const QWidget *w=0) const =0
Returns the size of the element described by the specified option and type, based on the provided con...
virtual QValidator::State validate(QString &input, int &pos) const
This virtual function is called by the QAbstractSpinBox to determine whether input is valid...
void setText(const QString &)
virtual void emitSignals(EmitPolicy ep, const QVariant &old)
#define QDATETIMEEDIT_DATE_MIN
QDate date() const
Returns the date part of the datetime.
QString mid(int position, int n=-1) const Q_REQUIRED_RESULT
Returns a string that contains n characters of this string, starting at the specified position index...
QAbstractSpinBox::ButtonSymbols buttonSymbols
the type of button symbols to draw for the spin box
QDate toDate() const
Returns the variant as a QDate if the variant has type() Date , DateTime , or String ; otherwise retu...
QString selectedText
the selected text
QSize sizeHint() const
Reimplemented Function
void clear()
Convert this variant to type Invalid and free up any resources used.
#define Q_ASSERT_X(cond, where, what)
QDateTime addDays(int days) const
Returns a QDateTime object containing a datetime ndays days later than the datetime of this object (o...
QString & append(QChar c)
The QDateTime class provides date and time functions.
virtual QVariant bound(const QVariant &val, const QVariant &old=QVariant(), int steps=0) const
Bounds val to be within minimum and maximum.
bool hasSelectedText
whether there is any text selected
The QTimerEvent class contains parameters that describe a timer event.
virtual void _q_editorCursorPositionChanged(int oldpos, int newpos)
Virtual slot connected to the line edit's cursorPositionChanged(int, int) signal. ...
QString text() const
Returns the Unicode text that this key generated.
void clear()
Clears the contents of the string and makes it empty.
int spinClickTimerInterval
Type type() const
Returns the storage type of the value stored in the variant.
QAbstractSpinBox::CorrectionMode correctionMode
QObject * parent() const
Returns a pointer to the parent object.
virtual void clearCache() const
#define st(var, type, card)
The QPoint class defines a point in the plane using integer precision.
Q_DECL_CONSTEXPR const T & qBound(const T &min, const T &val, const T &max)
void setCorrectionMode(CorrectionMode cm)
void contextMenuEvent(QContextMenuEvent *event)
Reimplemented Function
The QStyle class is an abstract base class that encapsulates the look and feel of a GUI...
State
This enum type defines the states in which a validated string can exist.
The QRect class defines a rectangle in the plane using integer precision.
bool isAutoRepeat() const
Returns true if this event comes from an auto-repeating key; returns false if it comes from an initia...
void setValue(const QVariant &val, EmitPolicy ep, bool updateEdit=true)
Sets the value of the spin box to val.
void showEvent(QShowEvent *event)
Reimplemented Function
double toDouble(bool *ok=0) const
Returns the variant as a double if the variant has type() Double , QMetaType::Float ...
The QLineEdit widget is a one-line text editor.
QVariant inputMethodQuery(Qt::InputMethodQuery) const
Reimplemented Function
QTime addMSecs(int ms) const
Returns a QTime object containing a time ms milliseconds later than the time of this object (or earli...
The QStylePainter class is a convenience class for drawing QStyle elements inside a widget...
void paintEvent(QPaintEvent *event)
Reimplemented Function
The QSize class defines the size of a two-dimensional object using integer point precision.
QTime time() const
Returns the time part of the datetime.
QVariant operator+(const QVariant &arg1, const QVariant &arg2)
Adds two variants together and returns the result.
virtual QVariant getZeroVariant() const
Convenience function to get a variant of the right type.
QTime toTime() const
Returns the variant as a QTime if the variant has type() Time , DateTime , or String ; otherwise retu...
int x() const
Returns the x coordinate of this point.
bool event(QEvent *event)
Reimplemented Function
void setCursorPosition(int)
void drawComplexControl(QStyle::ComplexControl cc, const QStyleOptionComplex &opt)
Use the widget's style to draw a complex control cc specified by the QStyleOptionComplex option...
void setKeyboardTracking(bool kt)
virtual void clear()
Clears the lineedit of all text but prefix and suffix.
void timerEvent(QTimerEvent *event)
Reimplemented Function
bool endsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string ends with s; otherwise returns false.
The QPaintEvent class contains event parameters for paint events.
~QAbstractSpinBoxPrivate()
#define QDATETIMEEDIT_DATETIME_MIN
void closeEvent(QCloseEvent *event)
Reimplemented Function
bool keyboardTracking() const
The QEvent class is the base class of all event classes.
#define qPrintable(string)
Type type() const
Returns the event type.
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
bool specialValue() const
Returns true if a specialValueText has been set and the current value is minimum. ...
QRect rect
the area that should be used for various calculations and painting
The QCloseEvent class contains parameters that describe a close event.
QString displayText
the displayed text
QStyle::SubControls subControls
This variable holds a bitwise OR of the sub-controls to be drawn for the complex control.
The QFocusEvent class contains event parameters for widget focus events.
CorrectionMode correctionMode() const
int cursorPosition
the current cursor position for this line edit
The QAction class provides an abstract user interface action that can be inserted into widgets...
void setAlignment(Qt::Alignment flag)
QAbstractSpinBoxPrivate * dptr
void killTimer(int id)
Kills the timer with timer identifier, id.