summaryrefslogtreecommitdiffstats
path: root/src/quick/accessible/qaccessiblequickitem.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/quick/accessible/qaccessiblequickitem.cpp')
-rw-r--r--src/quick/accessible/qaccessiblequickitem.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/quick/accessible/qaccessiblequickitem.cpp b/src/quick/accessible/qaccessiblequickitem.cpp
index 98e7663c96..b87203c3ef 100644
--- a/src/quick/accessible/qaccessiblequickitem.cpp
+++ b/src/quick/accessible/qaccessiblequickitem.cpp
@@ -382,6 +382,22 @@ QString QAccessibleQuickItem::text(QAccessible::Text textType) const
return QString();
}
+void QAccessibleQuickItem::setText(QAccessible::Text textType, const QString &text)
+{
+ if (role() != QAccessible::EditableText)
+ return;
+ if (textType != QAccessible::Value)
+ return;
+
+ if (QTextDocument *doc = textDocument()) {
+ doc->setPlainText(text);
+ return;
+ }
+ auto textPropertyName = "text";
+ if (object()->metaObject()->indexOfProperty(textPropertyName) >= 0)
+ object()->setProperty(textPropertyName, text);
+}
+
void *QAccessibleQuickItem::interface_cast(QAccessible::InterfaceType t)
{
QAccessible::Role r = role();