summaryrefslogtreecommitdiffstats
path: root/src/widgets/widgets
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@theqtcompany.com>2016-02-02 15:57:44 +0100
committerLiang Qi <liang.qi@theqtcompany.com>2016-02-02 15:57:44 +0100
commitd3e6e732c70ebc2340d6376d727b3c623be23810 (patch)
tree18d469f02ac36edd04b87a9bfa4886ceef0490f0 /src/widgets/widgets
parentfdfd63053ae6b10af06553be3c1b15de274bebf7 (diff)
parentba8d3430029d8c4342e9a47c110ee8c9879818f4 (diff)
Merge remote-tracking branch 'origin/5.6' into dev
Conflicts: config.tests/unix/compile.test src/plugins/platforms/cocoa/qcocoahelpers.mm src/tools/qlalr/cppgenerator.cpp Change-Id: I0103ca076a9aca7118b2fd99f0fdaf81055998c3
Diffstat (limited to 'src/widgets/widgets')
-rw-r--r--src/widgets/widgets/qcombobox.cpp20
-rw-r--r--src/widgets/widgets/qdockarealayout.cpp8
-rw-r--r--src/widgets/widgets/qmenu.cpp4
-rw-r--r--src/widgets/widgets/qmenu_mac.mm8
-rw-r--r--src/widgets/widgets/qscrollbar.cpp4
-rw-r--r--src/widgets/widgets/qtoolbutton.cpp12
6 files changed, 26 insertions, 30 deletions
diff --git a/src/widgets/widgets/qcombobox.cpp b/src/widgets/widgets/qcombobox.cpp
index 2c32acf701..46507e3e3c 100644
--- a/src/widgets/widgets/qcombobox.cpp
+++ b/src/widgets/widgets/qcombobox.cpp
@@ -1317,8 +1317,8 @@ void QComboBoxPrivate::_q_emitCurrentIndexChanged(const QModelIndex &index)
if (!lineEdit)
emit q->currentTextChanged(text);
#ifndef QT_NO_ACCESSIBILITY
- QAccessibleValueChangeEvent event(q, text);
- QAccessible::updateAccessibility(&event);
+ QAccessibleValueChangeEvent event(q, text);
+ QAccessible::updateAccessibility(&event);
#endif
}
@@ -2838,8 +2838,8 @@ void QComboBox::clear()
Q_D(QComboBox);
d->model->removeRows(0, d->model->rowCount(d->root), d->root);
#ifndef QT_NO_ACCESSIBILITY
- QAccessibleValueChangeEvent event(this, QString());
- QAccessible::updateAccessibility(&event);
+ QAccessibleValueChangeEvent event(this, QString());
+ QAccessible::updateAccessibility(&event);
#endif
}
@@ -2852,8 +2852,8 @@ void QComboBox::clearEditText()
if (d->lineEdit)
d->lineEdit->clear();
#ifndef QT_NO_ACCESSIBILITY
- QAccessibleValueChangeEvent event(this, QString());
- QAccessible::updateAccessibility(&event);
+ QAccessibleValueChangeEvent event(this, QString());
+ QAccessible::updateAccessibility(&event);
#endif
}
@@ -2866,8 +2866,8 @@ void QComboBox::setEditText(const QString &text)
if (d->lineEdit)
d->lineEdit->setText(text);
#ifndef QT_NO_ACCESSIBILITY
- QAccessibleValueChangeEvent event(this, text);
- QAccessible::updateAccessibility(&event);
+ QAccessibleValueChangeEvent event(this, text);
+ QAccessible::updateAccessibility(&event);
#endif
}
@@ -3012,8 +3012,8 @@ bool QComboBox::event(QEvent *event)
case QEvent::HoverEnter:
case QEvent::HoverLeave:
case QEvent::HoverMove:
- if (const QHoverEvent *he = static_cast<const QHoverEvent *>(event))
- d->updateHoverControl(he->pos());
+ if (const QHoverEvent *he = static_cast<const QHoverEvent *>(event))
+ d->updateHoverControl(he->pos());
break;
case QEvent::ShortcutOverride:
if (d->lineEdit)
diff --git a/src/widgets/widgets/qdockarealayout.cpp b/src/widgets/widgets/qdockarealayout.cpp
index 030472f757..69be43a51e 100644
--- a/src/widgets/widgets/qdockarealayout.cpp
+++ b/src/widgets/widgets/qdockarealayout.cpp
@@ -1950,12 +1950,8 @@ bool QDockAreaLayoutInfo::restoreState(QDataStream &stream, QList<QDockWidget*>
qt_mac_set_drawer_preferred_edge(widget, toDockWidgetArea(dockPos));
} else
#endif
- if (!testing) {
- QRect r(x, y, w, h);
- r = QDockAreaLayout::constrainedRect(r, widget);
- widget->move(r.topLeft());
- widget->resize(r.size());
- }
+ if (!testing)
+ widget->setGeometry(QDockAreaLayout::constrainedRect(QRect(x, y, w, h), widget));
if (!testing) {
widget->setVisible(flags & StateFlagVisible);
diff --git a/src/widgets/widgets/qmenu.cpp b/src/widgets/widgets/qmenu.cpp
index 02215c4129..ae20159473 100644
--- a/src/widgets/widgets/qmenu.cpp
+++ b/src/widgets/widgets/qmenu.cpp
@@ -590,7 +590,9 @@ void QMenuPrivate::setCurrentAction(QAction *action, int popup, SelectionReason
if (reason != SelectedFromKeyboard) {
if (QMenu *menu = qobject_cast<QMenu*>(causedPopup.widget)) {
if (causedPopup.action && menu->d_func()->activeMenu == q)
- menu->d_func()->setCurrentAction(causedPopup.action, 0, reason, false);
+ // Reselect parent menu action only if mouse is over a menu and parent menu action is not already selected (QTBUG-47987)
+ if (hasReceievedEnter && menu->d_func()->currentAction != causedPopup.action)
+ menu->d_func()->setCurrentAction(causedPopup.action, 0, reason, false);
}
}
diff --git a/src/widgets/widgets/qmenu_mac.mm b/src/widgets/widgets/qmenu_mac.mm
index 3cc572cb37..c24779d61f 100644
--- a/src/widgets/widgets/qmenu_mac.mm
+++ b/src/widgets/widgets/qmenu_mac.mm
@@ -104,15 +104,13 @@ void QMenu::setAsDockMenu()
/*! \fn void qt_mac_set_dock_menu(QMenu *menu)
- \since 5.2
+ \relates QMenu
\deprecated
- Set this menu to be the dock menu available by option-clicking
+ Sets this \a menu to be the dock menu available by option-clicking
on the application dock icon. Available on OS X only.
- Deprecated; use QMenu:setAsDockMenu() instead.
-
- \sa QMenu:setAsDockMenu()
+ Deprecated; use \l QMenu::setAsDockMenu() instead.
*/
void QMenuPrivate::moveWidgetToPlatformItem(QWidget *widget, QPlatformMenuItem* item)
diff --git a/src/widgets/widgets/qscrollbar.cpp b/src/widgets/widgets/qscrollbar.cpp
index 89f8ba46cf..7399601c2e 100644
--- a/src/widgets/widgets/qscrollbar.cpp
+++ b/src/widgets/widgets/qscrollbar.cpp
@@ -485,8 +485,8 @@ bool QScrollBar::event(QEvent *event)
case QEvent::HoverEnter:
case QEvent::HoverLeave:
case QEvent::HoverMove:
- if (const QHoverEvent *he = static_cast<const QHoverEvent *>(event))
- d_func()->updateHoverControl(he->pos());
+ if (const QHoverEvent *he = static_cast<const QHoverEvent *>(event))
+ d_func()->updateHoverControl(he->pos());
break;
case QEvent::StyleChange:
d_func()->setTransient(style()->styleHint(QStyle::SH_ScrollBar_Transient, 0, this));
diff --git a/src/widgets/widgets/qtoolbutton.cpp b/src/widgets/widgets/qtoolbutton.cpp
index d5bbe14b25..664aec9a53 100644
--- a/src/widgets/widgets/qtoolbutton.cpp
+++ b/src/widgets/widgets/qtoolbutton.cpp
@@ -126,7 +126,7 @@ bool QToolButtonPrivate::hasMenu() const
One classic use of a tool button is to select tools; for example,
the "pen" tool in a drawing program. This would be implemented
- by using a QToolButton as a toggle button (see setToggleButton()).
+ by using a QToolButton as a toggle button (see setCheckable()).
QToolButton supports auto-raising. In auto-raise mode, the button
draws a 3D frame only when the mouse points at it. The feature is
@@ -153,8 +153,8 @@ bool QToolButtonPrivate::hasMenu() const
menu set. The default mode is DelayedPopupMode which is sometimes
used with the "Back" button in a web browser. After pressing and
holding the button down for a while, a menu pops up showing a list
- of possible pages to jump to. The default delay is 600 ms; you can
- adjust it with setPopupDelay().
+ of possible pages to jump to. The timeout is style dependent,
+ see QStyle::SH_ToolButton_PopupDelay.
\table 100%
\row \li \inlineimage assistant-toolbar.png Qt Assistant's toolbar with tool buttons
@@ -826,7 +826,7 @@ void QToolButtonPrivate::_q_menuTriggered(QAction *action)
a menu set or contains a list of actions.
\value DelayedPopup After pressing and holding the tool button
- down for a certain amount of time (the timeout is style dependant,
+ down for a certain amount of time (the timeout is style dependent,
see QStyle::SH_ToolButton_PopupDelay), the menu is displayed. A
typical application example is the "back" button in some web
browsers's tool bars. If the user clicks it, the browser simply
@@ -967,8 +967,8 @@ bool QToolButton::event(QEvent *event)
case QEvent::HoverEnter:
case QEvent::HoverLeave:
case QEvent::HoverMove:
- if (const QHoverEvent *he = static_cast<const QHoverEvent *>(event))
- d_func()->updateHoverControl(he->pos());
+ if (const QHoverEvent *he = static_cast<const QHoverEvent *>(event))
+ d_func()->updateHoverControl(he->pos());
break;
default:
break;