![]() |
Qt 6.x
The Qt SDK
|
#include <qabstractspinbox_p.h>
Static Public Member Functions | |
static int | variantCompare (const QVariant &arg1, const QVariant &arg2) |
static QVariant | variantBound (const QVariant &min, const QVariant &value, const QVariant &max) |
![]() | |
static QWidgetPrivate * | get (QWidget *w) |
static const QWidgetPrivate * | get (const QWidget *w) |
static void | checkRestoredGeometry (const QRect &availableGeometry, QRect *restoredGeometry, int frameHeight) |
static void | adjustFlags (Qt::WindowFlags &flags, QWidget *w=nullptr) |
static QWidget * | parentGraphicsView (const QWidget *widget) |
static QRect | screenGeometry (const QWidget *widget) |
static QRect | availableScreenGeometry (const QWidget *widget) |
static QScreen * | screen (const QWidget *widget, const QPoint &globalPosition, bool hasPosition=true) |
static QRect | screenGeometry (const QWidget *widget, const QPoint &globalPosition, bool hasPosition=true) |
static QRect | availableScreenGeometry (const QWidget *widget, const QPoint &globalPosition, bool hasPosition=true) |
static void | sendComposeStatus (QWidget *w, bool end) |
static void | setWidgetParentHelper (QObject *widgetAsObject, QObject *newParent) |
![]() | |
static bool | removeConnection (Connection *c) |
static QObjectPrivate * | get (QObject *o) |
static const QObjectPrivate * | get (const QObject *o) |
template<typename Func1 , typename Func2 > | |
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) |
template<typename Func1 , typename Func2 > | |
static bool | disconnect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiverPrivate, Func2 slot) |
static QMetaObject::Connection | connectImpl (const QObject *sender, int signal_index, const QObject *receiver, void **slot, QtPrivate::QSlotObjectBase *slotObj, int type, const int *types, const QMetaObject *senderMetaObject) |
static QMetaObject::Connection | connect (const QObject *sender, int signal_index, QtPrivate::QSlotObjectBase *slotObj, Qt::ConnectionType type) |
static QMetaObject::Connection | connect (const QObject *sender, int signal_index, const QObject *receiver, QtPrivate::QSlotObjectBase *slotObj, Qt::ConnectionType type) |
static bool | disconnect (const QObject *sender, int signal_index, void **slot) |
static bool | disconnect (const QObject *sender, int signal_index, const QObject *receiver, void **slot) |
Additional Inherited Members | |
![]() | |
enum | DrawWidgetFlag { DrawAsRoot = 0x01 , DrawPaintOnScreen = 0x02 , DrawRecursive = 0x04 , DrawInvisible = 0x08 , DontSubtractOpaqueChildren = 0x10 , DontDrawOpaqueChildren = 0x20 , DontDrawNativeChildren = 0x40 , DontSetCompositionMode = 0x80 , UseEffectRegionBounds = 0x100 } |
enum | Direction { DirectionNorth = 0x01 , DirectionEast = 0x10 , DirectionSouth = 0x02 , DirectionWest = 0x20 } |
enum class | WindowHandleMode { Direct , Closest , TopLevel } |
enum | CloseMode { CloseNoEvent , CloseWithEvent , CloseWithSpontaneousEvent } |
![]() | |
typedef void(* | StaticMetaCallFunction) (QObject *, QMetaObject::Call, int, void **) |
using | ConnectionDataPointer = QExplicitlySharedDataPointer< ConnectionData > |
![]() | |
static QWidgetMapper * | mapper = nullptr |
static QWidgetSet * | allWidgets = nullptr |
static int | instanceCounter = 0 |
static int | maxInstances = 0 |
Definition at line 54 of file qabstractspinbox_p.h.
QAbstractSpinBoxPrivate::QAbstractSpinBoxPrivate | ( | ) |
Constructs a QAbstractSpinBoxPrivate object
Definition at line 1394 of file qabstractspinbox.cpp.
QAbstractSpinBoxPrivate::~QAbstractSpinBoxPrivate | ( | ) |
Definition at line 1405 of file qabstractspinbox.cpp.
|
virtual |
Virtual slot connected to the line edit's cursorPositionChanged(int, int) signal. Will move the cursor to a valid position if the new one is invalid. E.g. inside the prefix. Reimplemented in Q[Date|Time|DateTime]EditPrivate to account for the different sections etc.
Reimplemented in QDateTimeEditPrivate.
Definition at line 1543 of file qabstractspinbox.cpp.
References edit, QLineEdit::hasSelectedText, ignoreCursorPositionChanged, pos, prefix, QLineEdit::selectedText, QLineEdit::selectionStart(), QLineEdit::setCursorPosition(), QLineEdit::setSelection(), QString::size(), specialValue(), suffix, and QLineEdit::text.
Slot connected to the line edit's textChanged(const QString &) signal.
Definition at line 1513 of file qabstractspinbox.cpp.
References QValidator::Acceptable, QLineEdit::cursorPosition, edit, EmitIfChanged, keyboardTracking, pendingEmit, pos, setValue(), state, and valueFromText().
|
virtual |
Bounds val to be within minimum and maximum. Also tries to be clever about setting it at min and max depending on what it was and what direction it was changed etc.
Definition at line 1711 of file qabstractspinbox.cpp.
References QVariant::isNull(), maximum, minimum, variantCompare(), and wrapping.
Referenced by setRange(), setValue(), and QDateTimeEditPrivate::stepBy().
|
virtual |
Reimplemented in QSpinBoxPrivate, and QDoubleSpinBoxPrivate.
Definition at line 1922 of file qabstractspinbox.cpp.
References Q_UNUSED, and singleStep.
|
virtual |
Reimplemented in QDateTimeEditPrivate.
Definition at line 1915 of file qabstractspinbox.cpp.
References QValidator::Acceptable, cachedState, cachedText, cachedValue, QVariant::clear(), and QString::clear().
Referenced by QDateTimeEditPrivate::clearCache(), interpret(), and setRange().
|
virtual |
Virtual function that emits signals when the value changes. Reimplemented in the different subclasses.
Reimplemented in QSpinBoxPrivate, QDoubleSpinBoxPrivate, and QDateTimeEditPrivate.
Definition at line 1502 of file qabstractspinbox.cpp.
Referenced by setValue().
|
virtual |
Convenience function to get a variant of the right type.
Reimplemented in QDateTimeEditPrivate.
Definition at line 1831 of file qabstractspinbox.cpp.
References ret.
Referenced by interpret().
void QAbstractSpinBoxPrivate::init | ( | ) |
Initialises the QAbstractSpinBoxPrivate object.
Definition at line 1589 of file qabstractspinbox.cpp.
References edit, QSizePolicy::Fixed, QSizePolicy::Minimum, opt, QObject::setObjectName(), QLineEdit::setValidator(), QStyle::SH_SpinBox_ClickAutoRepeatRate, QStyle::SH_SpinBox_ClickAutoRepeatThreshold, QSizePolicy::SpinBox, spinClickThresholdTimerInterval, spinClickTimerInterval, validator, Qt::WA_InputMethodEnabled, Qt::WA_MacShowFocusRect, and Qt::WheelFocus.
|
virtual |
Interprets text and emits signals. Called when the spinbox needs to interpret the text on the lineedit.
Reimplemented in QDateTimeEditPrivate.
Definition at line 1880 of file qabstractspinbox.cpp.
References QValidator::Acceptable, clearCache(), cleared, copy(), correctionMode, QAbstractSpinBox::CorrectToNearestValue, QLineEdit::cursorPosition, QLineEdit::displayText, edit, getZeroVariant(), maximum, minimum, pos, QASBDEBUG, QLineEdit::setCursorPosition(), setValue(), QMetaType::UnknownType, value, valueFromText(), and variantBound().
Referenced by QDateTimeEditPrivate::interpret().
|
virtual |
Returns the hover control at pos. This will update the hoverRect and hoverControl.
Reimplemented in QDateTimeEditPrivate.
Definition at line 1433 of file qabstractspinbox.cpp.
References QStyle::CC_SpinBox, hoverControl, hoverRect, opt, pos, and QStyle::SC_All.
Referenced by QDateTimeEditPrivate::newHoverControl(), and updateHoverControl().
void QAbstractSpinBoxPrivate::reset | ( | ) |
Resets the state of the spinbox. E.g. the state is set to (Keyboard|Up) if Key up is currently pressed.
Definition at line 1618 of file qabstractspinbox.cpp.
References acceleration, buttonState, None, spinClickThresholdTimerId, and spinClickTimerId.
Referenced by setRange(), and updateState().
Convenience function to set min/max values.
Reimplemented in QDateTimeEditPrivate.
Definition at line 1805 of file qabstractspinbox.cpp.
References bound(), cachedMinimumSizeHint, cachedSizeHint, clearCache(), EmitIfChanged, QString::isEmpty(), maximum, minimum, reset(), setValue(), specialValueText, updateEdit(), and variantCompare().
Referenced by QDateTimeEditPrivate::setRange().
void QAbstractSpinBoxPrivate::setValue | ( | const QVariant & | val, |
EmitPolicy | ep, | ||
bool | doUpdate = true |
||
) |
Sets the value of the spin box to val. Depending on the value of ep it will also emit signals.
Definition at line 1748 of file qabstractspinbox.cpp.
References AlwaysEmit, bound(), cleared, EmitIfChanged, emitSignals(), pendingEmit, updateEdit(), and value.
Referenced by _q_editorTextChanged(), interpret(), QDateTimeEditPrivate::interpret(), and setRange().
bool QAbstractSpinBoxPrivate::specialValue | ( | ) | const |
Returns true
if a specialValueText has been set and the current value is minimum.
Definition at line 1492 of file qabstractspinbox.cpp.
References QString::isEmpty(), minimum, and specialValueText.
Referenced by _q_editorCursorPositionChanged(), QDateTimeEditPrivate::_q_editorCursorPositionChanged(), QDateTimeEditPrivate::setSelected(), updateEdit(), and QDateTimeEditPrivate::updateEdit().
Strips any prefix/suffix from text.
Definition at line 1450 of file qabstractspinbox.cpp.
References QString::endsWith(), QString::mid(), pos, prefix, QString::size(), specialValueText, QString::startsWith(), suffix, text, and QString::trimmed().
Referenced by QSpinBoxPrivate::validateAndInterpret(), and QDoubleSpinBoxPrivate::validateAndInterpret().
Virtual method called that calls the public textFromValue() functions in the subclasses. Needed to change signature from QVariant to int/double/QDateTime etc. Used when needing to display a value textually.
This method is reimeplemented in the various subclasses.
Reimplemented in QDateTimeEditPrivate, QSpinBoxPrivate, and QDoubleSpinBoxPrivate.
Definition at line 1853 of file qabstractspinbox.cpp.
Referenced by updateEdit(), and QDateTimeEditPrivate::valueToText().
|
virtual |
Updates the line edit to reflect the current value of the spin box.
Reimplemented in QDateTimeEditPrivate.
Definition at line 1772 of file qabstractspinbox.cpp.
References cleared, cursor, QLineEdit::cursorPosition, QLineEdit::displayText, edit, QString::isEmpty(), prefix, qBound(), QLineEdit::selectedText, QLineEdit::setCursorPosition(), QLineEdit::setSelection(), QLineEdit::setText(), QString::size(), specialValue(), specialValueText, suffix, QLineEdit::text, textFromValue(), and QMetaType::UnknownType.
Referenced by setRange(), and setValue().
|
virtual |
Reimplemented in QDateTimeEditPrivate.
Definition at line 1478 of file qabstractspinbox.cpp.
References QStyle::CC_SpinBox, edit, opt, QStyle::SC_SpinBoxEditField, and QWidget::setGeometry().
Referenced by QDateTimeEditPrivate::updateEditFieldGeometry().
bool QAbstractSpinBoxPrivate::updateHoverControl | ( | const QPoint & | pos | ) |
Updates the old and new hover control. Does nothing if the hover control has not changed.
Definition at line 1414 of file qabstractspinbox.cpp.
References hoverControl, hoverRect, newHoverControl(), pos, and Qt::WA_Hover.
Updates the state of the spinbox.
Definition at line 1640 of file qabstractspinbox.cpp.
References buttonState, Down, Keyboard, keyboardModifiers, Mouse, reset(), spinClickThresholdTimerId, spinClickThresholdTimerInterval, QAbstractSpinBox::StepDownEnabled, stepModifier, QAbstractSpinBox::StepUpEnabled, and Up.
Virtual method called that calls the public valueFromText() functions in the subclasses. Needed to change signature from QVariant to int/double/QDateTime etc. Used when needing to interpret a string as another type.
This method is reimeplemented in the various subclasses.
Reimplemented in QDateTimeEditPrivate, QSpinBoxPrivate, and QDoubleSpinBoxPrivate.
Definition at line 1869 of file qabstractspinbox.cpp.
Referenced by _q_editorTextChanged(), and interpret().
|
static |
Definition at line 2176 of file qabstractspinbox.cpp.
References Q_ASSERT, and variantCompare().
Referenced by interpret().
Definition at line 2112 of file qabstractspinbox.cpp.
References arg, QString::fromLatin1(), Q_ASSERT_X, Q_FALLTHROUGH, qPrintable, and QMetaType::UnknownType.
Referenced by bound(), QDoubleSpinBox::setMaximum(), QSpinBox::setMaximum(), QDoubleSpinBox::setMinimum(), QSpinBox::setMinimum(), setRange(), QAbstractSpinBox::stepEnabled(), and variantBound().
uint QAbstractSpinBoxPrivate::accelerate |
Definition at line 122 of file qabstractspinbox_p.h.
int QAbstractSpinBoxPrivate::acceleration = 0 |
Definition at line 106 of file qabstractspinbox_p.h.
Referenced by reset().
Definition at line 116 of file qabstractspinbox_p.h.
Referenced by reset(), QDateTimeEditPrivate::updateArrow(), and updateState().
QAbstractSpinBox::ButtonSymbols QAbstractSpinBoxPrivate::buttonSymbols = QAbstractSpinBox::UpDownArrows |
Definition at line 113 of file qabstractspinbox_p.h.
QSize QAbstractSpinBoxPrivate::cachedMinimumSizeHint |
Definition at line 97 of file qabstractspinbox_p.h.
Referenced by setRange().
|
mutable |
Definition at line 97 of file qabstractspinbox_p.h.
Referenced by setRange().
|
mutable |
Definition at line 115 of file qabstractspinbox_p.h.
Referenced by clearCache(), QDateTimeEditPrivate::validateAndInterpret(), QSpinBoxPrivate::validateAndInterpret(), and QDoubleSpinBoxPrivate::validateAndInterpret().
|
mutable |
Definition at line 95 of file qabstractspinbox_p.h.
Referenced by clearCache(), QDateTimeEditPrivate::updateCache(), QDateTimeEditPrivate::validateAndInterpret(), QSpinBoxPrivate::validateAndInterpret(), and QDoubleSpinBoxPrivate::validateAndInterpret().
|
mutable |
Definition at line 96 of file qabstractspinbox_p.h.
Referenced by clearCache(), QDateTimeEditPrivate::updateCache(), QDateTimeEditPrivate::validateAndInterpret(), QSpinBoxPrivate::validateAndInterpret(), and QDoubleSpinBoxPrivate::validateAndInterpret().
uint QAbstractSpinBoxPrivate::cleared |
Definition at line 124 of file qabstractspinbox_p.h.
Referenced by interpret(), setValue(), and updateEdit().
QAbstractSpinBox::CorrectionMode QAbstractSpinBoxPrivate::correctionMode = QAbstractSpinBox::CorrectToPreviousValue |
Definition at line 111 of file qabstractspinbox_p.h.
Referenced by interpret(), and QDateTimeEditPrivate::interpret().
Definition at line 98 of file qabstractspinbox_p.h.
Referenced by _q_editorCursorPositionChanged(), QDateTimeEditPrivate::_q_editorCursorPositionChanged(), _q_editorTextChanged(), QDateTimeEditPrivate::clearSection(), QSpinBoxPrivate::emitSignals(), QDoubleSpinBoxPrivate::emitSignals(), init(), interpret(), QDateTimeEditPrivate::interpret(), QDateTimeEditPrivate::setSelected(), QDateTimeEditPrivate::stepBy(), QDateTimeEditPrivate::updateCache(), updateEdit(), QDateTimeEditPrivate::updateEdit(), updateEditFieldGeometry(), and QDateTimeEditPrivate::updateEditFieldGeometry().
qreal QAbstractSpinBoxPrivate::effectiveSpinRepeatRate = 1 |
Definition at line 105 of file qabstractspinbox_p.h.
uint QAbstractSpinBoxPrivate::frame |
Definition at line 121 of file qabstractspinbox_p.h.
QStyle::SubControl QAbstractSpinBoxPrivate::hoverControl = QStyle::SC_None |
Definition at line 114 of file qabstractspinbox_p.h.
Referenced by newHoverControl(), QDateTimeEditPrivate::newHoverControl(), QDateTimeEditPrivate::updateArrow(), and updateHoverControl().
QRect QAbstractSpinBoxPrivate::hoverRect |
Definition at line 93 of file qabstractspinbox_p.h.
Referenced by newHoverControl(), and updateHoverControl().
uint QAbstractSpinBoxPrivate::ignoreCursorPositionChanged |
Definition at line 120 of file qabstractspinbox_p.h.
Referenced by _q_editorCursorPositionChanged(), and QDateTimeEditPrivate::_q_editorCursorPositionChanged().
uint QAbstractSpinBoxPrivate::ignoreUpdateEdit |
Definition at line 125 of file qabstractspinbox_p.h.
Qt::KeyboardModifiers QAbstractSpinBoxPrivate::keyboardModifiers = Qt::NoModifier |
Definition at line 109 of file qabstractspinbox_p.h.
Referenced by updateState().
uint QAbstractSpinBoxPrivate::keyboardTracking |
Definition at line 123 of file qabstractspinbox_p.h.
Referenced by _q_editorTextChanged(), QDateTimeEditPrivate::getMaximum(), and QDateTimeEditPrivate::getMinimum().
QVariant QAbstractSpinBoxPrivate::maximum |
Definition at line 92 of file qabstractspinbox_p.h.
Referenced by QDateTimeEditPrivate::QDateTimeEditPrivate(), QDoubleSpinBoxPrivate::QDoubleSpinBoxPrivate(), QSpinBoxPrivate::QSpinBoxPrivate(), bound(), QDateTimeEditPrivate::getMaximum(), interpret(), setRange(), QDateTimeEditPrivate::stepBy(), QDateTimeEditPrivate::updateTimeZone(), QSpinBoxPrivate::validateAndInterpret(), and QDoubleSpinBoxPrivate::validateAndInterpret().
QVariant QAbstractSpinBoxPrivate::minimum |
Definition at line 92 of file qabstractspinbox_p.h.
Referenced by QDateTimeEditPrivate::QDateTimeEditPrivate(), QDoubleSpinBoxPrivate::QDoubleSpinBoxPrivate(), QSpinBoxPrivate::QSpinBoxPrivate(), bound(), QDateTimeEditPrivate::getMinimum(), interpret(), setRange(), specialValue(), QDateTimeEditPrivate::stepBy(), QDateTimeEditPrivate::updateTimeZone(), QDateTimeEditPrivate::validateAndInterpret(), QSpinBoxPrivate::validateAndInterpret(), and QDoubleSpinBoxPrivate::validateAndInterpret().
uint QAbstractSpinBoxPrivate::pendingEmit |
Definition at line 117 of file qabstractspinbox_p.h.
Referenced by _q_editorTextChanged(), QSpinBoxPrivate::emitSignals(), QDoubleSpinBoxPrivate::emitSignals(), QDateTimeEditPrivate::emitSignals(), setValue(), and QDateTimeEditPrivate::stepBy().
QString QAbstractSpinBoxPrivate::prefix |
Definition at line 91 of file qabstractspinbox_p.h.
Referenced by _q_editorCursorPositionChanged(), stripped(), updateEdit(), QSpinBoxValidator::validate(), QSpinBoxPrivate::validateAndInterpret(), and QDoubleSpinBoxPrivate::validateAndInterpret().
uint QAbstractSpinBoxPrivate::readOnly |
Definition at line 118 of file qabstractspinbox_p.h.
uint QAbstractSpinBoxPrivate::showGroupSeparator |
Definition at line 126 of file qabstractspinbox_p.h.
QVariant QAbstractSpinBoxPrivate::singleStep |
Definition at line 92 of file qabstractspinbox_p.h.
Referenced by QDoubleSpinBoxPrivate::QDoubleSpinBoxPrivate(), QSpinBoxPrivate::QSpinBoxPrivate(), and calculateAdaptiveDecimalStep().
QString QAbstractSpinBoxPrivate::specialValueText |
Definition at line 91 of file qabstractspinbox_p.h.
Referenced by setRange(), specialValue(), stripped(), updateEdit(), QDateTimeEditPrivate::updateEdit(), QSpinBoxValidator::validate(), and QDateTimeEditPrivate::validateAndInterpret().
int QAbstractSpinBoxPrivate::spinClickThresholdTimerId = -1 |
Definition at line 103 of file qabstractspinbox_p.h.
Referenced by reset(), and updateState().
int QAbstractSpinBoxPrivate::spinClickThresholdTimerInterval = -1 |
Definition at line 104 of file qabstractspinbox_p.h.
Referenced by init(), and updateState().
int QAbstractSpinBoxPrivate::spinClickTimerId = -1 |
Definition at line 101 of file qabstractspinbox_p.h.
Referenced by reset().
int QAbstractSpinBoxPrivate::spinClickTimerInterval = 100 |
Definition at line 102 of file qabstractspinbox_p.h.
Referenced by init().
Qt::KeyboardModifier QAbstractSpinBoxPrivate::stepModifier = Qt::ControlModifier |
Definition at line 110 of file qabstractspinbox_p.h.
Referenced by updateState().
QAbstractSpinBox::StepType QAbstractSpinBoxPrivate::stepType = QAbstractSpinBox::StepType::DefaultStepType |
Definition at line 112 of file qabstractspinbox_p.h.
QString QAbstractSpinBoxPrivate::suffix |
Definition at line 91 of file qabstractspinbox_p.h.
Referenced by _q_editorCursorPositionChanged(), stripped(), updateEdit(), QSpinBoxValidator::validate(), QSpinBoxPrivate::validateAndInterpret(), and QDoubleSpinBoxPrivate::validateAndInterpret().
QMetaType::Type QAbstractSpinBoxPrivate::type = QMetaType::UnknownType |
Definition at line 100 of file qabstractspinbox_p.h.
QSpinBoxValidator* QAbstractSpinBoxPrivate::validator = nullptr |
Definition at line 99 of file qabstractspinbox_p.h.
Referenced by init().
QVariant QAbstractSpinBoxPrivate::value |
Definition at line 92 of file qabstractspinbox_p.h.
Referenced by interpret(), and setValue().
int QAbstractSpinBoxPrivate::wheelDeltaRemainder = 0 |
Definition at line 107 of file qabstractspinbox_p.h.
uint QAbstractSpinBoxPrivate::wrapping |
Definition at line 119 of file qabstractspinbox_p.h.
Referenced by bound(), and QDateTimeEditPrivate::stepBy().