19 Q_PROPERTY( QString text READ text WRITE setText NOTIFY textChanged USER
true)
21 Q_PROPERTY( QString description READ description
22 WRITE setDescription NOTIFY descriptionChanged )
25 WRITE setFontRole RESET resetFontRole NOTIFY fontRoleChanged )
27 Q_PROPERTY( QFont font READ font )
29 Q_PROPERTY( Qt::Alignment alignment READ alignment
30 WRITE setAlignment RESET resetAlignment NOTIFY alignmentChanged )
32 Q_PROPERTY( QskTextOptions::WrapMode wrapMode READ wrapMode
33 WRITE setWrapMode NOTIFY wrapModeChanged )
35 Q_PROPERTY( ActivationModes activationModes READ activationModes
36 WRITE setActivationModes NOTIFY activationModesChanged )
38 Q_PROPERTY(
bool editing READ isEditing
39 WRITE setEditing NOTIFY editingChanged )
41 Q_PROPERTY( EchoMode echoMode READ echoMode
42 WRITE setEchoMode NOTIFY echoModeChanged )
44 Q_PROPERTY( QString passwordCharacter READ passwordCharacter
45 WRITE setPasswordCharacter RESET resetPasswordCharacter
46 NOTIFY passwordCharacterChanged )
48 Q_PROPERTY(
int passwordMaskDelay READ passwordMaskDelay
49 WRITE setPasswordMaskDelay RESET resetPasswordMaskDelay
50 NOTIFY passwordMaskDelayChanged )
52 Q_PROPERTY(
bool panel READ hasPanel
53 WRITE setPanel NOTIFY panelChanged )
58 QSK_SUBCONTROLS( Panel, Text, PanelSelected, TextSelected )
59 QSK_STATES( ReadOnly, Editing )
65 ActivationOnFocus = 1 << 0,
66 ActivationOnMouse = 1 << 1,
67 ActivationOnKey = 1 << 2,
69 ActivationOnInput = ActivationOnMouse | ActivationOnKey,
70 ActivationOnAll = ActivationOnFocus | ActivationOnMouse | ActivationOnKey
73 Q_ENUM( ActivationMode )
74 Q_DECLARE_FLAGS( ActivationModes, ActivationMode )
87 QskTextInput(
const QString& text, QQuickItem* parent =
nullptr );
91 void setupFrom(
const QQuickItem* );
95 void setDescription(
const QString& );
96 QString description()
const;
98 void setPanel(
bool );
99 bool hasPanel()
const;
102 void resetFontRole();
105 void setAlignment( Qt::Alignment );
106 void resetAlignment();
107 Qt::Alignment alignment()
const;
109 void setWrapMode( QskTextOptions::WrapMode );
110 QskTextOptions::WrapMode wrapMode()
const;
112 void setActivationModes( ActivationModes );
113 ActivationModes activationModes()
const;
115 bool isEditing()
const;
119 bool isReadOnly()
const;
120 void setReadOnly(
bool );
122 int cursorPosition()
const;
123 void setCursorPosition(
int );
125 int maxLength()
const;
126 void setMaxLength(
int );
128 QValidator* validator()
const;
129 void setValidator( QValidator* );
131 QString inputMask()
const;
132 void setInputMask(
const QString& );
134 EchoMode echoMode()
const;
135 void setEchoMode( EchoMode );
137 QString passwordCharacter()
const;
138 void setPasswordCharacter(
const QString& );
139 void resetPasswordCharacter();
141 int passwordMaskDelay()
const;
142 void setPasswordMaskDelay(
int );
143 void resetPasswordMaskDelay();
145 QString displayText()
const;
146 QString preeditText()
const;
148 bool overwriteMode()
const;
149 void setOverwriteMode(
bool );
151 bool hasAcceptableInput()
const;
154 QVariant inputMethodQuery( Qt::InputMethodQuery )
const override;
155 QVariant inputMethodQuery( Qt::InputMethodQuery,
const QVariant& argument )
const;
157 bool canUndo()
const;
158 bool canRedo()
const;
160 Qt::InputMethodHints inputMethodHints()
const;
161 void setInputMethodHints( Qt::InputMethodHints );
163 void ensureVisible(
int position );
166 void setText(
const QString& );
167 void setEditing(
bool );
170 void editingChanged(
bool );
172 void activationModesChanged();
173 void readOnlyChanged(
bool );
174 void panelChanged(
bool );
176 void textChanged(
const QString& );
177 void displayTextChanged(
const QString& );
179 void textEdited(
const QString& );
180 void descriptionChanged(
const QString& );
182 void fontRoleChanged();
183 void alignmentChanged();
184 void wrapModeChanged( QskTextOptions::WrapMode );
186 void overwriteModeChanged(
bool );
187 void maximumLengthChanged(
int );
189 void echoModeChanged( EchoMode );
190 void passwordMaskDelayChanged();
191 void passwordCharacterChanged();
193 void validatorChanged();
194 void inputMaskChanged(
const QString& );
197 bool event( QEvent* )
override;
199 void inputMethodEvent( QInputMethodEvent* )
override;
201 void focusInEvent( QFocusEvent* )
override;
202 void focusOutEvent( QFocusEvent* )
override;
204 void mousePressEvent( QMouseEvent* )
override;
205 void mouseMoveEvent( QMouseEvent* )
override;
206 void mouseReleaseEvent( QMouseEvent* )
override;
207 void mouseDoubleClickEvent( QMouseEvent* )
override;
209 void keyPressEvent( QKeyEvent* )
override;
210 void keyReleaseEvent( QKeyEvent* )
override;
212 QSizeF layoutSizeHint( Qt::SizeHint,
const QSizeF& )
const override;
214 void updateLayout()
override;
219 std::unique_ptr< PrivateData > m_data;