{
if (t == QAccessible::TextInterface)
return static_cast<QAccessibleTextInterface*>(this);
+ if (t == QAccessible::EditableTextInterface)
+ return static_cast<QAccessibleEditableTextInterface*>(this);
return QAccessibleWidget::interface_cast(t);
}
lineEdit()->setCursorPosition(startIndex);
}
+void QAccessibleLineEdit::deleteText(int startOffset, int endOffset)
+{
+ lineEdit()->setText(lineEdit()->text().remove(startOffset, endOffset - startOffset));
+}
+
+void QAccessibleLineEdit::insertText(int offset, const QString &text)
+{
+ lineEdit()->setText(lineEdit()->text().insert(offset, text));
+}
+
+void QAccessibleLineEdit::replaceText(int startOffset, int endOffset, const QString &text)
+{
+ lineEdit()->setText(lineEdit()->text().replace(startOffset, endOffset - startOffset, text));
+}
+
#endif // QT_NO_LINEEDIT
#ifndef QT_NO_PROGRESSBAR
#endif
#ifndef QT_NO_LINEEDIT
-class QAccessibleLineEdit : public QAccessibleWidget, public QAccessibleTextInterface
+class QAccessibleLineEdit : public QAccessibleWidget, public QAccessibleTextInterface, public QAccessibleEditableTextInterface
{
public:
explicit QAccessibleLineEdit(QWidget *o, const QString &name = QString());
int characterCount() const;
void scrollToSubstring(int startIndex, int endIndex);
+ // QAccessibleEditableTextInterface
+ void deleteText(int startOffset, int endOffset);
+ void insertText(int offset, const QString &text);
+ void replaceText(int startOffset, int endOffset, const QString &text);
protected:
QLineEdit *lineEdit() const;
};