Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qquickspinbox_p.h
Go to the documentation of this file.
1// Copyright (C) 2017 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
4#ifndef QQUICKSPINBOX_P_H
5#define QQUICKSPINBOX_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtQuickTemplates2/private/qquickcontrol_p.h>
19#include <QtQml/qjsvalue.h>
20
22
23class QValidator;
26
27class Q_QUICKTEMPLATES2_EXPORT QQuickSpinBox : public QQuickControl
28{
30 Q_PROPERTY(int from READ from WRITE setFrom NOTIFY fromChanged FINAL)
31 Q_PROPERTY(int to READ to WRITE setTo NOTIFY toChanged FINAL)
32 Q_PROPERTY(int value READ value WRITE setValue NOTIFY valueChanged FINAL)
33 Q_PROPERTY(int stepSize READ stepSize WRITE setStepSize NOTIFY stepSizeChanged FINAL)
34 Q_PROPERTY(bool editable READ isEditable WRITE setEditable NOTIFY editableChanged FINAL)
35 Q_PROPERTY(bool live READ isLive WRITE setLive NOTIFY liveChanged FINAL REVISION(6, 6))
36
37#if QT_CONFIG(validator)
38 Q_PROPERTY(QValidator *validator READ validator WRITE setValidator NOTIFY validatorChanged FINAL)
39#endif
40 Q_PROPERTY(QJSValue textFromValue READ textFromValue WRITE setTextFromValue NOTIFY textFromValueChanged FINAL)
41 Q_PROPERTY(QJSValue valueFromText READ valueFromText WRITE setValueFromText NOTIFY valueFromTextChanged FINAL)
42 Q_PROPERTY(QQuickIndicatorButton *up READ up CONSTANT FINAL)
43 Q_PROPERTY(QQuickIndicatorButton *down READ down CONSTANT FINAL)
44 // 2.2 (Qt 5.9)
45 Q_PROPERTY(Qt::InputMethodHints inputMethodHints READ inputMethodHints WRITE setInputMethodHints NOTIFY inputMethodHintsChanged FINAL REVISION(2, 2))
46 Q_PROPERTY(bool inputMethodComposing READ isInputMethodComposing NOTIFY inputMethodComposingChanged FINAL REVISION(2, 2))
47 // 2.3 (Qt 5.10)
48 Q_PROPERTY(bool wrap READ wrap WRITE setWrap NOTIFY wrapChanged FINAL REVISION(2, 3))
49 // 2.4 (Qt 5.11)
50 Q_PROPERTY(QString displayText READ displayText NOTIFY displayTextChanged FINAL REVISION(2, 4))
51 QML_NAMED_ELEMENT(SpinBox)
53
54public:
55 explicit QQuickSpinBox(QQuickItem *parent = nullptr);
57
58 int from() const;
59 void setFrom(int from);
60
61 int to() const;
62 void setTo(int to);
63
64 int value() const;
65 void setValue(int value);
66
67 int stepSize() const;
68 void setStepSize(int step);
69
70 bool isEditable() const;
71 void setEditable(bool editable);
72
73 bool isLive() const;
74 void setLive(bool live);
75
76#if QT_CONFIG(validator)
77 QValidator *validator() const;
78 void setValidator(QValidator *validator);
79#endif
80
81 QJSValue textFromValue() const;
82 void setTextFromValue(const QJSValue &callback);
83
84 QJSValue valueFromText() const;
85 void setValueFromText(const QJSValue &callback);
86
87 QQuickIndicatorButton *up() const;
88 QQuickIndicatorButton *down() const;
89
90 // 2.2 (Qt 5.9)
91 Qt::InputMethodHints inputMethodHints() const;
92 void setInputMethodHints(Qt::InputMethodHints hints);
93
94 bool isInputMethodComposing() const;
95
96 // 2.3 (Qt 5.10)
97 bool wrap() const;
98 void setWrap(bool wrap);
99
100 // 2.4 (Qt 5.11)
101 QString displayText() const;
102
103public Q_SLOTS:
104 void increase();
105 void decrease();
106
109 void toChanged();
113 Q_REVISION(6, 6) void liveChanged();
114#if QT_CONFIG(validator)
115 void validatorChanged();
116#endif
119 // 2.2 (Qt 5.9)
120 Q_REVISION(2, 2) void valueModified();
121 Q_REVISION(2, 2) void inputMethodHintsChanged();
122 Q_REVISION(2, 2) void inputMethodComposingChanged();
123 // 2.3 (Qt 5.10)
124 Q_REVISION(2, 3) void wrapChanged();
125 // 2.4 (Qt 5.11)
126 Q_REVISION(2, 4) void displayTextChanged();
127
128protected:
129 void focusInEvent(QFocusEvent *event) override;
130 void hoverEnterEvent(QHoverEvent *event) override;
131 void hoverMoveEvent(QHoverEvent *event) override;
132 void hoverLeaveEvent(QHoverEvent *event) override;
133 void keyPressEvent(QKeyEvent *event) override;
134 void keyReleaseEvent(QKeyEvent *event) override;
135 void timerEvent(QTimerEvent *event) override;
136#if QT_CONFIG(wheelevent)
137 void wheelEvent(QWheelEvent *event) override;
138#endif
139
140 void classBegin() override;
141 void componentComplete() override;
142 void itemChange(ItemChange change, const ItemChangeData &value) override;
143 void contentItemChange(QQuickItem *newItem, QQuickItem *oldItem) override;
144 void localeChange(const QLocale &newLocale, const QLocale &oldLocale) override;
145
146 QFont defaultFont() const override;
147
148#if QT_CONFIG(accessibility)
149 QAccessible::Role accessibleRole() const override;
150 void accessibilityActiveChanged(bool active) override;
151#endif
152
153private:
154 Q_DISABLE_COPY(QQuickSpinBox)
155 Q_DECLARE_PRIVATE(QQuickSpinBox)
156};
157
159
160#endif // QQUICKSPINBOX_P_H
The QFocusEvent class contains event parameters for widget focus events.
Definition qevent.h:470
\reentrant
Definition qfont.h:22
\inmodule QtGui
Definition qevent.h:246
The QJSValue class acts as a container for Qt/JavaScript data types.
Definition qjsvalue.h:31
The QKeyEvent class describes a key event.
Definition qevent.h:424
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
Definition qquickitem.h:63
ItemChange
Used in conjunction with QQuickItem::itemChange() to notify the item about certain types of changes.
Definition qquickitem.h:144
Allows the user to select from a set of preset values.
Q_REVISION(6, 6) void liveChanged()
void stepSizeChanged()
void textFromValueChanged()
void editableChanged()
void valueChanged()
void toChanged()
void fromChanged()
Q_REVISION(2, 2) void valueModified()
void valueFromTextChanged()
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
\inmodule QtCore
Definition qcoreevent.h:366
The QValidator class provides validation of input text.
Definition qvalidator.h:24
Combined button and popup list for selecting options.
Definition qcompare.h:63
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void DBusFreeFunction return DBusConnection return DBusConnection return const char DBusError return DBusConnection DBusMessage dbus_uint32_t return DBusConnection dbus_bool_t DBusConnection DBusAddWatchFunction DBusRemoveWatchFunction DBusWatchToggledFunction void DBusFreeFunction return DBusConnection DBusDispatchStatusFunction void DBusFreeFunction DBusTimeout return DBusTimeout return DBusWatch return DBusWatch unsigned int return DBusError const DBusError return const DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessageIter int const void return DBusMessageIter DBusMessageIter return DBusMessageIter void DBusMessageIter void int return DBusMessage DBusMessageIter return DBusMessageIter return DBusMessageIter DBusMessageIter const char const char const char const char return DBusMessage return DBusMessage const char return DBusMessage dbus_bool_t return DBusMessage dbus_uint32_t return DBusMessage void
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
struct _cl_event * event
#define QML_NAMED_ELEMENT(NAME)
#define QML_ADDED_IN_VERSION(MAJOR, MINOR)
static QT_BEGIN_NAMESPACE QAsn1Element wrap(quint8 type, const QAsn1Element &child)
#define Q_PROPERTY(...)
#define Q_OBJECT
#define Q_REVISION(...)
#define Q_SLOTS
#define Q_SIGNALS
#define explicit
settings setValue("DataPump/bgcolor", color)
\inmodule QtQuick
Definition qquickitem.h:159