Qt 4.8
Public Functions | Static Public Functions | Public Variables | List of all members
QAbstractSpinBoxPrivate Class Reference

#include <qabstractspinbox_p.h>

Inheritance diagram for QAbstractSpinBoxPrivate:
QWidgetPrivate QObjectPrivate QObjectData QDateTimeEditPrivate QDoubleSpinBoxPrivate QSpinBoxPrivate

Public Functions

virtual void _q_editorCursorPositionChanged (int oldpos, int newpos)
 Virtual slot connected to the line edit's cursorPositionChanged(int, int) signal. More...
 
void _q_editorTextChanged (const QString &)
 Slot connected to the line edit's textChanged(const QString &) signal. More...
 
virtual QVariant bound (const QVariant &val, const QVariant &old=QVariant(), int steps=0) const
 Bounds val to be within minimum and maximum. More...
 
virtual void clearCache () const
 
virtual void emitSignals (EmitPolicy ep, const QVariant &old)
 
virtual QVariant getZeroVariant () const
 Convenience function to get a variant of the right type. More...
 
void init ()
 Initialises the QAbstractSpinBoxPrivate object. More...
 
virtual void interpret (EmitPolicy ep)
 Interprets text and emits signals. More...
 
virtual QStyle::SubControl newHoverControl (const QPoint &pos)
 Returns the hover control at pos. More...
 
 QAbstractSpinBoxPrivate ()
 
void reset ()
 Resets the state of the spinbox. More...
 
virtual void setRange (const QVariant &min, const QVariant &max)
 Convenience function to set min/max values. More...
 
void setValue (const QVariant &val, EmitPolicy ep, bool updateEdit=true)
 Sets the value of the spin box to val. More...
 
bool specialValue () const
 Returns true if a specialValueText has been set and the current value is minimum. More...
 
QString stripped (const QString &text, int *pos=0) const
 Strips any prefix/suffix from text. More...
 
virtual QString textFromValue (const QVariant &n) const
 Virtual method called that calls the public textFromValue() functions in the subclasses. More...
 
virtual void updateEdit ()
 Updates the line edit to reflect the current value of the spin box. More...
 
virtual void updateEditFieldGeometry ()
 
bool updateHoverControl (const QPoint &pos)
 Updates the old and new hover control. More...
 
void updateState (bool up, bool fromKeyboard=false)
 Updates the state of the spinbox. More...
 
virtual QVariant valueFromText (const QString &input) const
 Virtual method called that calls the public valueFromText() functions in the subclasses. More...
 
 ~QAbstractSpinBoxPrivate ()
 
- Public Functions inherited from QWidgetPrivate
void _q_showIfNotHidden ()
 
virtual void aboutToDestroy ()
 
void activateChildLayoutsRecursively ()
 
QSize adjustedSize () const
 
void adjustQuitOnCloseAttribute ()
 
QInputContextassignedInputContext () const
 
QPainterbeginSharedPainter ()
 
QWidgetchildAt_helper (const QPoint &, bool) const
 
QWidgetchildAtRecursiveHelper (const QPoint &p, bool, bool includeFrame=false) const
 
QRect clipRect () const
 
QRegion clipRegion () const
 
void clipToEffectiveMask (QRegion &region) const
 
bool close_helper (CloseMode mode)
 
void create_sys (WId window, bool initializeWindow, bool destroyOldWindow)
 
QWindowSurfacecreateDefaultWindowSurface ()
 
QWindowSurfacecreateDefaultWindowSurface_sys ()
 
void createExtra ()
 Creates the widget extra data. More...
 
void createRecursively ()
 
void createSysExtra ()
 
void createTLExtra ()
 
void createTLSysExtra ()
 
void createWinId (WId id=0)
 
void deactivateWidgetCleanup ()
 
void deleteExtra ()
 Deletes the widget extra data. More...
 
void deleteSysExtra ()
 
void deleteTLSysExtra ()
 
void drawWidget (QPaintDevice *pdev, const QRegion &rgn, const QPoint &offset, int flags, QPainter *sharedPainter=0, QWidgetBackingStore *backingStore=0)
 
QWidgeteffectiveFocusWidget ()
 
QRect effectiveRectFor (const QRect &rect) const
 
bool endSharedPainter ()
 
void enforceNativeChildren ()
 
QWExtraextraData () const
 
QRect frameStrut () const
 
void getLayoutItemMargins (int *left, int *top, int *right, int *bottom) const
 
const QRegiongetOpaqueChildren () const
 
void handleSoftwareInputPanel (Qt::MouseButton button, bool clickCausedFocus)
 
virtual bool hasHeightForWidth () const
 
void hide_helper ()
 
void hide_sys ()
 Platform-specific part of QWidget::hide(). More...
 
void hideChildren (bool spontaneous)
 
void inheritStyle ()
 
void init (QWidget *desktopWidget, Qt::WindowFlags f)
 
QInputContextinputContext () const
 
