Accessibility: set multiline state for text edits.
Change-Id: I22d3baac8fc57db0c89d8543019a93263b2023ca Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com> Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
This commit is contained in:
parent
b77749e997
commit
1dff3d1d83
@ -134,7 +134,7 @@ void QAccessiblePlainTextEdit::setText(QAccessible::Text t, const QString &text)
|
||||
|
||||
QAccessible::State QAccessiblePlainTextEdit::state() const
|
||||
{
|
||||
QAccessible::State st = QAccessibleWidget::state();
|
||||
QAccessible::State st = QAccessibleTextWidget::state();
|
||||
if (plainTextEdit()->isReadOnly())
|
||||
st.readOnly = true;
|
||||
else
|
||||
@ -258,7 +258,7 @@ void QAccessibleTextEdit::setText(QAccessible::Text t, const QString &text)
|
||||
|
||||
QAccessible::State QAccessibleTextEdit::state() const
|
||||
{
|
||||
QAccessible::State st = QAccessibleWidget::state();
|
||||
QAccessible::State st = QAccessibleTextWidget::state();
|
||||
if (textEdit()->isReadOnly())
|
||||
st.readOnly = true;
|
||||
else
|
||||
@ -806,6 +806,13 @@ QAccessibleTextWidget::QAccessibleTextWidget(QWidget *o, QAccessible::Role r, co
|
||||
|
||||
}
|
||||
|
||||
QAccessible::State QAccessibleTextWidget::state() const
|
||||
{
|
||||
QAccessible::State s = QAccessibleWidget::state();
|
||||
s.multiLine = true;
|
||||
return s;
|
||||
}
|
||||
|
||||
QRect QAccessibleTextWidget::characterRect(int offset) const
|
||||
{
|
||||
QTextBlock block = textDocument()->findBlock(offset);
|
||||
|
@ -76,6 +76,8 @@ class QAccessibleTextWidget : public QAccessibleWidget,
|
||||
public:
|
||||
QAccessibleTextWidget(QWidget *o, QAccessible::Role r = QAccessible::EditableText, const QString &name = QString());
|
||||
|
||||
QAccessible::State state() const;
|
||||
|
||||
// QAccessibleTextInterface
|
||||
// selection
|
||||
void selection(int selectionIndex, int *startOffset, int *endOffset) const;
|
||||
|
Loading…
Reference in New Issue
Block a user