Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qspinbox.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5#ifndef QSPINBOX_H
6#define QSPINBOX_H
7
8#include <QtWidgets/qtwidgetsglobal.h>
9#include <QtWidgets/qabstractspinbox.h>
10
12
13QT_BEGIN_NAMESPACE
14
15class QSpinBoxPrivate;
16class Q_WIDGETS_EXPORT QSpinBox : public QAbstractSpinBox
17{
18 Q_OBJECT
19
20 Q_PROPERTY(QString suffix READ suffix WRITE setSuffix)
21 Q_PROPERTY(QString prefix READ prefix WRITE setPrefix)
22 Q_PROPERTY(QString cleanText READ cleanText)
23 Q_PROPERTY(int minimum READ minimum WRITE setMinimum)
24 Q_PROPERTY(int maximum READ maximum WRITE setMaximum)
25 Q_PROPERTY(int singleStep READ singleStep WRITE setSingleStep)
26 Q_PROPERTY(StepType stepType READ stepType WRITE setStepType)
27 Q_PROPERTY(int value READ value WRITE setValue NOTIFY valueChanged USER true)
28 Q_PROPERTY(int displayIntegerBase READ displayIntegerBase WRITE setDisplayIntegerBase)
29
30public:
31 explicit QSpinBox(QWidget *parent = nullptr);
32 ~QSpinBox();
33
34 int value() const;
35
36 QString prefix() const;
37 void setPrefix(const QString &prefix);
38
39 QString suffix() const;
40 void setSuffix(const QString &suffix);
41
42 QString cleanText() const;
43
44 int singleStep() const;
45 void setSingleStep(int val);
46
47 int minimum() const;
48 void setMinimum(int min);
49
50 int maximum() const;
51 void setMaximum(int max);
52
53 void setRange(int min, int max);
54
55 StepType stepType() const;
56 void setStepType(StepType stepType);
57
58 int displayIntegerBase() const;
59 void setDisplayIntegerBase(int base);
60
61protected:
62 bool event(QEvent *event) override;
63 QValidator::State validate(QString &input, int &pos) const override;
64 virtual int valueFromText(const QString &text) const;
65 virtual QString textFromValue(int val) const;
66 void fixup(QString &str) const override;
67
68
69public Q_SLOTS:
70 void setValue(int val);
71
72Q_SIGNALS:
73 void valueChanged(int);
74 void textChanged(const QString &);
75
76private:
77 Q_DISABLE_COPY(QSpinBox)
78 Q_DECLARE_PRIVATE(QSpinBox)
79};
80
82class Q_WIDGETS_EXPORT QDoubleSpinBox : public QAbstractSpinBox
83{
84 Q_OBJECT
85
86 Q_PROPERTY(QString prefix READ prefix WRITE setPrefix)
87 Q_PROPERTY(QString suffix READ suffix WRITE setSuffix)
88 Q_PROPERTY(QString cleanText READ cleanText)
89 Q_PROPERTY(int decimals READ decimals WRITE setDecimals)
90 Q_PROPERTY(double minimum READ minimum WRITE setMinimum)
91 Q_PROPERTY(double maximum READ maximum WRITE setMaximum)
92 Q_PROPERTY(double singleStep READ singleStep WRITE setSingleStep)
93 Q_PROPERTY(StepType stepType READ stepType WRITE setStepType)
94 Q_PROPERTY(double value READ value WRITE setValue NOTIFY valueChanged USER true)
95public:
96 explicit QDoubleSpinBox(QWidget *parent = nullptr);
97 ~QDoubleSpinBox();
98
99 double value() const;
100
101 QString prefix() const;
102 void setPrefix(const QString &prefix);
103
104 QString suffix() const;
105 void setSuffix(const QString &suffix);
106
107 QString cleanText() const;
108
109 double singleStep() const;
110 void setSingleStep(double val);
111
112 double minimum() const;
113 void setMinimum(double min);
114
115 double maximum() const;
116 void setMaximum(double max);
117
118 void setRange(double min, double max);
119
120 StepType stepType() const;
121 void setStepType(StepType stepType);
122
123 int decimals() const;
124 void setDecimals(int prec);
125
126 QValidator::State validate(QString &input, int &pos) const override;
127 virtual double valueFromText(const QString &text) const;
128 virtual QString textFromValue(double val) const;
129 void fixup(QString &str) const override;
130
131public Q_SLOTS:
132 void setValue(double val);
133
134Q_SIGNALS:
135 void valueChanged(double);
136 void textChanged(const QString &);
137
138private:
139 Q_DISABLE_COPY(QDoubleSpinBox)
140 Q_DECLARE_PRIVATE(QDoubleSpinBox)
141};
142
143QT_END_NAMESPACE
144
145#endif // QSPINBOX_H
QColor grabScreenColor(const QPoint &p)
bool selectColor(const QColor &color)
void init(const QColor &initial)
void setCurrentAlpha(int a)
QColorPickingEventFilter * colorPickingEventFilter
bool handleColorPickingMouseButtonRelease(QMouseEvent *e)
QColor currentQColor() const
bool handleColorPickingMouseMove(QMouseEvent *e)
void _q_setCustom(int index, QRgb color)
QPushButton * eyeDropperButton
void updateColorLabelText(const QPoint &)
void setCurrentColor(const QColor &color, SetColorMode setColorMode=SetColorAll)
bool isAlphaVisible() const
QVBoxLayout * leftLay
void setCurrentQColor(const QColor &color)
bool canBeNativeDialog() const override
void setCurrentRgbColor(QRgb rgb)
QRgb currentColor() const
void newColorTypedIn(QRgb rgb)
bool handleColorPickingKeyPress(QKeyEvent *e)
void updateColorPicking(const QPoint &pos)
QSharedPointer< QColorDialogOptions > options
void newStandard(int, int)
void setVisible(bool visible) override
QDialogButtonBox * buttons
bool supportsColorPicking() const
QPointer< QObject > receiverToDisconnectOnClose
virtual void initHelper(QPlatformDialogHelper *h) override
QByteArray memberToDisconnectOnClose
QPushButton * addCusBt
void newHsv(int h, int s, int v)
virtual void helperPrepareShow(QPlatformDialogHelper *h) override
QColorLuminancePicker * lp
void newCustom(int, int)
QPlatformColorDialogHelper * platformColorDialogHelper() const
void nextCustom(int, int)
The QColorDialog class provides a dialog widget for specifying colors.
The QDoubleSpinBox class provides a spin box widget that takes doubles.
Definition qspinbox.h:83
friend class QPainter
\inmodule QtCore\reentrant
Definition qpoint.h:29
The QPushButton widget provides a command button.
Definition qpushbutton.h:21
The QSpinBox class provides a spin box widget.
Definition qspinbox.h:17
\variable QStyleOption::palette
\variable QStyleOptionFocusRect::backgroundColor
QColSpinBox(QWidget *parent)
void paintEvent(QPaintEvent *) override
This event handler can be reimplemented in a subclass to receive paint events passed in event.
void mouseMoveEvent(QMouseEvent *) override
This event handler, for event event, can be reimplemented in a subclass to receive mouse move events ...
void mousePressEvent(QMouseEvent *) override
This event handler, for event event, can be reimplemented in a subclass to receive mouse press events...
void paintEvent(QPaintEvent *) override
This event handler can be reimplemented in a subclass to receive paint events passed in event.
void mouseMoveEvent(QMouseEvent *) override
This event handler, for event event, can be reimplemented in a subclass to receive mouse move events ...
QSize sizeHint() const override
void setCrossVisible(bool visible)
void resizeEvent(QResizeEvent *) override
This event handler can be reimplemented in a subclass to receive widget resize events which are passe...
void mousePressEvent(QMouseEvent *) override
This event handler, for event event, can be reimplemented in a subclass to receive mouse press events...
bool eventFilter(QObject *, QEvent *event) override
Filters events if this object has been installed as an event filter for the watched object.
void applicationStateChanged(Qt::ApplicationState state)
QColorPickingEventFilter(QColorDialogPrivate *dp, QObject *parent)
void mouseReleaseEvent(QMouseEvent *e) override
This event handler, for event event, can be reimplemented in a subclass to receive mouse release even...
void mousePressEvent(QMouseEvent *e) override
This event handler, for event event, can be reimplemented in a subclass to receive mouse press events...
void mouseMoveEvent(QMouseEvent *e) override
This event handler, for event event, can be reimplemented in a subclass to receive mouse move events ...
void paintEvent(QPaintEvent *) override
This event handler can be reimplemented in a subclass to receive paint events passed in event.
void setHsv(int h, int s, int v)
void currentColorChanged(const QColor &color)
QColorWell(QWidget *parent, int r, int c, const QRgb *vals)
void paintCellContents(QPainter *, int row, int col, const QRect &) override
void mousePressEvent(QMouseEvent *e) override
This event handler, for event event, can be reimplemented in a subclass to receive mouse press events...
void mouseMoveEvent(QMouseEvent *e) override
This event handler, for event event, can be reimplemented in a subclass to receive mouse move events ...
void mouseReleaseEvent(QMouseEvent *e) override
This event handler, for event event, can be reimplemented in a subclass to receive mouse release even...
friend class QT_PREPEND_NAMESPACE(QUntypedBindable)
void mouseReleaseEvent(QMouseEvent *) override
This event handler, for event event, can be reimplemented in a subclass to receive mouse release even...
void focusOutEvent(QFocusEvent *) override
This event handler can be reimplemented in a subclass to receive keyboard focus events (focus lost) f...
void currentChanged(int row, int col)
int columnAt(int x) const
void updateCell(int row, int column)
void colorChanged(int index, QRgb color)
void paintEvent(QPaintEvent *) override
This event handler can be reimplemented in a subclass to receive paint events passed in event.
void mousePressEvent(QMouseEvent *) override
This event handler, for event event, can be reimplemented in a subclass to receive mouse press events...
void focusInEvent(QFocusEvent *) override
This event handler can be reimplemented in a subclass to receive keyboard focus events (focus receive...
virtual void setCurrent(int row, int col)
virtual void setSelected(int row, int col)
int rowAt(int y) const
QRect cellGeometry(int row, int column)
virtual void paintCell(QPainter *, int row, int col, const QRect &)
int columnX(int column) const
int rowY(int row) const
QSize sizeHint() const override
virtual void paintCellContents(QPainter *, int row, int col, const QRect &)
void keyPressEvent(QKeyEvent *) override
This event handler, for event event, can be reimplemented in a subclass to receive key press events f...
QString cellContent(int row, int col) const
QtPrivate::QColorShower QColorShower
static void rgb2hsv(QRgb rgb, int &h, int &s, int &v)
QtPrivate::QColorWell QColorWell
static int pHeight
QtPrivate::QWellArray QWellArray
static int pWidth
QtPrivate::QColorPickingEventFilter QColorPickingEventFilter
QtPrivate::QColorLuminancePicker QColorLuminancePicker
QtPrivate::QColorPicker QColorPicker
static const Qt::WindowFlags qcd_DefaultWindowFlags
@ colorColumns
@ standardColorRows
@ customColorRows
QT_REQUIRE_CONFIG(colordialog)
#define qApp
QT_REQUIRE_CONFIG(progressbar)
QT_REQUIRE_CONFIG(thread)