void invalidateBuffer (const QRegion &)
 Invalidates the rgn (in widget's coordinates) of the backing store, i.e. More...
 
void invalidateBuffer (const QRect &)
 This function is equivalent to calling invalidateBuffer(QRegion(rect), ...), but is more efficient as it eliminates QRegion operations/allocations and can use the rect more precisely for additional cut-offs. More...
 
void invalidateBuffer_resizeHelper (const QPoint &oldPos, const QSize &oldSize)
 Invalidates the buffer when the widget is resized. More...
 
void invalidateGraphicsEffectsRecursively ()
 
bool isAboutToShow () const
 
bool isBackgroundInherited () const
 
bool isOverlapped (const QRect &) const
 
void lower_sys ()
 
QPoint mapFromGlobal (const QPoint &pos) const
 
QPoint mapToGlobal (const QPoint &pos) const
 
QWidgetBackingStoremaybeBackingStore () const
 
QTLWExtramaybeTopData () const
 
void moveRect (const QRect &, int dx, int dy)
 
bool nativeChildrenForced () const
 
QFont naturalWidgetFont (uint inheritedMask) const
 
QPalette naturalWidgetPalette (uint inheritedMask) const
 Returns the palette that the widget w inherits from its ancestors and QApplication::palette. More...
 
void paintBackground (QPainter *, const QRegion &, int flags=DrawAsRoot) const
 
bool paintOnScreen () const
 
void paintSiblingsRecursive (QPaintDevice *pdev, const QObjectList &children, int index, const QRegion &rgn, const QPoint &offset, int flags, QPainter *sharedPainter, QWidgetBackingStore *backingStore)
 
bool pointInsideRectAndMask (const QPoint &) const
 
QRegion prepareToRender (const QRegion &region, QWidget::RenderFlags renderFlags)
 
void propagatePaletteChange ()
 Propagate this widget's palette to all children, except style sheet widgets, and windows that don't enable window propagation (palettes don't normally propagate to windows). More...
 
 QWidgetPrivate (int version=QObjectPrivateVersion)
 
void raise_sys ()
 
QPaintDeviceredirected (QPoint *offset) const
 
void registerDropSite (bool)
 
void render (QPaintDevice *target, const QPoint &targetOffset, const QRegion &sourceRegion, QWidget::RenderFlags renderFlags, bool readyToRender)
 
void render_helper (QPainter *painter, const QPoint &targetOffset, const QRegion &sourceRegion, QWidget::RenderFlags renderFlags)
 
void repaint_sys (const QRegion &rgn)
 
void reparentFocusWidgets (QWidget *oldtlw)
 
void resolveFont ()
 Determine which font is implicitly imposed on this widget by its ancestors and QApplication::font, resolve this against its own font (attributes from the implicit font are copied over). More...
 
void resolveLayoutDirection ()
 
void resolveLocale ()
 
void resolvePalette ()
 Determine which palette is inherited from this widget's ancestors and QApplication::palette, resolve this against this widget's palette (attributes from the inherited palette are copied over this widget's palette). More...
 
void restoreRedirected ()
 
void scroll_sys (int dx, int dy)
 
void scroll_sys (int dx, int dy, const QRect &r)
 
void scrollChildren (int dx, int dy)
 
void scrollRect (const QRect &, int dx, int dy)
 
void sendPendingMoveAndResizeEvents (bool recursive=false, bool disableUpdates=false)
 
void sendStartupMessage (const char *message) const
 Platform-specific part of QWidget::show(). More...
 
void setConstraints_sys ()
 
void setCursor_sys (const QCursor &cursor)
 
void setDirtyOpaqueRegion ()
 
void setEnabled_helper (bool)
 
void setFocus_sys ()
 
void setFont_helper (const QFont &font)
 
void setGeometry_sys (int, int, int, int, bool)
 
void setLayoutDirection_helper (Qt::LayoutDirection)
 
void setLayoutItemMargins (int left, int top, int right, int bottom)
 
void setLayoutItemMargins (QStyle::SubElement element, const QStyleOption *opt=0)
 
void setLocale_helper (const QLocale &l, bool forceUpdate=false)
 
void setMask_sys (const QRegion &)
 
bool setMaximumSize_helper (int &maxw, int &maxh)
 
bool setMinimumSize_helper (int &minw, int &minh)
 
void setModal_sys ()
 
void setNetWmWindowTypes ()
 
void setOpaque (bool opaque)
 
void setPalette_helper (const QPalette &)
 
void setParent_sys (QWidget *parent, Qt::WindowFlags)
 
void setRedirected (QPaintDevice *replacement, const QPoint &offset)
 
void setSharedPainter (QPainter *painter)
 
void setStyle_helper (QStyle *newStyle, bool propagate, bool metalHack=false)
 
void setUpdatesEnabled_helper (bool)
 
void setWindowFilePath_helper (const QString &filePath)
 
void setWindowIcon_helper ()
 
void setWindowIcon_sys (bool forceReset=false)
 
void setWindowIconText_helper (const QString &cap)
 
void setWindowIconText_sys (const QString &cap)
 
void setWindowOpacity_sys (qreal opacity)
 
void setWindowRole ()
 
void setWindowTitle_helper (const QString &cap)
 
void setWindowTitle_sys (const QString &cap)
 
void setWinId (WId)
 
QPaintersharedPainter () const
 
void show_helper ()
 
void show_recursive ()
 Makes the widget visible in the isVisible() meaning of the word. More...
 
void show_sys ()
 Platform-specific part of QWidget::show(). More...
 
void showChildren (bool spontaneous)
 
void stackUnder_sys (QWidget *)
 
void subtractOpaqueChildren (QRegion &rgn, const QRect &clipRect) const
 
void subtractOpaqueSiblings (QRegion &source, bool *hasDirtySiblingsAbove=0, bool alsoNonOpaque=false) const
 
void syncBackingStore ()
 
void syncBackingStore (const QRegion &region)
 
QTLWExtratopData () const
 
void unsetCursor_sys ()
 
void updateFont (const QFont &)
 Assign font to this widget, and propagate it to all children, except style sheet widgets (handled differently) and windows that don't enable window propagation. More...
 
void updateFrameStrut ()
 Computes the frame rectangle when needed. More...
 
void updateGeometry_helper (bool forceUpdate)
 
void updateIsOpaque ()
 
void updateIsTranslucent ()
 
void updateSystemBackground ()
 
void updateX11AcceptFocus ()
 
void x11UpdateIsOpaque ()
 
 ~QWidgetPrivate ()
 
- Public Functions inherited from QObjectPrivate
void _q_reregisterTimers (void *pointer)
 
void addConnection (int signal, Connection *c)
 
void cleanConnectionLists ()
 
void connectNotify (const char *signal)
 
void deleteChildren ()
 
void disconnectNotify (const char *signal)
 
bool isSender (const QObject *receiver, const char *signal) const
 
bool isSignalConnected (uint signalIdx) const
 Returns true if the signal with index signal_index from object sender is connected. More...
 
void moveToThread_helper ()
 
 QObjectPrivate (int version=QObjectPrivateVersion)
 
QObjectList receiverList (const char *signal) const
 
QObjectList senderList () const
 
void setParent_helper (QObject *)
 
void setThreadData_helper (QThreadData *currentData, QThreadData *targetData)
 
int signalIndex (const char *signalName) const
 Returns the signal index used in the internal connectionLists vector. More...
 
virtual ~QObjectPrivate ()
 
- Public Functions inherited from QObjectData
virtual ~QObjectData ()=0
 

Static Public Functions

static QVariant variantBound (const QVariant &min, const QVariant &value, const QVariant &max)
 
static int variantCompare (const QVariant &arg1, const QVariant &arg2)
 
- Static Public Functions inherited from QWidgetPrivate
static void adjustFlags (Qt::WindowFlags &flags, QWidget *w=0)
 
static QGraphicsProxyWidgetnearestGraphicsProxyWidget (const QWidget *origin)
 Finds the nearest widget embedded in a graphics proxy widget along the chain formed by this widget and its ancestors. More...
 
static int pointToRect (const QPoint &p, const QRect &r)
 
static QRect screenGeometry (const QWidget *widget)
 
- Static Public Functions inherited from QObjectPrivate
static void clearGuards (QObject *)
 
static QObjectPrivateget (QObject *o)
 
static void resetCurrentSender (QObject *receiver, Sender *currentSender, Sender *previousSender)
 
static SendersetCurrentSender (QObject *receiver, Sender *sender)
 
static void signalSignature (const QMetaMethod &signal, QVarLengthArray< char > *result)
 

Public Variables

uint accelerate: 1
 
int acceleration
 
uint buttonState
 
QAbstractSpinBox::ButtonSymbols buttonSymbols
 
QSize cachedMinimumSizeHint
 
QSize cachedSizeHint
 
QValidator::State cachedState
 
QString cachedText
 
QVariant cachedValue
 
uint cleared: 1
 
QAbstractSpinBox::CorrectionMode correctionMode
 
QLineEditedit
 
int effectiveSpinRepeatRate
 
uint frame: 1
 
QStyle::SubControl hoverControl
 
QRect hoverRect
 
uint ignoreCursorPositionChanged: 1
 
uint ignoreUpdateEdit: 1
 
uint keyboardTracking: 1
 
QVariant maximum
 
QVariant minimum
 
uint pendingEmit: 1
 
QString prefix
 
uint readOnly: 1
 
QVariant singleStep
 
QString specialValueText
 
int spinClickThresholdTimerId
 
int spinClickThresholdTimerInterval
 
int spinClickTimerId
 
int spinClickTimerInterval
 
QString suffix
 
QVariant::Type type
 
QSpinBoxValidatorvalidator
 
QVariant value
 
uint wrapping: 1
 
- Public Variables inherited from QWidgetPrivate
QString accessibleDescription
 
QString accessibleName
 
QList< QAction * > actions
 
QPalette::ColorRole bg_role: 8
 
signed char bottomLayoutItemMargin
 
short bottommargin
 
QWidgetData data
 
QRegion dirty
 
uint dirtyOpaqueChildren: 1
 
QWExtraextra
 
QPaintEngineextraPaintEngine
 
QPalette::ColorRole fg_role: 8
 
QWidgetfocus_child
 
QWidgetfocus_next
 
QWidgetfocus_prev
 
QMap< Qt::GestureType, Qt::GestureFlags > gestureContext
 
QGraphicsEffectgraphicsEffect
 
Qt::HANDLE hd
 
uint high_attributes [4]
 
QPointer< QInputContextic
 
Qt::InputMethodHints imHints
 
uint inDirtyList: 1
 
uint inheritedFontResolveMask
 
uint inheritedPaletteResolveMask
 
uint inheritsInputMethodHints: 1
 
uint inSetParent: 1
 
uint isGLWidget: 1
 
uint isMoved: 1
 
uint isOpaque: 1
 
uint isScrolled: 1
 
QLayoutlayout
 
signed char leftLayoutItemMargin
 
short leftmargin
 
QLocale locale
 
QRegionneedsFlush
 
QRegion opaqueChildren
 
Qt::HANDLE picture
 
const QMetaObjectpolished
 
QPaintDeviceredirectDev
 
QPoint redirectOffset
 
signed char rightLayoutItemMargin
 
short rightmargin
 
QSizePolicy size_policy
 
QString statusTip
 
QString toolTip
 
signed char topLayoutItemMargin
 
short topmargin
 
uint usesDoubleBufferedGLContext: 1
 
QString whatsThis
 
QWidgetItemV2widgetItem
 
QX11Info xinfo
 
- Public Variables inherited from QObjectPrivate
union {
   QObject *   currentChildBeingDeleted
 
   QAbstractDeclarativeData *   declarativeData
 
}; 
 
quint32 connectedSignals [2]
 
QObjectConnectionListVectorconnectionLists
 
SendercurrentSender
 
QList< QPointer< QObject > > eventFilters
 
ExtraDataextraData
 
QString objectName
 
Connectionsenders
 
QAtomicPointer< QtSharedPointer::ExternalRefCountData > sharedRefcount
 
QThreadDatathreadData
 
void * unused
 
- Public Variables inherited from QObjectData
uint blockSig: 1
 
QObjectList children
 
uint hasGuards: 1
 
uint inEventHandler: 1
 
uint inThreadChangeEvent: 1
 
uint isWidget: 1
 
QMetaObjectmetaObject
 
uint ownObjectName: 1
 
QObjectparent
 
uint pendTimer: 1
 
int postedEvents
 
QObjectq_ptr
 
uint receiveChildEvents: 1
 
uint sendChildEvents: 1
 
uint unused: 22
 
uint wasDeleted: 1
 

Additional Inherited Members

- Public Types inherited from QWidgetPrivate
enum  CloseMode { CloseNoEvent, CloseWithEvent, CloseWithSpontaneousEvent }
 
enum  Direction { DirectionNorth = 0x01, DirectionEast = 0x10, DirectionSouth = 0x02, DirectionWest = 0x20 }
 
enum  DrawWidgetFlags {
  DrawAsRoot = 0x01, DrawPaintOnScreen = 0x02, DrawRecursive = 0x04, DrawInvisible = 0x08,
  DontSubtractOpaqueChildren = 0x10, DontSetCompositionMode = 0x20, DontDrawOpaqueChildren = 0x40, DontDrawNativeChildren = 0x80
}
 
- Public Types inherited from QObjectPrivate
typedef void(* StaticMetaCallFunction) (QObject *, QMetaObject::Call, int, void **)
 
- Static Public Variables inherited from QWidgetPrivate
static QWidgetSetallWidgets = 0
 
static int instanceCounter = 0
 
static QWidgetkeyboardGrabber = 0
 
static QWidgetMappermapper = 0
 
static int maxInstances = 0
 
static QWidgetmouseGrabber = 0
 

Detailed Description

Definition at line 92 of file qabstractspinbox_p.h.

Constructors and Destructors

◆ QAbstractSpinBoxPrivate()

QAbstractSpinBoxPrivate::QAbstractSpinBoxPrivate ( )
Warning
This function is not part of the public interface. Constructs a QAbstractSpinBoxPrivate object

Definition at line 1405 of file qabstractspinbox.cpp.

1409  cachedState(QValidator::Invalid), pendingEmit(false), readOnly(false), wrapping(false),
1410  ignoreCursorPositionChanged(false), frame(true), accelerate(false), keyboardTracking(true),
1413 {
1414 }
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
QStyle::SubControl hoverControl
QValidator::State cachedState
QAbstractSpinBox::ButtonSymbols buttonSymbols
QSpinBoxValidator * validator
#define None
QAbstractSpinBox::CorrectionMode correctionMode

◆ ~QAbstractSpinBoxPrivate()

QAbstractSpinBoxPrivate::~QAbstractSpinBoxPrivate ( )

Definition at line 1420 of file qabstractspinbox.cpp.

1421 {
1422 }

Functions

◆ _q_editorCursorPositionChanged()

void QAbstractSpinBoxPrivate::_q_editorCursorPositionChanged ( int  oldpos,
int  newpos 
)
virtual

Virtual slot connected to the line edit's cursorPositionChanged(int, int) signal.

Warning
This function is not part of the public interface.

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 1576 of file qabstractspinbox.cpp.

1577 {
1580 
1581  bool allowSelection = true;
1582  int pos = -1;
1583  if (newpos < prefix.size() && newpos != 0) {
1584  if (oldpos == 0) {
1585  allowSelection = false;
1586  pos = prefix.size();
1587  } else {
1588  pos = oldpos;
1589  }
1590  } else if (newpos > edit->text().size() - suffix.size()
1591  && newpos != edit->text().size()) {
1592  if (oldpos == edit->text().size()) {
1593  pos = edit->text().size() - suffix.size();
1594  allowSelection = false;
1595  } else {
1596  pos = edit->text().size();
1597  }
1598  }
1599  if (pos != -1) {
1600  const int selSize = edit->selectionStart() >= 0 && allowSelection
1601  ? (edit->selectedText().size()
1602  * (newpos < pos ? -1 : 1)) - newpos + pos
1603  : 0;
1604 
1605  const bool wasBlocked = edit->blockSignals(true);
1606  if (selSize != 0) {
1607  edit->setSelection(pos - selSize, selSize);
1608  } else {
1609  edit->setCursorPosition(pos);
1610  }
1611  edit->blockSignals(wasBlocked);
1612  }
1614  }
1615 }
int selectionStart() const
selectionStart() returns the index of the first selected character in the line edit or -1 if no text ...
Definition: qlineedit.cpp:1039
bool blockSignals(bool b)
If block is true, signals emitted by this object are blocked (i.e., emitting a signal will not invoke...
Definition: qobject.cpp:1406
int size() const
Returns the number of characters in this string.
Definition: qstring.h:102
QString text
the line edit&#39;s text
Definition: qlineedit.h:72
void setSelection(int, int)
Selects text from position start and for length characters.
Definition: qlineedit.cpp:1106
QString selectedText
the selected text
Definition: qlineedit.h:81
bool hasSelectedText
whether there is any text selected
Definition: qlineedit.h:80
void setCursorPosition(int)
Definition: qlineedit.cpp:758
bool specialValue() const
Returns true if a specialValueText has been set and the current value is minimum. ...

◆ _q_editorTextChanged()

void QAbstractSpinBoxPrivate::_q_editorTextChanged ( const QString t)

Slot connected to the line edit's textChanged(const QString &) signal.

Warning
This function is not part of the public interface.

Definition at line 1543 of file qabstractspinbox.cpp.

1544 {
1546 
1547  if (keyboardTracking) {
1548  QString tmp = t;
1549  int pos = edit->cursorPosition();
1550  QValidator::State state = q->validate(tmp, pos);
1551  if (state == QValidator::Acceptable) {
1552  const QVariant v = valueFromText(tmp);
1553  setValue(v, EmitIfChanged, tmp != t);
1554  pendingEmit = false;
1555  } else {
1556  pendingEmit = true;
1557  }
1558  } else {
1559  pendingEmit = true;
1560  }
1561 }
The QVariant class acts like a union for the most common Qt data types.
Definition: qvariant.h:92
virtual QVariant valueFromText(const QString &input) const
Virtual method called that calls the public valueFromText() functions in the subclasses.
The QString class provides a Unicode character string.
Definition: qstring.h:83
#define Q_Q(Class)
Definition: qglobal.h:2483
The QAbstractSpinBox class provides a spinbox and a line edit to display values.
State
This enum type defines the states in which a validated string can exist.
Definition: qvalidator.h:67
void setValue(const QVariant &val, EmitPolicy ep, bool updateEdit=true)
Sets the value of the spin box to val.
int cursorPosition
the current cursor position for this line edit
Definition: qlineedit.h:77

◆ bound()

QVariant QAbstractSpinBoxPrivate::bound ( const QVariant val,
const QVariant old = QVariant(),
int  steps = 0 
) const
virtual

Bounds val to be within minimum and maximum.

Warning
This function is not part of the public interface.

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 1751 of file qabstractspinbox.cpp.

Referenced by setRange(), setValue(), and QDateTimeEditPrivate::stepBy().

1752 {
1753  QVariant v = val;
1754  if (!wrapping || steps == 0 || old.isNull()) {
1755  if (variantCompare(v, minimum) < 0) {
1756  v = wrapping ? maximum : minimum;
1757  }
1758  if (variantCompare(v, maximum) > 0) {
1759  v = wrapping ? minimum : maximum;
1760  }
1761  } else {
1762  const bool wasMin = old == minimum;
1763  const bool wasMax = old == maximum;
1764  const int oldcmp = variantCompare(v, old);
1765  const int maxcmp = variantCompare(v, maximum);
1766  const int mincmp = variantCompare(v, minimum);
1767  const bool wrapped = (oldcmp > 0 && steps < 0) || (oldcmp < 0 && steps > 0);
1768  if (maxcmp > 0) {
1769  v = ((wasMax && !wrapped && steps > 0) || (steps < 0 && !wasMin && wrapped))
1770  ? minimum : maximum;
1771  } else if (wrapped && (maxcmp > 0 || mincmp < 0)) {
1772  v = ((wasMax && steps > 0) || (!wasMin && steps < 0)) ? minimum : maximum;
1773  } else if (mincmp < 0) {
1774  v = (!wasMax && !wasMin ? minimum : maximum);
1775  }
1776  }
1777 
1778  return v;
1779 }
The QVariant class acts like a union for the most common Qt data types.
Definition: qvariant.h:92
bool isNull() const
Returns true if this is a NULL variant, false otherwise.
Definition: qvariant.cpp:3102
static int variantCompare(const QVariant &arg1, const QVariant &arg2)

◆ clearCache()

void QAbstractSpinBoxPrivate::clearCache ( ) const
virtual

Reimplemented in QDateTimeEditPrivate.

Definition at line 1976 of file qabstractspinbox.cpp.

Referenced by QDateTimeEditPrivate::clearCache(), interpret(), and setRange().

1977 {
1978  cachedText.clear();
1979  cachedValue.clear();
1981 }
QValidator::State cachedState
void clear()
Convert this variant to type Invalid and free up any resources used.
Definition: qvariant.cpp:1993
void clear()
Clears the contents of the string and makes it empty.
Definition: qstring.h:723

◆ emitSignals()

void QAbstractSpinBoxPrivate::emitSignals ( EmitPolicy  ep,
const QVariant old 
)
virtual
Warning
This function is not part of the public interface. Virtual function that emits signals when the value changes. Reimplemented in the different subclasses.

Reimplemented in QDoubleSpinBoxPrivate, QDateTimeEditPrivate, and QSpinBoxPrivate.

Definition at line 1529 of file qabstractspinbox.cpp.

Referenced by setValue().

1530 {
1531 }

◆ getZeroVariant()

QVariant QAbstractSpinBoxPrivate::getZeroVariant ( ) const
virtual

Convenience function to get a variant of the right type.

Warning
This function is not part of the public interface.

Reimplemented in QDateTimeEditPrivate.

Definition at line 1883 of file qabstractspinbox.cpp.

Referenced by interpret().

1884 {
1885  QVariant ret;
1886  switch (type) {
1887  case QVariant::Int: ret = QVariant((int)0); break;
1888  case QVariant::Double: ret = QVariant((double)0.0); break;
1889  default: break;
1890  }
1891  return ret;
1892 }
The QVariant class acts like a union for the most common Qt data types.
Definition: qvariant.h:92

◆ init()

void QAbstractSpinBoxPrivate::init ( )

Initialises the QAbstractSpinBoxPrivate object.

Warning
This function is not part of the public interface.

Definition at line 1626 of file qabstractspinbox.cpp.

1627 {
1629 
1630  q->setLineEdit(new QLineEdit(q));
1631  edit->setObjectName(QLatin1String("qt_spinbox_lineedit"));
1632  validator = new QSpinBoxValidator(q, this);
1634 
1635  QStyleOptionSpinBox opt;
1636  q->initStyleOption(&opt);
1637  spinClickTimerInterval = q->style()->styleHint(QStyle::SH_SpinBox_ClickAutoRepeatRate, &opt, q);
1639  q->setFocusPolicy(Qt::WheelFocus);
1641  q->setAttribute(Qt::WA_InputMethodEnabled);
1642 
1643  q->setAttribute(Qt::WA_MacShowFocusRect);
1644 }
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
void setObjectName(const QString &name)
Definition: qobject.cpp:1112
#define Q_Q(Class)
Definition: qglobal.h:2483
The QStyleOptionSpinBox class is used to describe the parameters necessary for drawing a spin box...
Definition: qstyleoption.h:729
void setValidator(const QValidator *)
Sets this line edit to only accept input that the validator, v, will accept.
Definition: qlineedit.cpp:627
The QAbstractSpinBox class provides a spinbox and a line edit to display values.
QSpinBoxValidator * validator
The QLineEdit widget is a one-line text editor.
Definition: qlineedit.h:66

◆ interpret()

void QAbstractSpinBoxPrivate::interpret ( EmitPolicy  ep)
virtual

Interprets text and emits signals.

Warning
This function is not part of the public interface.

Called when the spinbox needs to interpret the text on the lineedit.

Reimplemented in QDateTimeEditPrivate.

Definition at line 1941 of file qabstractspinbox.cpp.

Referenced by QDateTimeEditPrivate::interpret().

1942 {
1944  if (type == QVariant::Invalid || cleared)
1945  return;
1946 
1947  QVariant v = getZeroVariant();
1948  bool doInterpret = true;
1949  QString tmp = edit->displayText();
1950  int pos = edit->cursorPosition();
1951  const int oldpos = pos;
1952 
1953  if (q->validate(tmp, pos) != QValidator::Acceptable) {
1954  const QString copy = tmp;
1955  q->fixup(tmp);
1956  QASBDEBUG() << "QAbstractSpinBoxPrivate::interpret() text '"
1957  << edit->displayText()
1958  << "' >> '" << copy << '\''
1959  << "' >> '" << tmp << '\'';
1960 
1961  doInterpret = tmp != copy && (q->validate(tmp, pos) == QValidator::Acceptable);
1962  if (!doInterpret) {
1964  ? variantBound(minimum, v, maximum) : value);
1965  }
1966  }
1967  if (doInterpret) {
1968  v = valueFromText(tmp);
1969  }
1970  clearCache();
1971  setValue(v, ep, true);
1972  if (oldpos != pos)
1973  edit->setCursorPosition(pos);
1974 }
The QVariant class acts like a union for the most common Qt data types.
Definition: qvariant.h:92
virtual QVariant valueFromText(const QString &input) const
Virtual method called that calls the public valueFromText() functions in the subclasses.
The QString class provides a Unicode character string.
Definition: qstring.h:83
#define Q_Q(Class)
Definition: qglobal.h:2483
static QVariant variantBound(const QVariant &min, const QVariant &value, const QVariant &max)
The QAbstractSpinBox class provides a spinbox and a line edit to display values.
#define QASBDEBUG
QAbstractSpinBox::CorrectionMode correctionMode
virtual void clearCache() const
void setValue(const QVariant &val, EmitPolicy ep, bool updateEdit=true)
Sets the value of the spin box to val.
virtual QVariant getZeroVariant() const
Convenience function to get a variant of the right type.
void setCursorPosition(int)
Definition: qlineedit.cpp:758
QString displayText
the displayed text
Definition: qlineedit.h:76
int cursorPosition
the current cursor position for this line edit
Definition: qlineedit.h:77

◆ newHoverControl()

QStyle::SubControl QAbstractSpinBoxPrivate::newHoverControl ( const QPoint pos)
virtual

Returns the hover control at pos.

Warning
This function is not part of the public interface.

This will update the hoverRect and hoverControl.

Reimplemented in QDateTimeEditPrivate.

Definition at line 1454 of file qabstractspinbox.cpp.

Referenced by QDateTimeEditPrivate::newHoverControl(), and updateHoverControl().

1455 {
1457 
1458  QStyleOptionSpinBox opt;
1459  q->initStyleOption(&opt);
1461  hoverControl = q->style()->hitTestComplexControl(QStyle::CC_SpinBox, &opt, pos, q);
1462  hoverRect = q->style()->subControlRect(QStyle::CC_SpinBox, &opt, hoverControl, q);
1463  return hoverControl;
1464 }
#define Q_Q(Class)
Definition: qglobal.h:2483
QStyle::SubControl hoverControl
The QStyleOptionSpinBox class is used to describe the parameters necessary for drawing a spin box...
Definition: qstyleoption.h:729
The QAbstractSpinBox class provides a spinbox and a line edit to display values.
QStyle::SubControls subControls
This variable holds a bitwise OR of the sub-controls to be drawn for the complex control.
Definition: qstyleoption.h:693

◆ reset()

void QAbstractSpinBoxPrivate::reset ( )

Resets the state of the spinbox.

Warning
This function is not part of the public interface.

E.g. the state is set to (Keyboard|Up) if Key up is currently pressed.

Definition at line 1656 of file qabstractspinbox.cpp.

Referenced by setRange(), and updateState().

1657 {
1659 
1660  buttonState = None;
1661  if (q) {
1662  if (spinClickTimerId != -1)
1663  q->killTimer(spinClickTimerId);
1664  if (spinClickThresholdTimerId != -1)
1665  q->killTimer(spinClickThresholdTimerId);
1667  acceleration = 0;
1668  q->update();
1669  }
1670 }
#define Q_Q(Class)
Definition: qglobal.h:2483
The QAbstractSpinBox class provides a spinbox and a line edit to display values.
#define None

◆ setRange()

void QAbstractSpinBoxPrivate::setRange ( const QVariant min,
const QVariant max 
)
virtual

Convenience function to set min/max values.

Warning
This function is not part of the public interface.

Reimplemented in QDateTimeEditPrivate.

Definition at line 1855 of file qabstractspinbox.cpp.

Referenced by QDateTimeEditPrivate::setRange().

1856 {
1858 
1859  clearCache();
1860  minimum = min;
1861  maximum = (variantCompare(min, max) < 0 ? max : min);
1862  cachedSizeHint = QSize(); // minimumSizeHint doesn't care about min/max
1863 
1864  reset();
1865  if (!(bound(value) == value)) {
1867  } else if (value == minimum && !specialValueText.isEmpty()) {
1868  updateEdit();
1869  }
1870 
1871  q->updateGeometry();
1872 }
static int variantCompare(const QVariant &arg1, const QVariant &arg2)
#define Q_Q(Class)
Definition: qglobal.h:2483
void reset()
Resets the state of the spinbox.
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
Definition: qstring.h:704
The QAbstractSpinBox class provides a spinbox and a line edit to display values.
virtual void updateEdit()
Updates the line edit to reflect the current value of the spin box.
virtual QVariant bound(const QVariant &val, const QVariant &old=QVariant(), int steps=0) const
Bounds val to be within minimum and maximum.
virtual void clearCache() const
void setValue(const QVariant &val, EmitPolicy ep, bool updateEdit=true)
Sets the value of the spin box to val.
The QSize class defines the size of a two-dimensional object using integer point precision.
Definition: qsize.h:53

◆ setValue()

void QAbstractSpinBoxPrivate::setValue ( const QVariant val,
EmitPolicy  ep,
bool  doUpdate = true 
)

Sets the value of the spin box to val.

Warning
This function is not part of the public interface.

Depending on the value of ep it will also emit signals.

Definition at line 1791 of file qabstractspinbox.cpp.

Referenced by _q_editorTextChanged(), QDateTimeEditPrivate::interpret(), interpret(), and setRange().

1793 {
1795  const QVariant old = value;
1796  value = bound(val);
1797  pendingEmit = false;
1798  cleared = false;
1799  if (doUpdate) {
1800  updateEdit();
1801  }
1802  q->update();
1803 
1804  if (ep == AlwaysEmit || (ep == EmitIfChanged && old != value)) {
1805  emitSignals(ep, old);
1806  }
1807 }
The QVariant class acts like a union for the most common Qt data types.
Definition: qvariant.h:92
#define Q_Q(Class)
Definition: qglobal.h:2483
The QAbstractSpinBox class provides a spinbox and a line edit to display values.
virtual void updateEdit()
Updates the line edit to reflect the current value of the spin box.
virtual void emitSignals(EmitPolicy ep, const QVariant &old)
virtual QVariant bound(const QVariant &val, const QVariant &old=QVariant(), int steps=0) const
Bounds val to be within minimum and maximum.

◆ specialValue()

bool QAbstractSpinBoxPrivate::specialValue ( ) const

Returns true if a specialValueText has been set and the current value is minimum.

Warning
This function is not part of the public interface.

Definition at line 1519 of file qabstractspinbox.cpp.

Referenced by QDateTimeEditPrivate::_q_editorCursorPositionChanged(), _q_editorCursorPositionChanged(), QDateTimeEditPrivate::setSelected(), QDateTimeEditPrivate::updateEdit(), and updateEdit().

1520 {
1521  return (value == minimum && !specialValueText.isEmpty());
1522 }
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
Definition: qstring.h:704

◆ stripped()

QString QAbstractSpinBoxPrivate::stripped ( const QString t,
int *  pos = 0 
) const

Strips any prefix/suffix from text.

Warning
This function is not part of the public interface.

Definition at line 1474 of file qabstractspinbox.cpp.

1475 {
1476  QString text = t;
1477  if (specialValueText.size() == 0 || text != specialValueText) {
1478  int from = 0;
1479  int size = text.size();
1480  bool changed = false;
1481  if (prefix.size() && text.startsWith(prefix)) {
1482  from += prefix.size();
1483  size -= from;
1484  changed = true;
1485  }
1486  if (suffix.size() && text.endsWith(suffix)) {
1487  size -= suffix.size();
1488  changed = true;
1489  }
1490  if (changed)
1491  text = text.mid(from, size);
1492  }
1493 
1494  const int s = text.size();
1495  text = text.trimmed();
1496  if (pos)
1497  (*pos) -= (s - text.size());
1498  return text;
1499 
1500 }
bool startsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string starts with s; otherwise returns false.
Definition: qstring.cpp:3734
The QString class provides a Unicode character string.
Definition: qstring.h:83
QString trimmed() const Q_REQUIRED_RESULT
Returns a string that has whitespace removed from the start and the end.
Definition: qstring.cpp:4506
int size() const
Returns the number of characters in this string.
Definition: qstring.h:102
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...
Definition: qstring.cpp:3706
bool endsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string ends with s; otherwise returns false.
Definition: qstring.cpp:3796
#define text
Definition: qobjectdefs.h:80

◆ textFromValue()

QString QAbstractSpinBoxPrivate::textFromValue ( const QVariant n) const
virtual

Virtual method called that calls the public textFromValue() functions in the subclasses.

Warning
This function is not part of the public interface.

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 QDoubleSpinBoxPrivate, QDateTimeEditPrivate, and QSpinBoxPrivate.

Definition at line 1908 of file qabstractspinbox.cpp.

Referenced by updateEdit().

1909 {
1910  return QString();
1911 }
The QString class provides a Unicode character string.
Definition: qstring.h:83

◆ updateEdit()

void QAbstractSpinBoxPrivate::updateEdit ( )
virtual

Updates the line edit to reflect the current value of the spin box.

Warning
This function is not part of the public interface.

Reimplemented in QDateTimeEditPrivate.

Definition at line 1818 of file qabstractspinbox.cpp.

Referenced by setRange(), and setValue().

1819 {
1821  if (type == QVariant::Invalid)
1822  return;
1824  if (newText == edit->displayText() || cleared)
1825  return;
1826 
1827  const bool empty = edit->text().isEmpty();
1828  int cursor = edit->cursorPosition();
1829  int selsize = edit->selectedText().size();
1830  const bool sb = edit->blockSignals(true);
1831  edit->setText(newText);
1832 
1833  if (!specialValue()) {
1834  cursor = qBound(prefix.size(), cursor, edit->displayText().size() - suffix.size());
1835 
1836  if (selsize > 0) {
1837  edit->setSelection(cursor, selsize);
1838  } else {
1839  edit->setCursorPosition(empty ? prefix.size() : cursor);
1840  }
1841  }
1842  edit->blockSignals(sb);
1843  q->update();
1844 }
bool blockSignals(bool b)
If block is true, signals emitted by this object are blocked (i.e., emitting a signal will not invoke...
Definition: qobject.cpp:1406
virtual QString textFromValue(const QVariant &n) const
Virtual method called that calls the public textFromValue() functions in the subclasses.
The QString class provides a Unicode character string.
Definition: qstring.h:83
#define Q_Q(Class)
Definition: qglobal.h:2483
int size() const
Returns the number of characters in this string.
Definition: qstring.h:102
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
Definition: qstring.h:704
QString text
the line edit&#39;s text
Definition: qlineedit.h:72
void setSelection(int, int)
Selects text from position start and for length characters.
Definition: qlineedit.cpp:1106
The QAbstractSpinBox class provides a spinbox and a line edit to display values.
void setText(const QString &)
Definition: qlineedit.cpp:401
QString selectedText
the selected text
Definition: qlineedit.h:81
Q_DECL_CONSTEXPR const T & qBound(const T &min, const T &val, const T &max)
Definition: qglobal.h:1219
void setCursorPosition(int)
Definition: qlineedit.cpp:758
bool specialValue() const
Returns true if a specialValueText has been set and the current value is minimum. ...
QString displayText
the displayed text
Definition: qlineedit.h:76
int cursorPosition
the current cursor position for this line edit
Definition: qlineedit.h:77

◆ updateEditFieldGeometry()

void QAbstractSpinBoxPrivate::updateEditFieldGeometry ( )
virtual

Reimplemented in QDateTimeEditPrivate.

Definition at line 1502 of file qabstractspinbox.cpp.

Referenced by QDateTimeEditPrivate::updateEditFieldGeometry().

1503 {
1505  QStyleOptionSpinBox opt;
1506  q->initStyleOption(&opt);
1508  edit->setGeometry(q->style()->subControlRect(QStyle::CC_SpinBox, &opt,
1510 }
void setGeometry(int x, int y, int w, int h)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: qwidget.h:1017
#define Q_Q(Class)
Definition: qglobal.h:2483
The QStyleOptionSpinBox class is used to describe the parameters necessary for drawing a spin box...
Definition: qstyleoption.h:729
The QAbstractSpinBox class provides a spinbox and a line edit to display values.
QStyle::SubControls subControls
This variable holds a bitwise OR of the sub-controls to be drawn for the complex control.
Definition: qstyleoption.h:693

◆ updateHoverControl()

bool QAbstractSpinBoxPrivate::updateHoverControl ( const QPoint pos)

Updates the old and new hover control.

Warning
This function is not part of the public interface. Does nothing if the hover control has not changed.

Definition at line 1432 of file qabstractspinbox.cpp.

1433 {
1435  QRect lastHoverRect = hoverRect;
1436  QStyle::SubControl lastHoverControl = hoverControl;
1437  bool doesHover = q->testAttribute(Qt::WA_Hover);
1438  if (lastHoverControl != newHoverControl(pos) && doesHover) {
1439  q->update(lastHoverRect);
1440  q->update(hoverRect);
1441  return true;
1442  }
1443  return !doesHover;
1444 }
virtual QStyle::SubControl newHoverControl(const QPoint &pos)
Returns the hover control at pos.
SubControl
This enum describes the available sub controls.
Definition: qstyle.h:402
#define Q_Q(Class)
Definition: qglobal.h:2483
QStyle::SubControl hoverControl
The QAbstractSpinBox class provides a spinbox and a line edit to display values.
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58

◆ updateState()

void QAbstractSpinBoxPrivate::updateState ( bool  up,
bool  fromKeyboard = false 
)

Updates the state of the spinbox.

Warning
This function is not part of the public interface.

Definition at line 1681 of file qabstractspinbox.cpp.

1682 {
1684  if ((up && (buttonState & Up)) || (!up && (buttonState & Down)))
1685  return;
1686  reset();
1687  if (q && (q->stepEnabled() & (up ? QAbstractSpinBox::StepUpEnabled
1690  buttonState = (up ? Up : Down) | (fromKeyboard ? Keyboard : Mouse);
1691  q->stepBy(up ? 1 : -1);
1692 #ifndef QT_NO_ACCESSIBILITY
1694 #endif
1695  }
1696 }
static void updateAccessibility(QObject *, int who, Event reason)
Notifies accessibility clients about a change in object&#39;s accessibility information.
#define Q_Q(Class)
Definition: qglobal.h:2483
void reset()
Resets the state of the spinbox.
The QAbstractSpinBox class provides a spinbox and a line edit to display values.

◆ valueFromText()

QVariant QAbstractSpinBoxPrivate::valueFromText ( const QString input) const
virtual

Virtual method called that calls the public valueFromText() functions in the subclasses.

Warning
This function is not part of the public interface.

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 QDoubleSpinBoxPrivate, QDateTimeEditPrivate, and QSpinBoxPrivate.

Definition at line 1927 of file qabstractspinbox.cpp.

Referenced by _q_editorTextChanged(), and interpret().

1928 {
1929  return QVariant();
1930 }
The QVariant class acts like a union for the most common Qt data types.
Definition: qvariant.h:92

◆ variantBound()

QVariant QAbstractSpinBoxPrivate::variantBound ( const QVariant min,
const QVariant value,
const QVariant max 
)
static

Definition at line 2223 of file qabstractspinbox.cpp.

Referenced by interpret().

2226 {
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);
2231  } else {
2232  return min;
2233  }
2234 }
static int variantCompare(const QVariant &arg1, const QVariant &arg2)
#define Q_ASSERT(cond)
Definition: qglobal.h:1823

◆ variantCompare()

int QAbstractSpinBoxPrivate::variantCompare ( const QVariant arg1,
const QVariant arg2 
)
static

Definition at line 2160 of file qabstractspinbox.cpp.

Referenced by bound(), and setRange().

2161 {
2162  switch (arg2.type()) {
2163  case QVariant::Date:
2164  Q_ASSERT_X(arg1.type() == QVariant::Date, "QAbstractSpinBoxPrivate::variantCompare",
2165  qPrintable(QString::fromAscii("Internal error 1 (%1)").
2166  arg(QString::fromAscii(arg1.typeName()))));
2167  if (arg1.toDate() == arg2.toDate()) {
2168  return 0;
2169  } else if (arg1.toDate() < arg2.toDate()) {
2170  return -1;
2171  } else {
2172  return 1;
2173  }
2174  case QVariant::Time:
2175  Q_ASSERT_X(arg1.type() == QVariant::Time, "QAbstractSpinBoxPrivate::variantCompare",
2176  qPrintable(QString::fromAscii("Internal error 2 (%1)").
2177  arg(QString::fromAscii(arg1.typeName()))));
2178  if (arg1.toTime() == arg2.toTime()) {
2179  return 0;
2180  } else if (arg1.toTime() < arg2.toTime()) {
2181  return -1;
2182  } else {
2183  return 1;
2184  }
2185 
2186 
2187  case QVariant::DateTime:
2188  if (arg1.toDateTime() == arg2.toDateTime()) {
2189  return 0;
2190  } else if (arg1.toDateTime() < arg2.toDateTime()) {
2191  return -1;
2192  } else {
2193  return 1;
2194  }
2195  case QVariant::Int:
2196  if (arg1.toInt() == arg2.toInt()) {
2197  return 0;
2198  } else if (arg1.toInt() < arg2.toInt()) {
2199  return -1;
2200  } else {
2201  return 1;
2202  }
2203  case QVariant::Double:
2204  if (arg1.toDouble() == arg2.toDouble()) {
2205  return 0;
2206  } else if (arg1.toDouble() < arg2.toDouble()) {
2207  return -1;
2208  } else {
2209  return 1;
2210  }
2211  case QVariant::Invalid:
2212  if (arg2.type() == QVariant::Invalid)
2213  return 0;
2214  default:
2215  Q_ASSERT_X(0, "QAbstractSpinBoxPrivate::variantCompare",
2216  qPrintable(QString::fromAscii("Internal error 3 (%1 %2)").
2217  arg(QString::fromAscii(arg1.typeName())).
2218  arg(QString::fromAscii(arg2.typeName()))));
2219  }
2220  return -2;
2221 }
static QString fromAscii(const char *, int size=-1)
Returns a QString initialized with the first size characters from the string str. ...
Definition: qstring.cpp:4276
QDateTime toDateTime() const
Returns the variant as a QDateTime if the variant has type() DateTime , Date , or String ; otherwise ...
Definition: qvariant.cpp:2349
int toInt(bool *ok=0) const
Returns the variant as an int if the variant has type() Int , Bool , ByteArray , Char ...
Definition: qvariant.cpp:2625
const char * typeName() const
Returns the name of the type stored in the variant.
Definition: qvariant.cpp:1984
QDate toDate() const
Returns the variant as a QDate if the variant has type() Date , DateTime , or String ; otherwise retu...
Definition: qvariant.cpp:2311
#define Q_ASSERT_X(cond, where, what)
Definition: qglobal.h:1837
Type type() const
Returns the storage type of the value stored in the variant.
Definition: qvariant.cpp:1901
double toDouble(bool *ok=0) const
Returns the variant as a double if the variant has type() Double , QMetaType::Float ...
Definition: qvariant.cpp:2710
QTime toTime() const
Returns the variant as a QTime if the variant has type() Time , DateTime , or String ; otherwise retu...
Definition: qvariant.cpp:2330
#define qPrintable(string)
Definition: qglobal.h:1750

Properties

◆ accelerate

uint QAbstractSpinBoxPrivate::accelerate

Definition at line 143 of file qabstractspinbox_p.h.

◆ acceleration

int QAbstractSpinBoxPrivate::acceleration

Definition at line 148 of file qabstractspinbox_p.h.

Referenced by reset().

◆ buttonState

uint QAbstractSpinBoxPrivate::buttonState

Definition at line 133 of file qabstractspinbox_p.h.

Referenced by reset(), QDateTimeEditPrivate::updateArrow(), and updateState().

◆ buttonSymbols

QAbstractSpinBox::ButtonSymbols QAbstractSpinBoxPrivate::buttonSymbols

Definition at line 151 of file qabstractspinbox_p.h.

◆ cachedMinimumSizeHint

QSize QAbstractSpinBoxPrivate::cachedMinimumSizeHint
mutable

Definition at line 137 of file qabstractspinbox_p.h.

◆ cachedSizeHint

QSize QAbstractSpinBoxPrivate::cachedSizeHint
mutable

Definition at line 137 of file qabstractspinbox_p.h.

Referenced by setRange().

◆ cachedState

QValidator::State QAbstractSpinBoxPrivate::cachedState
mutable

Definition at line 136 of file qabstractspinbox_p.h.

Referenced by clearCache(), and QDateTimeEditPrivate::validateAndInterpret().

◆ cachedText

QString QAbstractSpinBoxPrivate::cachedText
mutable

◆ cachedValue

QVariant QAbstractSpinBoxPrivate::cachedValue
mutable

◆ cleared

uint QAbstractSpinBoxPrivate::cleared

Definition at line 145 of file qabstractspinbox_p.h.

Referenced by interpret(), setValue(), and updateEdit().

◆ correctionMode

QAbstractSpinBox::CorrectionMode QAbstractSpinBoxPrivate::correctionMode

Definition at line 147 of file qabstractspinbox_p.h.

Referenced by QDateTimeEditPrivate::interpret(), and interpret().

◆ edit

QLineEdit* QAbstractSpinBoxPrivate::edit

◆ effectiveSpinRepeatRate

int QAbstractSpinBoxPrivate::effectiveSpinRepeatRate

Definition at line 132 of file qabstractspinbox_p.h.

◆ frame

uint QAbstractSpinBoxPrivate::frame

Definition at line 142 of file qabstractspinbox_p.h.

◆ hoverControl

QStyle::SubControl QAbstractSpinBoxPrivate::hoverControl

◆ hoverRect

QRect QAbstractSpinBoxPrivate::hoverRect

Definition at line 150 of file qabstractspinbox_p.h.

Referenced by newHoverControl(), and updateHoverControl().

◆ ignoreCursorPositionChanged

uint QAbstractSpinBoxPrivate::ignoreCursorPositionChanged

◆ ignoreUpdateEdit

uint QAbstractSpinBoxPrivate::ignoreUpdateEdit

Definition at line 146 of file qabstractspinbox_p.h.

◆ keyboardTracking

uint QAbstractSpinBoxPrivate::keyboardTracking

Definition at line 144 of file qabstractspinbox_p.h.

Referenced by _q_editorTextChanged().

◆ maximum

QVariant QAbstractSpinBoxPrivate::maximum

◆ minimum

QVariant QAbstractSpinBoxPrivate::minimum

◆ pendingEmit

uint QAbstractSpinBoxPrivate::pendingEmit

◆ prefix

QString QAbstractSpinBoxPrivate::prefix

◆ readOnly

uint QAbstractSpinBoxPrivate::readOnly

Definition at line 139 of file qabstractspinbox_p.h.

◆ singleStep

QVariant QAbstractSpinBoxPrivate::singleStep

Definition at line 129 of file qabstractspinbox_p.h.

◆ specialValueText

QString QAbstractSpinBoxPrivate::specialValueText

◆ spinClickThresholdTimerId

int QAbstractSpinBoxPrivate::spinClickThresholdTimerId

Definition at line 131 of file qabstractspinbox_p.h.

Referenced by reset(), and updateState().

◆ spinClickThresholdTimerInterval

int QAbstractSpinBoxPrivate::spinClickThresholdTimerInterval

Definition at line 131 of file qabstractspinbox_p.h.

Referenced by init(), and updateState().

◆ spinClickTimerId

int QAbstractSpinBoxPrivate::spinClickTimerId

Definition at line 131 of file qabstractspinbox_p.h.

Referenced by reset().

◆ spinClickTimerInterval

int QAbstractSpinBoxPrivate::spinClickTimerInterval

Definition at line 131 of file qabstractspinbox_p.h.

Referenced by init().

◆ suffix

QString QAbstractSpinBoxPrivate::suffix

◆ type

QVariant::Type QAbstractSpinBoxPrivate::type

◆ validator

QSpinBoxValidator* QAbstractSpinBoxPrivate::validator

Definition at line 152 of file qabstractspinbox_p.h.

Referenced by init().

◆ value

QVariant QAbstractSpinBoxPrivate::value

◆ wrapping

uint QAbstractSpinBoxPrivate::wrapping

Definition at line 140 of file qabstractspinbox_p.h.

Referenced by bound(), and QDateTimeEditPrivate::stepBy().


The documentation for this class was generated from the following files: