33 Q_PROPERTY(QVariant suggestionModel READ suggestionModel WRITE setSuggestionModel
34 NOTIFY suggestionModelChanged FINAL)
35 Q_PROPERTY(QQmlInstanceModel *delegateModel READ delegateModel NOTIFY delegateModelChanged FINAL)
36 Q_PROPERTY(
int suggestionCount READ suggestionCount NOTIFY suggestionCountChanged FINAL)
37 Q_PROPERTY(
int currentIndex READ currentIndex WRITE setCurrentIndex NOTIFY currentIndexChanged
39 Q_PROPERTY(
int highlightedIndex READ highlightedIndex NOTIFY highlightedIndexChanged FINAL)
40 Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged FINAL)
41 Q_PROPERTY(QString textRole READ textRole WRITE setTextRole NOTIFY textRoleChanged FINAL)
42 Q_PROPERTY(
bool live READ isLive WRITE setLive NOTIFY liveChanged)
43 Q_PROPERTY(QQuickIndicatorButton *searchIndicator READ searchIndicator CONSTANT FINAL)
44 Q_PROPERTY(QQuickIndicatorButton *clearIndicator READ clearIndicator CONSTANT FINAL)
45 Q_PROPERTY(QQuickPopup *popup READ popup WRITE setPopup NOTIFY popupChanged FINAL)
46 Q_PROPERTY(QQmlComponent *delegate READ delegate WRITE setDelegate NOTIFY delegateChanged FINAL)
47 Q_PROPERTY(QString placeholderText READ placeholderText WRITE setPlaceholderText
48 NOTIFY placeholderTextChanged FINAL REVISION(6, 12))
49 Q_PROPERTY(
bool selectTextByMouse READ selectTextByMouse WRITE setSelectTextByMouse
50 NOTIFY selectTextByMouseChanged FINAL REVISION(6, 12))
51 Q_PROPERTY(QString selectedText READ selectedText NOTIFY selectedTextChanged FINAL REVISION(6, 12))
52 Q_PROPERTY(
int selectionStart READ selectionStart NOTIFY selectionStartChanged FINAL REVISION(6, 12))
53 Q_PROPERTY(
int selectionEnd READ selectionEnd NOTIFY selectionEndChanged FINAL REVISION(6, 12))
54 Q_PROPERTY(
int cursorPosition READ cursorPosition WRITE setCursorPosition
55 NOTIFY cursorPositionChanged FINAL REVISION(6, 12))
57 QML_NAMED_ELEMENT(SearchField)
58 QML_ADDED_IN_VERSION(6, 10)
61 explicit QQuickSearchField(QQuickItem *parent =
nullptr);
64 QVariant suggestionModel()
const;
65 void setSuggestionModel(
const QVariant &model);
67 QQmlInstanceModel *delegateModel()
const;
69 int suggestionCount()
const;
71 int currentIndex()
const;
72 void setCurrentIndex(
int index);
74 int highlightedIndex()
const;
77 void setText(
const QString &text);
79 QString textRole()
const;
80 void setTextRole(
const QString &textRole);
83 void setLive(
const bool live);
85 QQuickIndicatorButton *searchIndicator()
const;
86 QQuickIndicatorButton *clearIndicator()
const;
88 QQuickPopup *popup()
const;
89 void setPopup(QQuickPopup *popup);
91 QQmlComponent *delegate()
const;
92 void setDelegate(QQmlComponent *delegate);
94 QString placeholderText()
const;
95 void setPlaceholderText(
const QString &text);
97 bool selectTextByMouse()
const;
98 void setSelectTextByMouse(
const bool selectable);
100 QString selectedText()
const;
102 int selectionStart()
const;
104 int selectionEnd()
const;
106 int cursorPosition()
const;
107 void setCursorPosition(
int position);
110 Q_REVISION(6, 12)
void select(
int start,
int end);
111 Q_REVISION(6, 12)
void selectWord();
112 Q_REVISION(6, 12)
void selectAll();
113 Q_REVISION(6, 12)
void deselect();
116 void activated(
int index);
117 void highlighted(
int index);
119 void searchTriggered();
121 void suggestionModelChanged();
122 void delegateModelChanged();
123 void suggestionCountChanged();
124 void currentIndexChanged();
125 void highlightedIndexChanged();
127 void textRoleChanged();
130 void delegateChanged();
131 Q_REVISION(6, 12)
void placeholderTextChanged();
132 Q_REVISION(6, 12)
void selectTextByMouseChanged();
133 Q_REVISION(6, 12)
void selectedTextChanged();
134 Q_REVISION(6, 12)
void selectionStartChanged();
135 Q_REVISION(6, 12)
void selectionEndChanged();
136 Q_REVISION(6, 12)
void cursorPositionChanged();
138 void searchButtonPressed();
139 void clearButtonPressed();
142 bool eventFilter(QObject *object, QEvent *event) override;
143 void focusInEvent(QFocusEvent *event) override;
144 void focusOutEvent(QFocusEvent *event) override;
145 void hoverEnterEvent(QHoverEvent *event) override;
146 void hoverMoveEvent(QHoverEvent *event) override;
147 void hoverLeaveEvent(QHoverEvent *event) override;
148 void keyPressEvent(QKeyEvent *event) override;
149 void classBegin() override;
150 void componentComplete() override;
151 void contentItemChange(QQuickItem *newItem, QQuickItem *oldItem) override;
152 void itemChange(QQuickItem::ItemChange change,
const QQuickItem::ItemChangeData &data) override;
155 Q_DISABLE_COPY(QQuickSearchField)
156 Q_DECLARE_PRIVATE(QQuickSearchField)