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))
74 QML_NAMED_ELEMENT(ComboBox)
75 QML_ADDED_IN_VERSION(2, 0)
78 explicit QQuickComboBox(QQuickItem *parent =
nullptr);
83 QVariant model()
const;
84 void setModel(
const QVariant &model);
85 QQmlInstanceModel *delegateModel()
const;
87 bool isPressed()
const;
88 void setPressed(
bool pressed);
90 int highlightedIndex()
const;
92 int currentIndex()
const;
93 void setCurrentIndex(
int index);
95 QString currentText()
const;
97 QString displayText()
const;
98 void setDisplayText(
const QString &text);
99 void resetDisplayText();
101 QString textRole()
const;
102 void setTextRole(
const QString &role);
104 QString valueRole()
const;
105 void setValueRole(
const QString &role);
107 QQmlComponent *delegate()
const;
108 void setDelegate(QQmlComponent *delegate);
110 QQuickItem *indicator()
const;
111 void setIndicator(QQuickItem *indicator);
113 QQuickPopup *popup()
const;
114 void setPopup(QQuickPopup *popup);
116 Q_INVOKABLE QString textAt(
int index)
const;
117 Q_INVOKABLE
int find(
const QString &text, Qt::MatchFlags flags = Qt::MatchExactly)
const;
121 void setFlat(
bool flat);
125 void setDown(
bool down);
128 bool isEditable()
const;
129 void setEditable(
bool editable);
131 QString editText()
const;
132 void setEditText(
const QString &text);
133 void resetEditText();
135#if QT_CONFIG(validator)
136 QValidator *validator()
const;
137 void setValidator(QValidator *validator);
140 Qt::InputMethodHints inputMethodHints()
const;
141 void setInputMethodHints(Qt::InputMethodHints hints);
143 bool isInputMethodComposing()
const;
144 bool hasAcceptableInput()
const;
147 qreal implicitIndicatorWidth()
const;
148 qreal implicitIndicatorHeight()
const;
151 QVariant currentValue()
const;
152 Q_REVISION(6, 10)
void setCurrentValue(
const QVariant &value);
153 Q_REVISION(2, 14) Q_INVOKABLE QVariant valueAt(
int index)
const;
154 Q_REVISION(2, 14) Q_INVOKABLE
int indexOfValue(
const QVariant &value)
const;
157 bool selectTextByMouse()
const;
158 void setSelectTextByMouse(
bool canSelect);
161 enum ImplicitContentWidthPolicy {
162 ContentItemImplicitWidth,
164 WidestTextWhenCompleted
166 Q_ENUM(ImplicitContentWidthPolicy)
168 ImplicitContentWidthPolicy implicitContentWidthPolicy()
const;
169 void setImplicitContentWidthPolicy(ImplicitContentWidthPolicy policy);
172 void incrementCurrentIndex();
173 void decrementCurrentIndex();
174 Q_REVISION(2, 2)
void selectAll();
177 void activated(
int index);
178 void highlighted(
int index);
181 void delegateModelChanged();
182 void pressedChanged();
183 void highlightedIndexChanged();
184 void currentIndexChanged();
185 void currentTextChanged();
186 void displayTextChanged();
187 void textRoleChanged();
188 void delegateChanged();
189 void indicatorChanged();
192 Q_REVISION(2, 1)
void flatChanged();
194 Q_REVISION(2, 2)
void accepted();
195 Q_REVISION(2, 2)
void downChanged();
196 Q_REVISION(2, 2)
void editableChanged();
197 Q_REVISION(2, 2)
void editTextChanged();
198#if QT_CONFIG(validator)
199 Q_REVISION(2, 2)
void validatorChanged();
201 Q_REVISION(2, 2)
void inputMethodHintsChanged();
202 Q_REVISION(2, 2)
void inputMethodComposingChanged();
203 Q_REVISION(2, 2)
void acceptableInputChanged();
205 Q_REVISION(2, 5)
void implicitIndicatorWidthChanged();
206 Q_REVISION(2, 5)
void implicitIndicatorHeightChanged();
208 Q_REVISION(2, 14)
void valueRoleChanged();
209 Q_REVISION(2, 14)
void currentValueChanged();
211 Q_REVISION(2, 15)
void selectTextByMouseChanged();
213 Q_REVISION(6, 0)
void implicitContentWidthPolicyChanged();
216 bool eventFilter(QObject *object, QEvent *event) override;
217 void focusInEvent(QFocusEvent *event) override;
218 void focusOutEvent(QFocusEvent *event) override;
220 void inputMethodEvent(QInputMethodEvent *event) override;
222 void keyPressEvent(QKeyEvent *event) override;
223 void keyReleaseEvent(QKeyEvent *event) override;
224#if QT_CONFIG(wheelevent)
225 void wheelEvent(QWheelEvent *event) override;
227 bool event(QEvent *e) override;
229 void componentComplete() override;
230 void itemChange(ItemChange change,
const ItemChangeData &value) override;
231 void fontChange(
const QFont &newFont,
const QFont &oldFont) override;
232 void contentItemChange(QQuickItem *newItem, QQuickItem *oldItem) override;
233 void localeChange(
const QLocale &newLocale,
const QLocale &oldLocale) override;
235 QFont defaultFont()
const override;
237#if QT_CONFIG(accessibility)
238 QAccessible::Role accessibleRole()
const override;
239 void accessibilityActiveChanged(
bool active) override;
243 Q_DISABLE_COPY(QQuickComboBox)
244 Q_DECLARE_PRIVATE(QQuickComboBox)