4#include <qplatformdefs.h>
5#include <private/qabstractspinbox_p.h>
6#include <private/qapplication_p.h>
7#if QT_CONFIG(datetimeparser)
8#include <private/qdatetimeparser_p.h>
10#include <private/qlineedit_p.h>
25#if QT_CONFIG(accessibility)
29#include <QtCore/qpointer.h>
32#ifdef QABSTRACTSPINBOX_QSBDEBUG
33# define QASBDEBUG qDebug
35# define QASBDEBUG if (false) qDebug
174 return d->buttonSymbols;
182 d->updateEditFieldGeometry();
238 return d->specialValueText;
246 d->cachedSizeHint =
QSize();
331 return d->keyboardTracking;
360 d->updateEditFieldGeometry();
376 d->accelerate = accelerate;
382 return d->accelerate;
396 return d->showGroupSeparator;
402 if (
d->showGroupSeparator == shown)
404 d->showGroupSeparator = shown;
443 return d->correctionMode;
458 return d->edit->hasAcceptableInput();
479 return (Qt::Alignment)
d->edit->alignment();
486 d->edit->setAlignment(flag);
498 if (!
d->specialValue()) {
499 const int tmp =
d->edit->displayText().size() -
d->suffix.size();
500 d->edit->setSelection(tmp, -(tmp -
d->prefix.size()));
502 d->edit->selectAll();
514 d->edit->setText(
d->prefix +
d->suffix);
515 d->edit->setCursorPosition(
d->prefix.size());
617 QString tmp =
d->edit->displayText();
618 int cursorPos =
d->edit->cursorPosition();
619 bool dontstep =
false;
621 if (
d->pendingEmit) {
630 switch (
d->stepType) {
632 singleStep =
d->calculateAdaptiveDecimalStep(steps);
635 singleStep =
d->singleStep;
637 d->
setValue(
d->bound(
d->value + (singleStep * steps), old, steps), e);
639 d->emitSignals(e, old);
683 setProperty(
"_q_spinbox_lineedit", QVariant::fromValue<QWidget *>(
d->edit));
684 if (!
d->edit->validator())
685 d->edit->setValidator(
d->validator);
687 if (
d->edit->parent() !=
this)
688 d->edit->setParent(
this);
691 d->edit->setFocusProxy(
this);
692 d->edit->setAcceptDrops(
false);
700 this, [
this]() { updateMicroFocus(); });
702 this, [
this]() { updateMicroFocus(); });
704 d->updateEditFieldGeometry();
706 d->edit->d_func()->control->setAccessibleObject(
this);
739 return QVariant(hints | lineEditValue.toInt());
744 return lineEditValue;
754 switch (
event->type()) {
757 d->cachedSizeHint =
d->cachedMinimumSizeHint =
QSize();
761 d->updateEditFieldGeometry();
769 if (
d->edit->event(
event))
772#ifdef QT_KEYPAD_NAVIGATION
773 case QEvent::EnterEditFocus:
774 case QEvent::LeaveEditFocus:
775 if (QApplicationPrivate::keypadNavigationEnabled()) {
776 const bool b =
d->edit->event(
event);
777 d->edit->setSelection(
d->edit->displayText().size() -
d->suffix.size(),0);
778 if (
event->type() == QEvent::LeaveEditFocus)
786 return d->edit->event(
event);
802 if (
d->ignoreUpdateEdit) {
803 d->ignoreUpdateEdit =
false;
817 switch (
event->type()) {
820 d->spinClickThresholdTimerInterval =
826 d->updateEditFieldGeometry();
858 d->updateEditFieldGeometry();
869 if (
d->cachedSizeHint.isEmpty()) {
873 int h =
d->edit->sizeHint().height();
876 QString fixedContent =
d->prefix +
d->suffix + u
' ';
877 s =
d->textFromValue(
d->minimum);
880 w =
qMax(
w, fm.horizontalAdvance(
s));
881 s =
d->textFromValue(
d->maximum);
884 w =
qMax(
w, fm.horizontalAdvance(
s));
886 if (
d->specialValueText.size()) {
887 s =
d->specialValueText;
888 w =
qMax(
w, fm.horizontalAdvance(
s));
892 QStyleOptionSpinBox
opt;
897 return d->cachedSizeHint;
907 if (
d->cachedMinimumSizeHint.isEmpty()) {
912 int h =
d->edit->minimumSizeHint().height();
916 QString fixedContent =
d->prefix + u
' ';
917 s =
d->textFromValue(
d->minimum);
920 w =
qMax(
w, fm.horizontalAdvance(
s));
921 s =
d->textFromValue(
d->maximum);
924 w =
qMax(
w, fm.horizontalAdvance(
s));
926 if (
d->specialValueText.size()) {
927 s =
d->specialValueText;
928 w =
qMax(
w, fm.horizontalAdvance(
s));
932 QStyleOptionSpinBox
opt;
938 return d->cachedMinimumSizeHint;
947 QStyleOptionSpinBox
opt;
981 d->keyboardModifiers =
event->modifiers();
983 if (!
event->text().isEmpty() &&
d->edit->cursorPosition() <
d->prefix.size())
984 d->edit->setCursorPosition(
d->prefix.size());
987 bool isPgUpOrDown =
false;
988 switch (
event->key()) {
996#ifdef QT_KEYPAD_NAVIGATION
997 if (QApplicationPrivate::keypadNavigationEnabled()) {
1010 if (!isPgUpOrDown && (
event->modifiers() &
d->stepModifier))
1017 if (
d->spinClickTimerId == -1)
1019 if (
event->isAutoRepeat() && !isPgUpOrDown) {
1020 if (
d->spinClickThresholdTimerId == -1 &&
d->spinClickTimerId == -1) {
1021 d->updateState(up,
true);
1024#if QT_CONFIG(accessibility)
1025 QAccessibleValueChangeEvent
event(
this,
d->value);
1026 QAccessible::updateAccessibility(&
event);
1030#ifdef QT_KEYPAD_NAVIGATION
1033 if (QApplicationPrivate::keypadNavigationEnabled() && !hasEditFocus()) {
1039 if (QApplicationPrivate::keypadNavigationEnabled() && !hasEditFocus()) {
1047 d->edit->d_func()->control->clearUndo();
1052 emit d->edit->returnPressed();
1055#ifdef QT_KEYPAD_NAVIGATION
1057 if (QApplicationPrivate::keypadNavigationEnabled()) {
1059 setEditFocus(!hasEditFocus());
1077 int currentPos =
d->edit->cursorPosition();
1080 if ((currentPos == 0 && !
d->prefix.isEmpty()) ||
text.
size() -
d->suffix.size() <= currentPos) {
1083 d->edit->setSelection(currentPos,
text.
size() -
d->suffix.size() - currentPos);
1086 if ((currentPos ==
text.
size() && !
d->suffix.isEmpty()) || currentPos <= d->prefix.size()) {
1089 d->edit->setSelection(currentPos,
d->prefix.size() - currentPos);
1098#ifndef QT_NO_SHORTCUT
1109 if (!
d->edit->text().isEmpty())
1112 d->ignoreUpdateEdit =
true;
1123 d->keyboardModifiers =
event->modifiers();
1135#if QT_CONFIG(wheelevent)
1136void QAbstractSpinBox::wheelEvent(QWheelEvent *
event)
1146 d->wheelDeltaRemainder +=
event->angleDelta().x();
1148 d->wheelDeltaRemainder +=
event->angleDelta().y();
1151 d->wheelDeltaRemainder +=
event->angleDelta().y();
1153 const int steps =
d->wheelDeltaRemainder / 120;
1154 d->wheelDeltaRemainder -= steps * 120;
1192#ifdef QT_KEYPAD_NAVIGATION
1194 if (!QApplicationPrivate::keypadNavigationEnabled())
1235 bool doStep =
false;
1236 if (
event->timerId() ==
d->spinClickThresholdTimerId) {
1238 d->spinClickThresholdTimerId = -1;
1239 d->effectiveSpinRepeatRate =
d->buttonState &
Keyboard
1241 :
d->spinClickTimerInterval;
1242 d->spinClickTimerId =
startTimer(
d->effectiveSpinRepeatRate);
1244 }
else if (
event->timerId() ==
d->spinClickTimerId) {
1245 if (
d->accelerate) {
1246 d->acceleration =
d->acceleration + (int)(
d->effectiveSpinRepeatRate * 0.05);
1247 if (
d->effectiveSpinRepeatRate -
d->acceleration >= 10) {
1249 d->spinClickTimerId =
startTimer(
d->effectiveSpinRepeatRate -
d->acceleration);
1256 const bool increaseStepRate =
d->keyboardModifiers &
d->stepModifier;
1258 if (
d->buttonState &
Up) {
1262 stepBy(increaseStepRate ? 10 : 1);
1264 }
else if (
d->buttonState &
Down) {
1268 stepBy(increaseStepRate ? -10 : -1);
1281#if QT_CONFIG(contextmenu)
1286 QPointer<QMenu>
menu =
d->edit->createStandardContextMenu();
1293#if QT_CONFIG(shortcut)
1307 const QPointer<QAbstractSpinBox> that =
this;
1312 if (that && action) {
1315 }
else if (action == down) {
1317 }
else if (action == selAll) {
1333 d->keyboardModifiers =
event->modifiers();
1334 d->updateHoverControl(
event->position().toPoint());
1337 if (
d->spinClickTimerId != -1 &&
d->buttonSymbols !=
NoButtons) {
1340 d->updateState(
true);
1342 d->updateState(
false);
1357 d->keyboardModifiers =
event->modifiers();
1362 d->updateHoverControl(
event->position().toPoint());
1367 d->updateState(
true);
1369 d->updateState(
false);
1382 d->keyboardModifiers =
event->modifiers();
1383 if ((
d->buttonState &
Mouse) != 0)
1397 ignoreCursorPositionChanged(
false),
frame(true), accelerate(
false), keyboardTracking(true),
1422 q->update(lastHoverRect);
1438 QStyleOptionSpinBox
opt;
1439 q->initStyleOption(&
opt);
1457 bool changed =
false;
1475 return text.toString();
1482 QStyleOptionSpinBox
opt;
1483 q->initStyleOption(&
opt);
1549 bool allowSelection =
true;
1553 allowSelection =
false;
1562 allowSelection =
false;
1570 * (newpos <
pos ? -1 : 1)) - newpos +
pos
1599 QStyleOptionSpinBox
opt;
1602 q->initStyleOption(&
opt);
1650 int steps = up ? 1 : -1;
1655#if QT_CONFIG(accessibility)
1657 QAccessible::updateAccessibility(&
event);
1678 option->buttonSymbols =
d->buttonSymbols;
1684 if (
d->buttonState &
Up) {
1686 }
else if (
d->buttonState &
Down) {
1691 if (
d->buttonState) {
1694 option->activeSubControls =
d->hoverControl;
1723 const bool wasMin = old ==
minimum;
1724 const bool wasMax = old ==
maximum;
1728 const bool wrapped = (oldcmp > 0 && steps < 0) || (oldcmp < 0 && steps > 0);
1730 v = ((wasMax && !wrapped && steps > 0) || (steps < 0 && !wasMin && wrapped))
1732 }
else if (wrapped && (maxcmp > 0 || mincmp < 0)) {
1733 v = ((wasMax && steps > 0) || (!wasMin && steps < 0)) ?
minimum :
maximum;
1734 }
else if (mincmp < 0) {
1823 q->updateGeometry();
1837 case QMetaType::Double:
ret =
QVariant(0.0);
break;
1888 bool doInterpret =
true;
1891 const int oldpos =
pos;
1896 QASBDEBUG() <<
"QAbstractSpinBoxPrivate::interpret() text '"
1898 <<
"' >> '" <<
copy <<
'\''
1899 <<
"' >> '" << tmp <<
'\'';
1985 qWarning(
"QAbstractSpinBox: Internal error: Different types (%s vs %s) (%s:%d)",
1986 arg1.typeName(),
arg2.typeName(), __FILE__, __LINE__);
1987 switch (
arg1.userType()) {
1988 case QMetaType::Int: {
1989 const int int1 =
arg1.toInt();
1990 const int int2 =
arg2.toInt();
1991 if (int1 > 0 && (int2 >= INT_MAX - int1)) {
1994 }
else if (int1 < 0 && (int2 <= INT_MIN - int1)) {
2003#if QT_CONFIG(datetimeparser)
2004 case QMetaType::QDateTime: {
2007 a1.setTime(
a1.time().addMSecs(
a2.time().msecsSinceStartOfDay()));
2027 qWarning(
"QAbstractSpinBox: Internal error: Different types (%s vs %s) (%s:%d)",
2028 arg1.typeName(),
arg2.typeName(), __FILE__, __LINE__);
2029 switch (
arg1.userType()) {
2032 case QMetaType::QDateTime: {
2035 int days =
a2.daysTo(
a1);
2036 int secs =
a2.secsTo(
a1);
2037 int msecs =
qMax(0,
a1.time().msec() -
a2.time().msec());
2038 if (days < 0 || secs < 0 || msecs < 0) {
2043 dt.setTime(dt.time().addMSecs(msecs));
2062 switch (
arg1.userType()) {
2063 case QMetaType::Int:
2064 ret =
static_cast<int>(qBound<double>(INT_MIN,
arg1.toInt() * multiplier, INT_MAX));
2066 case QMetaType::Double:
ret =
QVariant(
arg1.toDouble() * multiplier);
break;
2067#if QT_CONFIG(datetimeparser)
2068 case QMetaType::QDateTime: {
2072 qint64 msecs =
qint64(
arg1.toDateTime().time().msecsSinceStartOfDay() * multiplier
2073 + days * (24 * 3600 * 1000));
2091 switch (
arg1.userType()) {
2092 case QMetaType::Int:
2093 a1 = (double)
arg1.toInt();
2094 a2 = (double)
arg2.toInt();
2096 case QMetaType::Double:
2100#if QT_CONFIG(datetimeparser)
2101 case QMetaType::QDateTime:
2104 a1 +=
arg1.toDateTime().time().msecsSinceStartOfDay() / (36e5 * 24);
2105 a2 +=
arg2.toDateTime().time().msecsSinceStartOfDay() / (36e5 * 24);
2111 return (
a1 != 0 &&
a2 != 0) ? (
a1 /
a2) : 0.0;
2116 switch (
arg2.userType()) {
2117 case QMetaType::QDate:
2118 Q_ASSERT_X(
arg1.userType() == QMetaType::QDate,
"QAbstractSpinBoxPrivate::variantCompare",
2121 if (
arg1.toDate() ==
arg2.toDate()) {
2123 }
else if (
arg1.toDate() <
arg2.toDate()) {
2128 case QMetaType::QTime:
2129 Q_ASSERT_X(
arg1.userType() == QMetaType::QTime,
"QAbstractSpinBoxPrivate::variantCompare",
2132 if (
arg1.toTime() ==
arg2.toTime()) {
2134 }
else if (
arg1.toTime() <
arg2.toTime()) {
2141 case QMetaType::QDateTime:
2142 if (
arg1.toDateTime() ==
arg2.toDateTime()) {
2144 }
else if (
arg1.toDateTime() <
arg2.toDateTime()) {
2149 case QMetaType::Int:
2150 if (
arg1.toInt() ==
arg2.toInt()) {
2152 }
else if (
arg1.toInt() <
arg2.toInt()) {
2157 case QMetaType::Double:
2158 if (
arg1.toDouble() ==
arg2.toDouble()) {
2160 }
else if (
arg1.toDouble() <
arg2.toDouble()) {
2170 Q_ASSERT_X(0,
"QAbstractSpinBoxPrivate::variantCompare",
2185 return (compMax < 0 ?
value : max);
2194#include "moc_qabstractspinbox.cpp"
virtual QVariant valueFromText(const QString &input) const
virtual void emitSignals(EmitPolicy ep, const QVariant &old)
virtual QStyle::SubControl newHoverControl(const QPoint &pos)
static QVariant variantBound(const QVariant &min, const QVariant &value, const QVariant &max)
int spinClickTimerInterval
virtual QVariant getZeroVariant() const
virtual void editorCursorPositionChanged(int oldpos, int newpos)
virtual void setRange(const QVariant &min, const QVariant &max)
QSpinBoxValidator * validator
bool specialValue() const
static int variantCompare(const QVariant &arg1, const QVariant &arg2)
QString stripped(const QString &text, int *pos=nullptr) const
Qt::KeyboardModifier stepModifier
int spinClickThresholdTimerId
virtual void updateEdit()
QAbstractSpinBoxPrivate()
uint ignoreCursorPositionChanged
Qt::KeyboardModifiers keyboardModifiers
void editorTextChanged(const QString &)
virtual void interpret(EmitPolicy ep)
QStyle::SubControl hoverControl
virtual void updateEditFieldGeometry()
QSize cachedMinimumSizeHint
virtual QString textFromValue(const QVariant &n) const
void updateState(bool up, bool fromKeyboard=false)
virtual QVariant bound(const QVariant &val, const QVariant &old=QVariant(), int steps=0) const
virtual void clearCache() const
QValidator::State cachedState
void setValue(const QVariant &val, EmitPolicy ep, bool updateEdit=true)
bool updateHoverControl(const QPoint &pos)
QAbstractSpinBox::CorrectionMode correctionMode
int spinClickThresholdTimerInterval
~QAbstractSpinBoxPrivate()
virtual QVariant calculateAdaptiveDecimalStep(int steps) const
The QAbstractSpinBox class provides a spinbox and a line edit to display values.
QString specialValueText
the special-value text
void selectAll()
Selects all the text in the spinbox except the prefix and suffix.
void editingFinished()
This signal is emitted editing is finished.
void focusInEvent(QFocusEvent *event) override
\reimp
QString text
the spin box's text, including any prefix and suffix
void setButtonSymbols(ButtonSymbols bs)
void interpretText()
This function interprets the text of the spin box.
void setSpecialValueText(const QString &txt)
bool isGroupSeparatorShown() const
void hideEvent(QHideEvent *event) override
\reimp
void mouseMoveEvent(QMouseEvent *event) override
\reimp
void setCorrectionMode(CorrectionMode cm)
void changeEvent(QEvent *event) override
\reimp
void paintEvent(QPaintEvent *event) override
\reimp
void resizeEvent(QResizeEvent *event) override
\reimp
void setKeyboardTracking(bool kt)
CorrectionMode correctionMode
the mode to correct an \l{QValidator::}{Intermediate} value if editing finishes
Qt::Alignment alignment
the alignment of the spin box
ButtonSymbols buttonSymbols
the current button symbol mode
void stepUp()
Steps up by one linestep Calling this slot is analogous to calling stepBy(1);.
void mousePressEvent(QMouseEvent *event) override
\reimp
~QAbstractSpinBox()
Called when the QAbstractSpinBox is destroyed.
QAbstractSpinBox(QWidget *parent=nullptr)
Constructs an abstract spinbox with the given parent with default \l wrapping, and \l alignment prope...
virtual void fixup(QString &input) const
This virtual function is called by the QAbstractSpinBox if the input is not validated to QValidator::...
bool keyboardTracking
whether keyboard tracking is enabled for the spinbox.
void setLineEdit(QLineEdit *edit)
Sets the line edit of the spinbox to be lineEdit instead of the current line edit widget.
virtual void stepBy(int steps)
Virtual function that is called whenever the user triggers a step.
void setAlignment(Qt::Alignment flag)
void setAccelerated(bool on)
QSize minimumSizeHint() const override
\reimp
void showEvent(QShowEvent *event) override
\reimp
void stepDown()
Steps down by one linestep Calling this slot is analogous to calling stepBy(-1);.
void closeEvent(QCloseEvent *event) override
\reimp
CorrectionMode
This enum type describes the mode the spinbox will use to correct an \l{QValidator::}{Intermediate} v...
virtual void initStyleOption(QStyleOptionSpinBox *option) const
Initialize option with the values from this QSpinBox.
@ AdaptiveDecimalStepType
void keyReleaseEvent(QKeyEvent *event) override
\reimp
void timerEvent(QTimerEvent *event) override
\reimp
QLineEdit * lineEdit() const
This function returns a pointer to the line edit of the spin box.
bool isAccelerated() const
QSize sizeHint() const override
\reimp
bool event(QEvent *event) override
\reimp
void mouseReleaseEvent(QMouseEvent *event) override
\reimp
void focusOutEvent(QFocusEvent *event) override
\reimp
virtual StepEnabled stepEnabled() const
Virtual function that determines whether stepping up and down is legal at any given time.
void setGroupSeparatorShown(bool shown)
bool wrapping
whether the spin box is circular.
bool hasAcceptableInput() const
virtual void clear()
Clears the lineedit of all text but prefix and suffix.
void keyPressEvent(QKeyEvent *event) override
\reimp
QVariant inputMethodQuery(Qt::InputMethodQuery) const override
\reimp
ButtonSymbols
This enum type describes the symbols that can be displayed on the buttons in a spin box.
virtual QValidator::State validate(QString &input, int &pos) const
This virtual function is called by the QAbstractSpinBox to determine whether input is valid.
The QAction class provides an abstraction for user commands that can be added to different user inter...
The QCloseEvent class contains parameters that describe a close event.
static bool sendEvent(QObject *receiver, QEvent *event)
Sends event event directly to receiver receiver, using the notify() function.
\inmodule QtCore\reentrant
@ ApplicationLayoutDirectionChange
The QFocusEvent class contains event parameters for widget focus events.
\reentrant \inmodule QtGui
static QStyleHints * styleHints()
Returns the application's style hints.
QString platformName
The name of the underlying platform plugin.
The QHideEvent class provides an event which is sent after a widget is hidden.
The QKeyEvent class describes a key event.
The QLineEdit widget is a one-line text editor.
int cursorPosition
The current cursor position for this line edit.
void setValidator(const QValidator *)
Sets the validator for values of line edit to v.
void cursorPositionChanged(int, int)
This signal is emitted whenever the cursor moves.
bool hasSelectedText
Whether there is any text selected.
int selectionStart() const
Returns the index of the first selected character in the line edit (or -1 if no text is selected).
QString displayText
The displayed text.
QString selectedText
The selected text.
void setCursorPosition(int)
void textChanged(const QString &)
This signal is emitted whenever the text changes.
void setText(const QString &)
void setSelection(int, int)
Selects text from position start and for length characters.
QString text
The line edit's text.
static QMetaObject::Connection connect(const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiverPrivate, Func2 slot, Qt::ConnectionType type=Qt::AutoConnection)
int startTimer(int interval, Qt::TimerType timerType=Qt::CoarseTimer)
This is an overloaded function that will start a timer of type timerType and a timeout of interval mi...
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
virtual void timerEvent(QTimerEvent *event)
This event handler can be reimplemented in a subclass to receive timer events for the object.
Q_WEAK_OVERLOAD void setObjectName(const QString &name)
Sets the object's name to name.
void killTimer(int id)
Kills the timer with timer identifier, id.
The QPaintEvent class contains event parameters for paint events.
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
The QResizeEvent class contains event parameters for resize events.
The QShowEvent class provides an event that is sent when a widget is shown.
Exception-safe wrapper around QObject::blockSignals().
The QSizePolicy class is a layout attribute describing horizontal and vertical resizing policy.
void fixup(QString &) const override
QSpinBoxValidator(QAbstractSpinBox *qptr, QAbstractSpinBoxPrivate *dptr)
QValidator::State validate(QString &input, int &) const override
\macro QT_RESTRICTED_CAST_FROM_ASCII
bool startsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string starts with s; otherwise returns false.
static QString fromLatin1(QByteArrayView ba)
This is an overloaded member function, provided for convenience. It differs from the above function o...
void truncate(qsizetype pos)
Truncates the string at the given position index.
QString mid(qsizetype position, qsizetype n=-1) const &
bool isEmpty() const noexcept
Returns true if the string has no characters; otherwise returns false.
void clear()
Clears the contents of the string and makes it null.
qsizetype size() const noexcept
Returns the number of characters in this string.
bool endsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string ends with s; otherwise returns false.
QString trimmed() const &
The QStylePainter class is a convenience class for drawing QStyle elements inside a widget.
virtual QSize sizeFromContents(ContentsType ct, const QStyleOption *opt, const QSize &contentsSize, const QWidget *w=nullptr) const =0
Returns the size of the element described by the specified option and type, based on the provided con...
@ SH_SpinBox_AnimateButton
@ SH_SpinBox_ClickAutoRepeatRate
@ SH_SpinControls_DisableOnBounds
@ SH_SpinBox_SelectOnStep
@ SH_SpinBox_StepModifier
@ SH_SpinBox_ClickAutoRepeatThreshold
@ SH_SpinBox_ButtonsInsideFrame
virtual int styleHint(StyleHint stylehint, const QStyleOption *opt=nullptr, const QWidget *widget=nullptr, QStyleHintReturn *returnData=nullptr) const =0
Returns an integer representing the specified style hint for the given widget described by the provid...
SubControl
This enum describes the available sub controls.
The QValidator class provides validation of input text.
State
This enum type defines the states in which a validated string can exist.
void clear()
Convert this variant to type QMetaType::UnknownType and free up any resources used.
void setValue(T &&avalue)
bool isNull() const
Returns true if this is a null variant, false otherwise.
EGLImageKHR int int EGLuint64KHR * modifiers
Combined button and popup list for selecting options.
@ MouseEventNotSynthesized
QVariant operator-(const QVariant &arg1, const QVariant &arg2)
QVariant operator*(const QVariant &arg1, double multiplier)
double operator/(const QVariant &arg1, const QVariant &arg2)
QVariant operator+(const QVariant &arg1, const QVariant &arg2)
static jboolean copy(JNIEnv *, jobject)
#define QDATETIMEEDIT_DATE_MIN
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
constexpr const T & qBound(const T &min, const T &val, const T &max)
constexpr const T & qMax(const T &a, const T &b)
GLboolean GLboolean GLboolean b
GLsizei const GLfloat * v
[13]
GLfloat GLfloat GLfloat w
[0]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLfloat GLfloat GLfloat GLfloat h
GLuint GLuint GLuint GLuint arg1
GLuint GLuint GLuint GLuint GLuint GLuint GLuint arg2
GLdouble GLdouble GLdouble GLdouble q
GLenum GLenum GLenum input
static qreal position(const QQuickItem *item, QQuickAnchors::Anchor anchorLine)
#define Q_ASSERT_X(cond, x, msg)
#define qPrintable(string)
static QT_BEGIN_NAMESPACE QVariant hint(QPlatformIntegration::StyleHint h)
args<< 1<< 2;QJSValue threeAgain=fun.call(args);QString fileName="helloworld.qs";QFile scriptFile(fileName);if(!scriptFile.open(QIODevice::ReadOnly)) QTextStream stream(&scriptFile);QString contents=stream.readAll();scriptFile.close();myEngine.evaluate(contents, fileName);myEngine.globalObject().setProperty("myNumber", 123);...QJSValue myNumberPlusOne=myEngine.evaluate("myNumber + 1");QJSValue result=myEngine.evaluate(...);if(result.isError()) qDebug()<< "Uncaught exception at line"<< result.property("lineNumber").toInt()<< ":"<< result.toString();QPushButton *button=new QPushButton;QJSValue scriptButton=myEngine.newQObject(button);myEngine.globalObject().setProperty("button", scriptButton);myEngine.evaluate("button.checkable = true");qDebug()<< scriptButton.property("checkable").toBool();scriptButton.property("show").call();QJSEngine engine;QObject *myQObject=new QObject();myQObject- setProperty)("dynamicProperty", 3)