38 Q_PROPERTY(
int count READ count NOTIFY countChanged FINAL)
39 Q_PROPERTY(QVariant model READ model WRITE setModel NOTIFY modelChanged FINAL)
40 Q_PROPERTY(QQmlInstanceModel *delegateModel READ delegateModel NOTIFY delegateModelChanged FINAL)
41 Q_PROPERTY(
bool pressed READ isPressed NOTIFY pressedChanged FINAL)
42 Q_PROPERTY(
int highlightedIndex READ highlightedIndex NOTIFY highlightedIndexChanged FINAL)
43 Q_PROPERTY(
int currentIndex READ currentIndex WRITE setCurrentIndex NOTIFY currentIndexChanged FINAL)
44 Q_PROPERTY(QString currentText READ currentText NOTIFY currentTextChanged FINAL)
45 Q_PROPERTY(QString displayText READ displayText WRITE setDisplayText RESET resetDisplayText NOTIFY displayTextChanged FINAL)
46 Q_PROPERTY(QString textRole READ textRole WRITE setTextRole NOTIFY textRoleChanged FINAL)
47 Q_PROPERTY(QQmlComponent *delegate READ delegate WRITE setDelegate NOTIFY delegateChanged FINAL)
48 Q_PROPERTY(QQuickItem *indicator READ indicator WRITE setIndicator NOTIFY indicatorChanged FINAL)
49 Q_PROPERTY(QQuickPopup *popup READ popup WRITE setPopup NOTIFY popupChanged FINAL)
51 Q_PROPERTY(
bool flat READ isFlat WRITE setFlat NOTIFY flatChanged FINAL REVISION(2, 1))
53 Q_PROPERTY(
bool down READ isDown WRITE setDown RESET resetDown NOTIFY downChanged FINAL REVISION(2, 2))
54 Q_PROPERTY(
bool editable READ isEditable WRITE setEditable NOTIFY editableChanged FINAL REVISION(2, 2))
55 Q_PROPERTY(QString editText READ editText WRITE setEditText RESET resetEditText NOTIFY editTextChanged FINAL REVISION(2, 2))
56#if QT_CONFIG(validator)
57 Q_PROPERTY(QValidator *validator READ validator WRITE setValidator NOTIFY validatorChanged FINAL REVISION(2, 2))
59 Q_PROPERTY(Qt::InputMethodHints inputMethodHints READ inputMethodHints WRITE setInputMethodHints NOTIFY inputMethodHintsChanged FINAL REVISION(2, 2))
60 Q_PROPERTY(
bool inputMethodComposing READ isInputMethodComposing NOTIFY inputMethodComposingChanged FINAL REVISION(2, 2))
61 Q_PROPERTY(
bool acceptableInput READ hasAcceptableInput NOTIFY acceptableInputChanged FINAL REVISION(2, 2))
63 Q_PROPERTY(qreal implicitIndicatorWidth READ implicitIndicatorWidth NOTIFY implicitIndicatorWidthChanged FINAL REVISION(2, 5))
64 Q_PROPERTY(qreal implicitIndicatorHeight READ implicitIndicatorHeight NOTIFY implicitIndicatorHeightChanged FINAL REVISION(2, 5))
65 Q_CLASSINFO(
"DeferredPropertyNames",
"background,contentItem,indicator,popup")
67 Q_PROPERTY(QVariant currentValue READ currentValue WRITE setCurrentValue NOTIFY currentValueChanged FINAL REVISION(2, 14))
68 Q_PROPERTY(QString valueRole READ valueRole WRITE setValueRole NOTIFY valueRoleChanged FINAL REVISION(2, 14))
70 Q_PROPERTY(
bool selectTextByMouse READ selectTextByMouse WRITE setSelectTextByMouse NOTIFY selectTextByMouseChanged FINAL REVISION(2, 15))
72 Q_PROPERTY(ImplicitContentWidthPolicy implicitContentWidthPolicy READ implicitContentWidthPolicy
73 WRITE setImplicitContentWidthPolicy NOTIFY implicitContentWidthPolicyChanged FINAL REVISION(6, 0))
75 Q_PROPERTY(
bool highlightOnHover READ highlightOnHover WRITE setHighlightOnHover NOTIFY highlightOnHoverChanged FINAL REVISION(6, 12))
76 QML_NAMED_ELEMENT(ComboBox)
77 QML_ADDED_IN_VERSION(2, 0)
80 explicit QQuickComboBox(QQuickItem *parent =
nullptr);
85 QVariant model()
const;
86 void setModel(
const QVariant &model);
87 QQmlInstanceModel *delegateModel()
const;
89 bool isPressed()
const;
90 void setPressed(
bool pressed);
92 int highlightedIndex()
const;
94 int currentIndex()
const;
95 void setCurrentIndex(
int index);
97 QString currentText()
const;
99 QString displayText()
const;
100 void setDisplayText(
const QString &text);
101 void resetDisplayText();
103 QString textRole()
const;
104 void setTextRole(
const QString &role);
106 QString valueRole()
const;
107 void setValueRole(
const QString &role);
109 QQmlComponent *delegate()
const;
110 void setDelegate(QQmlComponent *delegate);
112 QQuickItem *indicator()
const;
113 void setIndicator(QQuickItem *indicator);
115 QQuickPopup *popup()
const;
116 void setPopup(QQuickPopup *popup);
118 Q_INVOKABLE QString textAt(
int index)
const;
119 Q_INVOKABLE
int find(
const QString &text, Qt::MatchFlags flags = Qt::MatchExactly)
const;
123 void setFlat(
bool flat);
127 void setDown(
bool down);
130 bool isEditable()
const;
131 void setEditable(
bool editable);
133 QString editText()
const;
134 void setEditText(
const QString &text);
135 void resetEditText();
137#if QT_CONFIG(validator)
138 QValidator *validator()
const;
139 void setValidator(QValidator *validator);
142 Qt::InputMethodHints inputMethodHints()
const;
143 void setInputMethodHints(Qt::InputMethodHints hints);
145 bool isInputMethodComposing()
const;
146 bool hasAcceptableInput()
const;
149 qreal implicitIndicatorWidth()
const;
150 qreal implicitIndicatorHeight()
const;
153 QVariant currentValue()
const;
154 Q_REVISION(6, 10)
void setCurrentValue(
const QVariant &value);
155 Q_REVISION(2, 14) Q_INVOKABLE QVariant valueAt(
int index)
const;
156 Q_REVISION(2, 14) Q_INVOKABLE
int indexOfValue(
const QVariant &value)
const;
159 bool selectTextByMouse()
const;
160 void setSelectTextByMouse(
bool canSelect);
163 enum ImplicitContentWidthPolicy {
164 ContentItemImplicitWidth,
166 WidestTextWhenCompleted
168 Q_ENUM(ImplicitContentWidthPolicy)
170 ImplicitContentWidthPolicy implicitContentWidthPolicy()
const;
171 void setImplicitContentWidthPolicy(ImplicitContentWidthPolicy policy);
174 bool highlightOnHover()
const;
175 void setHighlightOnHover(
bool value);
178 void incrementCurrentIndex();
179 void decrementCurrentIndex();
180 Q_REVISION(2, 2)
void selectAll();
183 void activated(
int index);
184 void highlighted(
int index);
187 void delegateModelChanged();
188 void pressedChanged();
189 void highlightedIndexChanged();
190 void currentIndexChanged();
191 void currentTextChanged();
192 void displayTextChanged();
193 void textRoleChanged();
194 void delegateChanged();
195 void indicatorChanged();
198 Q_REVISION(2, 1)
void flatChanged();
200 Q_REVISION(2, 2)
void accepted();
201 Q_REVISION(2, 2)
void downChanged();
202 Q_REVISION(2, 2)
void editableChanged();
203 Q_REVISION(2, 2)
void editTextChanged();
204#if QT_CONFIG(validator)
205 Q_REVISION(2, 2)
void validatorChanged();
207 Q_REVISION(2, 2)
void inputMethodHintsChanged();
208 Q_REVISION(2, 2)
void inputMethodComposingChanged();
209 Q_REVISION(2, 2)
void acceptableInputChanged();
211 Q_REVISION(2, 5)
void implicitIndicatorWidthChanged();
212 Q_REVISION(2, 5)
void implicitIndicatorHeightChanged();
214 Q_REVISION(2, 14)
void valueRoleChanged();
215 Q_REVISION(2, 14)
void currentValueChanged();
217 Q_REVISION(2, 15)
void selectTextByMouseChanged();
219 Q_REVISION(6, 0)
void implicitContentWidthPolicyChanged();
221 Q_REVISION(6, 12)
void highlightOnHoverChanged();
224 bool eventFilter(QObject *object, QEvent *event) override;
225 void focusInEvent(QFocusEvent *event) override;
226 void focusOutEvent(QFocusEvent *event) override;
228 void inputMethodEvent(QInputMethodEvent *event) override;
230 void keyPressEvent(QKeyEvent *event) override;
231 void keyReleaseEvent(QKeyEvent *event) override;
232#if QT_CONFIG(wheelevent)
233 void wheelEvent(QWheelEvent *event) override;
235 bool event(QEvent *e) override;
237 void componentComplete() override;
238 void itemChange(ItemChange change,
const ItemChangeData &value) override;
239 void fontChange(
const QFont &newFont,
const QFont &oldFont) override;
240 void contentItemChange(QQuickItem *newItem, QQuickItem *oldItem) override;
241 void localeChange(
const QLocale &newLocale,
const QLocale &oldLocale) override;
243 QFont defaultFont()
const override;
245#if QT_CONFIG(accessibility)
246 QAccessible::Role accessibleRole()
const override;
247 void accessibilityActiveChanged(
bool active) override;
251 Q_DISABLE_COPY(QQuickComboBox)
252 Q_DECLARE_PRIVATE(QQuickComboBox)