Cursor position is handled by the text interface.
This was a binary compatibility hack in Qt 4.
Change-Id: I45520e6942a490834f6e9346a4c173300a9bf7a9
Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
Q_DECLARE_FLAGS(Relation, RelationFlag)
enum Method {
- ListSupportedMethods = 0,
- SetCursorPosition = 1,
- GetCursorPosition = 2
+ ListSupportedMethods = 0
};
enum InterfaceType
textEdit()->setText(text);
}
-QVariant QAccessibleTextEdit::invokeMethod(QAccessible::Method method,
- const QVariantList ¶ms)
-{
- switch (method) {
- case QAccessible::ListSupportedMethods: {
- QSet<QAccessible::Method> set;
- set << QAccessible::ListSupportedMethods << QAccessible::SetCursorPosition << QAccessible::GetCursorPosition;
- return QVariant::fromValue(set | qvariant_cast<QSet<QAccessible::Method> >(
- QAccessibleWidget::invokeMethod(method, params)));
- }
- case QAccessible::SetCursorPosition:
- setCursorPosition(params.value(0).toInt());
- return true;
- case QAccessible::GetCursorPosition:
- return textEdit()->textCursor().position();
- default:
- return QAccessibleWidget::invokeMethod(method, params);
- }
-}
-
void *QAccessibleTextEdit::interface_cast(QAccessible::InterfaceType t)
{
if (t == QAccessible::TextInterface)
QString text(QAccessible::Text t) const;
void setText(QAccessible::Text t, const QString &text);
- QVariant invokeMethod(QAccessible::Method method, const QVariantList ¶ms);
void *interface_cast(QAccessible::InterfaceType t);
// QAccessibleTextInterface
return state;
}
-QVariant QAccessibleLineEdit::invokeMethod(QAccessible::Method method,
- const QVariantList ¶ms)
-{
- switch (method) {
- case QAccessible::ListSupportedMethods: {
- QSet<QAccessible::Method> set;
- set << QAccessible::ListSupportedMethods << QAccessible::SetCursorPosition << QAccessible::GetCursorPosition;
- return QVariant::fromValue(set | qvariant_cast<QSet<QAccessible::Method> >(
- QAccessibleWidget::invokeMethod(method, params)));
- }
- case QAccessible::SetCursorPosition:
- setCursorPosition(params.value(0).toInt());
- return true;
- case QAccessible::GetCursorPosition:
- return cursorPosition();
- default:
- return QAccessibleWidget::invokeMethod(method, params);
- }
-}
-
void *QAccessibleLineEdit::interface_cast(QAccessible::InterfaceType t)
{
if (t == QAccessible::TextInterface)
QString text(QAccessible::Text t) const;
void setText(QAccessible::Text t, const QString &text);
QAccessible::State state() const;
- QVariant invokeMethod(QAccessible::Method method, const QVariantList ¶ms);
void *interface_cast(QAccessible::InterfaceType t);
// QAccessibleTextInterface