summaryrefslogtreecommitdiffstats
path: root/src/widgets/widgets
diff options
context:
space:
mode:
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 35c54f102f..4a5ae6578a 100644
--- a/src/widgets/widgets/qcombobox.cpp
+++ b/src/widgets/widgets/qcombobox.cpp
@@ -1311,8 +1311,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
}
@@ -2830,8 +2830,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
}
@@ -2844,8 +2844,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
}
@@ -2858,8 +2858,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
}
@@ -3004,8 +3004,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 8c79425e44..df26db57ae 100644
--- a/src/widgets/widgets/qdockarealayout.cpp
+++ b/src/widgets/widgets/qdockarealayout.cpp
@@ -1944,12 +1944,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 ea3e4c4488..744fecb3f3 100644
--- a/src/widgets/widgets/qmenu.cpp
+++ b/src/widgets/widgets/qmenu.cpp
@@ -584,7 +584,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 8b29011178..5322a8f3f5 100644
--- a/src/widgets/widgets/qmenu_mac.mm
+++ b/src/widgets/widgets/qmenu_mac.mm
@@ -98,15 +98,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 0d4c6b25c4..46f903fa1e 100644
--- a/src/widgets/widgets/qscrollbar.cpp
+++ b/src/widgets/widgets/qscrollbar.cpp
@@ -479,8 +479,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 69432761e6..f866fe8bda 100644
--- a/src/widgets/widgets/qtoolbutton.cpp
+++ b/src/widgets/widgets/qtoolbutton.cpp
@@ -120,7 +120,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
@@ -147,8 +147,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
@@ -820,7 +820,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
@@ -961,8 +961,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;