diff options
author | Liang Qi <liang.qi@qt.io> | 2019-05-13 08:04:58 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2019-05-13 08:04:58 +0200 |
commit | 388fe97f2a54089544dff0ed3af6ca70bf604716 (patch) | |
tree | 163b47974c625849726804337bd667c942dfbc77 /src/widgets | |
parent | a0c4b6f34546bdd22167a76a0540d37e9a37c0cf (diff) | |
parent | 591116490cf313808e8ba05ddd066656a1d1a566 (diff) |
Merge remote-tracking branch 'origin/5.13' into dev
Conflicts:
src/corelib/tools/qstring.cpp
Change-Id: I81dbf90fc936c9bf08197baefa071117bddb1c63
Diffstat (limited to 'src/widgets')
-rw-r--r-- | src/widgets/accessible/simplewidgets.cpp | 10 | ||||
-rw-r--r-- | src/widgets/accessible/simplewidgets_p.h | 1 | ||||
-rw-r--r-- | src/widgets/dialogs/qfilesystemmodel.cpp | 4 | ||||
-rw-r--r-- | src/widgets/itemviews/qlistwidget.cpp | 4 | ||||
-rw-r--r-- | src/widgets/itemviews/qtablewidget.cpp | 4 | ||||
-rw-r--r-- | src/widgets/itemviews/qtreewidget.cpp | 4 | ||||
-rw-r--r-- | src/widgets/itemviews/qtreewidgetitemiterator.cpp | 8 | ||||
-rw-r--r-- | src/widgets/kernel/qapplication.cpp | 4 | ||||
-rw-r--r-- | src/widgets/kernel/qlayout.cpp | 8 | ||||
-rw-r--r-- | src/widgets/styles/qstylesheetstyle.cpp | 4 | ||||
-rw-r--r-- | src/widgets/util/qundoview.cpp | 2 | ||||
-rw-r--r-- | src/widgets/widgets/qlineedit.cpp | 6 | ||||
-rw-r--r-- | src/widgets/widgets/qmainwindow.cpp | 6 | ||||
-rw-r--r-- | src/widgets/widgets/qmdiarea.cpp | 6 | ||||
-rw-r--r-- | src/widgets/widgets/qmenubar.cpp | 4 | ||||
-rw-r--r-- | src/widgets/widgets/qwidgettextcontrol.cpp | 4 |
16 files changed, 48 insertions, 31 deletions
diff --git a/src/widgets/accessible/simplewidgets.cpp b/src/widgets/accessible/simplewidgets.cpp index efcf4cdc8b..716c833fc9 100644 --- a/src/widgets/accessible/simplewidgets.cpp +++ b/src/widgets/accessible/simplewidgets.cpp @@ -454,6 +454,13 @@ QAccessible::Role QAccessibleDisplay::role() const return QAccessibleWidget::role(); } +QAccessible::State QAccessibleDisplay::state() const +{ + QAccessible::State s = QAccessibleWidget::state(); + s.readOnly = true; + return s; +} + QString QAccessibleDisplay::text(QAccessible::Text t) const { QString str; @@ -732,10 +739,9 @@ QAccessible::State QAccessibleLineEdit::state() const QAccessible::State state = QAccessibleWidget::state(); QLineEdit *l = lineEdit(); + state.editable = true; if (l->isReadOnly()) state.readOnly = true; - else - state.editable = true; if (l->echoMode() != QLineEdit::Normal) state.passwordEdit = true; diff --git a/src/widgets/accessible/simplewidgets_p.h b/src/widgets/accessible/simplewidgets_p.h index fcd0e7df47..73572e3059 100644 --- a/src/widgets/accessible/simplewidgets_p.h +++ b/src/widgets/accessible/simplewidgets_p.h @@ -116,6 +116,7 @@ public: QString text(QAccessible::Text t) const override; QAccessible::Role role() const override; + QAccessible::State state() const override; QVector<QPair<QAccessibleInterface*, QAccessible::Relation> >relations(QAccessible::Relation match = QAccessible::AllRelations) const override; void *interface_cast(QAccessible::InterfaceType t) override; diff --git a/src/widgets/dialogs/qfilesystemmodel.cpp b/src/widgets/dialogs/qfilesystemmodel.cpp index d29f74e93d..e486037e08 100644 --- a/src/widgets/dialogs/qfilesystemmodel.cpp +++ b/src/widgets/dialogs/qfilesystemmodel.cpp @@ -1197,8 +1197,8 @@ QStringList QFileSystemModel::mimeTypes() const \a indexes. The format used to describe the items corresponding to the indexes is obtained from the mimeTypes() function. - If the list of indexes is empty, 0 is returned rather than a serialized - empty list. + If the list of indexes is empty, \nullptr is returned rather than a + serialized empty list. */ QMimeData *QFileSystemModel::mimeData(const QModelIndexList &indexes) const { diff --git a/src/widgets/itemviews/qlistwidget.cpp b/src/widgets/itemviews/qlistwidget.cpp index e46d25bef1..37bb370e73 100644 --- a/src/widgets/itemviews/qlistwidget.cpp +++ b/src/widgets/itemviews/qlistwidget.cpp @@ -1902,8 +1902,8 @@ QStringList QListWidget::mimeTypes() const \a items. The format used to describe the items is obtained from the mimeTypes() function. - If the list of items is empty, 0 is returned instead of a serialized empty - list. + If the list of items is empty, \nullptr is returned instead of a + serialized empty list. */ #if QT_VERSION >= QT_VERSION_CHECK(6,0,0) QMimeData *QListWidget::mimeData(const QList<QListWidgetItem *> &items) const diff --git a/src/widgets/itemviews/qtablewidget.cpp b/src/widgets/itemviews/qtablewidget.cpp index ec4897a7ae..0fb9e28385 100644 --- a/src/widgets/itemviews/qtablewidget.cpp +++ b/src/widgets/itemviews/qtablewidget.cpp @@ -2633,8 +2633,8 @@ QStringList QTableWidget::mimeTypes() const \a items. The format used to describe the items is obtained from the mimeTypes() function. - If the list of items is empty, 0 is returned rather than a serialized - empty list. + If the list of items is empty, \nullptr is returned rather than a + serialized empty list. */ #if QT_VERSION >= QT_VERSION_CHECK(6,0,0) QMimeData *QTableWidget::mimeData(const QList<QTableWidgetItem *> &items) const diff --git a/src/widgets/itemviews/qtreewidget.cpp b/src/widgets/itemviews/qtreewidget.cpp index 29cc199526..d2dc91b18c 100644 --- a/src/widgets/itemviews/qtreewidget.cpp +++ b/src/widgets/itemviews/qtreewidget.cpp @@ -3395,8 +3395,8 @@ QStringList QTreeWidget::mimeTypes() const \a items. The format used to describe the items is obtained from the mimeTypes() function. - If the list of items is empty, 0 is returned rather than a serialized - empty list. + If the list of items is empty, \nullptr is returned rather than a + serialized empty list. */ #if QT_VERSION >= QT_VERSION_CHECK(6,0,0) QMimeData *QTreeWidget::mimeData(const QList<QTreeWidgetItem *> &items) const diff --git a/src/widgets/itemviews/qtreewidgetitemiterator.cpp b/src/widgets/itemviews/qtreewidgetitemiterator.cpp index 1c1f60bc37..14c19fcb9c 100644 --- a/src/widgets/itemviews/qtreewidgetitemiterator.cpp +++ b/src/widgets/itemviews/qtreewidgetitemiterator.cpp @@ -170,7 +170,7 @@ QTreeWidgetItemIterator &QTreeWidgetItemIterator::operator=(const QTreeWidgetIte /*! The prefix ++ operator (++it) advances the iterator to the next matching item and returns a reference to the resulting iterator. - Sets the current pointer to 0 if the current item is the last matching item. + Sets the current pointer to \nullptr if the current item is the last matching item. */ QTreeWidgetItemIterator &QTreeWidgetItemIterator::operator++() @@ -185,7 +185,7 @@ QTreeWidgetItemIterator &QTreeWidgetItemIterator::operator++() /*! The prefix -- operator (--it) advances the iterator to the previous matching item and returns a reference to the resulting iterator. - Sets the current pointer to 0 if the current item is the first matching item. + Sets the current pointer to \nullptr if the current item is the first matching item. */ QTreeWidgetItemIterator &QTreeWidgetItemIterator::operator--() @@ -395,7 +395,7 @@ void QTreeWidgetItemIteratorPrivate::ensureValidIterator(const QTreeWidgetItem * iterator goes backward.) If the current item is beyond the last item, the current item pointer is - set to 0. Returns the resulting iterator. + set to \nullptr. Returns the resulting iterator. */ /*! @@ -411,7 +411,7 @@ void QTreeWidgetItemIteratorPrivate::ensureValidIterator(const QTreeWidgetItem * iterator goes forward.) If the current item is ahead of the last item, the current item pointer is - set to 0. Returns the resulting iterator. + set to \nullptr. Returns the resulting iterator. */ /*! diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp index ca48a9e145..ba8878be57 100644 --- a/src/widgets/kernel/qapplication.cpp +++ b/src/widgets/kernel/qapplication.cpp @@ -1900,8 +1900,8 @@ void QApplication::aboutQt() This signal is emitted when the widget that has keyboard focus changed from \a old to \a now, i.e., because the user pressed the tab-key, clicked into - a widget or changed the active window. Both \a old and \a now can be the - null-pointer. + a widget or changed the active window. Both \a old and \a now can be \nullptr. + The signal is emitted after both widget have been notified about the change through QFocusEvent. diff --git a/src/widgets/kernel/qlayout.cpp b/src/widgets/kernel/qlayout.cpp index 8ea93f7d4e..f71d038a5f 100644 --- a/src/widgets/kernel/qlayout.cpp +++ b/src/widgets/kernel/qlayout.cpp @@ -109,7 +109,7 @@ static int menuBarHeightForWidth(QWidget *menubar, int w) /*! Constructs a new top-level QLayout, with parent \a parent. - \a parent may not be a \nullptr. + \a parent may not be \nullptr. The layout is set directly as the top-level layout for \a parent. There can be only one top-level layout for a @@ -419,9 +419,9 @@ void QLayout::setContentsMargins(const QMargins &margins) /*! \since 4.3 - Extracts the left, top, right, and bottom margins used around the - layout, and assigns them to *\a left, *\a top, *\a right, and *\a - bottom (unless they are null pointers). + For each of \a left, \a top, \a right and \a bottom that is not + \nullptr, stores the size of the margin named in the location the + pointer refers to. By default, QLayout uses the values provided by the style. On most platforms, the margin is 11 pixels in all directions. diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp index 9c744000bd..0008f11546 100644 --- a/src/widgets/styles/qstylesheetstyle.cpp +++ b/src/widgets/styles/qstylesheetstyle.cpp @@ -4170,12 +4170,12 @@ void QStyleSheetStyle::drawControl(ControlElement ce, const QStyleOption *opt, Q if (const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(opt)) { QRenderRule subRule = renderRule(w, opt, PseudoElement_TabBarTab); QRect r = positionRect(w, subRule, PseudoElement_TabBarTab, opt->rect, opt->direction); - if (ce == CE_TabBarTabShape && subRule.hasDrawable()) { + if (ce == CE_TabBarTabShape && subRule.hasDrawable() && tab->shape < QTabBar::TriangularNorth) { subRule.drawRule(p, r); return; } QStyleOptionTab tabCopy(*tab); - subRule.configurePalette(&tabCopy.palette, QPalette::WindowText, QPalette::Window); + subRule.configurePalette(&tabCopy.palette, QPalette::WindowText, QPalette::Base); QFont oldFont = p->font(); if (subRule.hasFont) p->setFont(subRule.font); diff --git a/src/widgets/util/qundoview.cpp b/src/widgets/util/qundoview.cpp index c862cbcea5..f59d87fb9d 100644 --- a/src/widgets/util/qundoview.cpp +++ b/src/widgets/util/qundoview.cpp @@ -361,7 +361,7 @@ QUndoStack *QUndoView::stack() const Sets the stack displayed by this view to \a stack. If \a stack is 0, the view will be empty. - If the view was previously looking at a QUndoGroup, the group is set to 0. + If the view was previously looking at a QUndoGroup, the group is set to \nullptr. \sa stack(), setGroup() */ diff --git a/src/widgets/widgets/qlineedit.cpp b/src/widgets/widgets/qlineedit.cpp index 02aa703289..09b7687d8e 100644 --- a/src/widgets/widgets/qlineedit.cpp +++ b/src/widgets/widgets/qlineedit.cpp @@ -1369,6 +1369,12 @@ void QLineEdit::setReadOnly(bool enable) QEvent event(QEvent::ReadOnlyChange); QCoreApplication::sendEvent(this, &event); update(); +#ifndef QT_NO_ACCESSIBILITY + QAccessible::State changedState; + changedState.readOnly = true; + QAccessibleStateChangeEvent ev(this, changedState); + QAccessible::updateAccessibility(&ev); +#endif } } diff --git a/src/widgets/widgets/qmainwindow.cpp b/src/widgets/widgets/qmainwindow.cpp index fae3aebba4..9c4c46f2d6 100644 --- a/src/widgets/widgets/qmainwindow.cpp +++ b/src/widgets/widgets/qmainwindow.cpp @@ -596,7 +596,7 @@ QStatusBar *QMainWindow::statusBar() const /*! Sets the status bar for the main window to \a statusbar. - Setting the status bar to 0 will remove it from the main window. + Setting the status bar to \nullptr will remove it from the main window. Note that QMainWindow takes ownership of the \a statusbar pointer and deletes it at the appropriate time. @@ -1464,8 +1464,8 @@ void QMainWindow::contextMenuEvent(QContextMenuEvent *event) #if QT_CONFIG(menu) /*! Returns a popup menu containing checkable entries for the toolbars and - dock widgets present in the main window. If there are no toolbars and - dock widgets present, this function returns a null pointer. + dock widgets present in the main window. If there are no toolbars and + dock widgets present, this function returns \nullptr. By default, this function is called by the main window when the user activates a context menu, typically by right-clicking on a toolbar or a dock diff --git a/src/widgets/widgets/qmdiarea.cpp b/src/widgets/widgets/qmdiarea.cpp index 0ce561860e..fe3d1663a8 100644 --- a/src/widgets/widgets/qmdiarea.cpp +++ b/src/widgets/widgets/qmdiarea.cpp @@ -2000,9 +2000,9 @@ QMdiSubWindow *QMdiArea::addSubWindow(QWidget *widget, Qt::WindowFlags windowFla Removes \a widget from the MDI area. The \a widget must be either a QMdiSubWindow or a widget that is the internal widget of a subwindow. Note \a widget is never actually deleted by QMdiArea. - If a QMdiSubWindow is passed in its parent is set to 0 and it is - removed, but if an internal widget is passed in the child widget - is set to 0 but the QMdiSubWindow is not removed. + If a QMdiSubWindow is passed in, its parent is set to \nullptr and it is + removed; but if an internal widget is passed in, the child widget + is set to \nullptr and the QMdiSubWindow is \e not removed. \sa addSubWindow() */ diff --git a/src/widgets/widgets/qmenubar.cpp b/src/widgets/widgets/qmenubar.cpp index e7984078de..a53d7841f4 100644 --- a/src/widgets/widgets/qmenubar.cpp +++ b/src/widgets/widgets/qmenubar.cpp @@ -897,8 +897,8 @@ QAction *QMenuBar::insertMenu(QAction *before, QMenu *menu) } /*! - Returns the QAction that is currently highlighted. A null pointer - will be returned if no action is currently selected. + Returns the QAction that is currently highlighted, if any, + else \nullptr. */ QAction *QMenuBar::activeAction() const { diff --git a/src/widgets/widgets/qwidgettextcontrol.cpp b/src/widgets/widgets/qwidgettextcontrol.cpp index 209156b901..f85c7cdc6d 100644 --- a/src/widgets/widgets/qwidgettextcontrol.cpp +++ b/src/widgets/widgets/qwidgettextcontrol.cpp @@ -1985,6 +1985,8 @@ void QWidgetTextControlPrivate::inputMethodEvent(QInputMethodEvent *e) || e->preeditString() != cursor.block().layout()->preeditAreaText() || e->replacementLength() > 0; + int oldCursorPos = cursor.position(); + cursor.beginEditBlock(); if (isGettingInput) { cursor.removeSelectedText(); @@ -2089,6 +2091,8 @@ void QWidgetTextControlPrivate::inputMethodEvent(QInputMethodEvent *e) if (cursor.d) cursor.d->setX(); + if (oldCursorPos != cursor.position()) + emit q->cursorPositionChanged(); if (oldPreeditCursor != preeditCursor) emit q->microFocusChanged(); } |