diff options
Diffstat (limited to 'src/widgets/widgets')
-rw-r--r-- | src/widgets/widgets/qcombobox.cpp | 12 | ||||
-rw-r--r-- | src/widgets/widgets/qmainwindow.cpp | 1 | ||||
-rw-r--r-- | src/widgets/widgets/qplaintextedit.cpp | 5 |
3 files changed, 10 insertions, 8 deletions
diff --git a/src/widgets/widgets/qcombobox.cpp b/src/widgets/widgets/qcombobox.cpp index 06258cb4a6..f857f4eac0 100644 --- a/src/widgets/widgets/qcombobox.cpp +++ b/src/widgets/widgets/qcombobox.cpp @@ -1000,11 +1000,11 @@ void QComboBoxPrivate::_q_dataChanged(const QModelIndex &topLeft, const QModelIn emit q->currentTextChanged(text); } q->update(); - } #ifndef QT_NO_ACCESSIBILITY - QAccessibleEvent event(q, QAccessible::NameChanged); + QAccessibleValueChangeEvent event(q, text); QAccessible::updateAccessibility(&event); #endif + } } void QComboBoxPrivate::_q_rowsInserted(const QModelIndex &parent, int start, int end) @@ -1269,7 +1269,7 @@ void QComboBoxPrivate::_q_emitCurrentIndexChanged(const QModelIndex &index) if (!lineEdit) emit q->currentTextChanged(text); #ifndef QT_NO_ACCESSIBILITY - QAccessibleEvent event(q, QAccessible::NameChanged); + QAccessibleValueChangeEvent event(q, text); QAccessible::updateAccessibility(&event); #endif } @@ -2757,7 +2757,7 @@ void QComboBox::clear() Q_D(QComboBox); d->model->removeRows(0, d->model->rowCount(d->root), d->root); #ifndef QT_NO_ACCESSIBILITY - QAccessibleEvent event(this, QAccessible::NameChanged); + QAccessibleValueChangeEvent event(this, QString()); QAccessible::updateAccessibility(&event); #endif } @@ -2771,7 +2771,7 @@ void QComboBox::clearEditText() if (d->lineEdit) d->lineEdit->clear(); #ifndef QT_NO_ACCESSIBILITY - QAccessibleEvent event(this, QAccessible::NameChanged); + QAccessibleValueChangeEvent event(this, QString()); QAccessible::updateAccessibility(&event); #endif } @@ -2785,7 +2785,7 @@ void QComboBox::setEditText(const QString &text) if (d->lineEdit) d->lineEdit->setText(text); #ifndef QT_NO_ACCESSIBILITY - QAccessibleEvent event(this, QAccessible::NameChanged); + QAccessibleValueChangeEvent event(this, text); QAccessible::updateAccessibility(&event); #endif } diff --git a/src/widgets/widgets/qmainwindow.cpp b/src/widgets/widgets/qmainwindow.cpp index 90cfb1d7cb..358569a5e4 100644 --- a/src/widgets/widgets/qmainwindow.cpp +++ b/src/widgets/widgets/qmainwindow.cpp @@ -1519,6 +1519,7 @@ void QMainWindow::setUnifiedTitleAndToolBarOnMac(bool set) typedef void (*SetContentBorderEnabledFunction)(QWindow *window, bool enable); (reinterpret_cast<SetContentBorderEnabledFunction>(function))(window()->windowHandle(), set); + update(); } #endif diff --git a/src/widgets/widgets/qplaintextedit.cpp b/src/widgets/widgets/qplaintextedit.cpp index e41cb64463..df13085dee 100644 --- a/src/widgets/widgets/qplaintextedit.cpp +++ b/src/widgets/widgets/qplaintextedit.cpp @@ -284,14 +284,15 @@ void QPlainTextDocumentLayoutPrivate::relayout() /*! \reimp */ -void QPlainTextDocumentLayout::documentChanged(int from, int /*charsRemoved*/, int charsAdded) +void QPlainTextDocumentLayout::documentChanged(int from, int charsRemoved, int charsAdded) { Q_D(QPlainTextDocumentLayout); QTextDocument *doc = document(); int newBlockCount = doc->blockCount(); + int charsChanged = qMax(charsRemoved, charsAdded); QTextBlock changeStartBlock = doc->findBlock(from); - QTextBlock changeEndBlock = doc->findBlock(qMax(0, from + charsAdded - 1)); + QTextBlock changeEndBlock = doc->findBlock(qMax(0, from + charsChanged - 1)); if (changeStartBlock == changeEndBlock && newBlockCount == d->blockCount) { QTextBlock block = changeStartBlock; |