diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2014-05-22 07:44:45 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2014-05-22 07:46:17 +0200 |
commit | 508b95899d4764d879a01b3990e44ce849cd9abc (patch) | |
tree | 3dbb215480c98ee75b5aacc5e3d691e04d8ce8c8 /src/widgets/widgets | |
parent | f2891be00808c82f5069661d60d8727fe28774b7 (diff) | |
parent | 5d2939344eb8fbd3c2115f52a7a8d47365bdf820 (diff) |
Merge remote-tracking branch 'origin/stable' into dev
Change-Id: Ia36e93771066d8abcf8123dbe2362c5c9d9260fc
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; |