summaryrefslogtreecommitdiffstats
path: root/src/widgets/kernel
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2017-01-26 00:37:14 +0000
committerThe Qt Project <gerrit-noreply@qt-project.org>2017-01-26 00:37:14 +0000
commit398a7e736cb42ac42f0887989585b1121b7e6e62 (patch)
tree916854b706b9b057fa1483f76dd48998a8aa28a0 /src/widgets/kernel
parent4d3a35f63788fa5ff7a11a5bb7bd6176bd2ac70e (diff)
parent318b58562ae89453fb98e8145cd0440e14ba60b0 (diff)
Merge "Merge remote-tracking branch 'origin/5.8' into dev" into refs/staging/dev
Diffstat (limited to 'src/widgets/kernel')
-rw-r--r--src/widgets/kernel/qapplication.cpp12
-rw-r--r--src/widgets/kernel/qshortcut.cpp8
-rw-r--r--src/widgets/kernel/qwidget.cpp8
3 files changed, 15 insertions, 13 deletions
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp
index 84891be7f8..008b2a0d77 100644
--- a/src/widgets/kernel/qapplication.cpp
+++ b/src/widgets/kernel/qapplication.cpp
@@ -3282,7 +3282,7 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
QWheelEvent we(relpos, wheel->globalPos(), wheel->pixelDelta(), wheel->angleDelta(), wheel->delta(), wheel->orientation(), wheel->buttons(),
wheel->modifiers(), phase, wheel->source(), wheel->inverted());
bool eventAccepted;
- while (w) {
+ do {
we.spont = spontaneous && w == receiver;
we.ignore();
res = d->notify_helper(w, &we);
@@ -3300,7 +3300,7 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
we.p += w->pos();
w = w->parentWidget();
- }
+ } while (w);
wheel->setAccepted(eventAccepted);
} else if (!spontaneous) {
// wheel_widget may forward the wheel event to a delegate widget,
@@ -4476,9 +4476,13 @@ void QApplicationPrivate::notifyThemeChanged()
#ifndef QT_NO_DRAGANDDROP
void QApplicationPrivate::notifyDragStarted(const QDrag *drag)
{
- // Prevent pickMouseReceiver() from using the widget where the drag was started after a drag operation.
QGuiApplicationPrivate::notifyDragStarted(drag);
- qt_button_down = 0;
+ // QTBUG-26145
+ // Prevent pickMouseReceiver() from using the widget where the drag was started after a drag operation...
+ // QTBUG-56713
+ // ...only if qt_button_down is not a QQuickWidget
+ if (qt_button_down && !qt_button_down->inherits("QQuickWidget"))
+ qt_button_down = nullptr;
}
#endif // QT_NO_DRAGANDDROP
diff --git a/src/widgets/kernel/qshortcut.cpp b/src/widgets/kernel/qshortcut.cpp
index 6eec5ff7e8..be5788274e 100644
--- a/src/widgets/kernel/qshortcut.cpp
+++ b/src/widgets/kernel/qshortcut.cpp
@@ -141,9 +141,11 @@ bool qWidgetShortcutContextMatcher(QObject *object, Qt::ShortcutContext context)
static bool correctWidgetContext(Qt::ShortcutContext context, QWidget *w, QWidget *active_window)
{
bool visible = w->isVisible();
-#if defined(Q_OS_DARWIN) && !defined(QT_NO_MENUBAR)
- if (!qApp->testAttribute(Qt::AA_DontUseNativeMenuBar) && qobject_cast<QMenuBar *>(w))
- visible = true;
+#ifndef QT_NO_MENUBAR
+ if (QMenuBar *menuBar = qobject_cast<QMenuBar *>(w)) {
+ if (menuBar->isNativeMenuBar())
+ visible = true;
+ }
#endif
if (!visible || !w->isEnabled())
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index 61956b3fa4..759821a057 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -2526,10 +2526,6 @@ QWidget *QWidget::find(WId id)
If a widget is non-native (alien) and winId() is invoked on it, that widget
will be provided a native handle.
- On \macos, the type returned depends on which framework Qt was linked
- against. If Qt is using Carbon, the {WId} is actually an HIViewRef. If Qt
- is using Cocoa, {WId} is a pointer to an NSView.
-
This value may change at run-time. An event with type QEvent::WinIdChange
will be sent to the widget following a change in window system identifier.
@@ -9988,8 +9984,8 @@ bool QWidget::nativeEvent(const QByteArray &eventType, void *message, long *resu
}
/*!
- Ensures that the widget has been polished by QStyle (i.e., has a
- proper font and palette).
+ Ensures that the widget and its children have been polished by
+ QStyle (i.e., have a proper font and palette).
QWidget calls this function after it has been fully constructed
but before it is shown the very first time. You can call this