summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@theqtcompany.com>2015-02-10 09:32:16 +0100
committerFrederik Gladhorn <frederik.gladhorn@theqtcompany.com>2015-02-10 09:42:25 +0100
commitfc35f714340d5361231506dfbead132122f59460 (patch)
treefd80498d9417c87b386a011f5849f1e4e48ad3fa /src/gui/kernel
parent6389160f04322449c34bd1ecfe53983e3b588943 (diff)
parent0d990b9ca117514fe83f53b39f25d6272304f2fb (diff)
Merge remote-tracking branch 'origin/5.4' into dev
Conflicts: src/3rdparty/harfbuzz-ng/harfbuzz-ng.pro src/gui/image/qimage_conversions.cpp src/gui/opengl/qopenglextensions_p.h src/gui/text/qtextengine.cpp src/network/ssl/qsslsocket_openssl.cpp src/plugins/platforms/eglfs/qeglfshooks_stub.cpp src/plugins/platforms/eglfs/qeglfsscreen.cpp src/plugins/platforms/eglfs/qeglfswindow.cpp src/plugins/platforms/windows/qwindowsfontdatabase.cpp src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp src/plugins/platforms/windows/qwindowsnativeinterface.cpp src/plugins/platforms/windows/qwindowsscreen.cpp src/plugins/platforms/windows/qwindowswindow.cpp src/plugins/platforms/windows/qwindowswindow.h src/plugins/platforms/xcb/qxcbdrag.h src/widgets/itemviews/qabstractitemview.cpp src/widgets/kernel/qwidget.cpp src/widgets/util/qsystemtrayicon_p.h tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp Thanks to Friedemann Kleint for resolving the qwindowsfontdatabase.cpp conflicts. Change-Id: I937232c30523d5121c195d947d92aec6f129b03e
Diffstat (limited to 'src/gui/kernel')
-rw-r--r--src/gui/kernel/qdnd.cpp3
-rw-r--r--src/gui/kernel/qguiapplication.cpp11
-rw-r--r--src/gui/kernel/qplatformdrag.cpp12
-rw-r--r--src/gui/kernel/qplatformdrag.h2
-rw-r--r--src/gui/kernel/qscreen_p.h3
5 files changed, 27 insertions, 4 deletions
diff --git a/src/gui/kernel/qdnd.cpp b/src/gui/kernel/qdnd.cpp
index f515fe18df..2a6cc4fc99 100644
--- a/src/gui/kernel/qdnd.cpp
+++ b/src/gui/kernel/qdnd.cpp
@@ -134,7 +134,8 @@ Qt::DropAction QDragManager::drag(QDrag *o)
QGuiApplicationPrivate::instance()->notifyDragStarted(o);
const Qt::DropAction result = m_platformDrag->drag(m_object);
m_object = 0;
- o->deleteLater();
+ if (!m_platformDrag->ownsDragObject())
+ o->deleteLater();
return result;
}
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp
index 92be903b41..326d9a7b52 100644
--- a/src/gui/kernel/qguiapplication.cpp
+++ b/src/gui/kernel/qguiapplication.cpp
@@ -2572,9 +2572,14 @@ void QGuiApplicationPrivate::reportRefreshRateChange(QWindowSystemInterfacePriva
return;
QScreen *s = e->screen.data();
- s->d_func()->refreshRate = e->rate;
-
- emit s->refreshRateChanged(s->refreshRate());
+ qreal rate = e->rate;
+ // safeguard ourselves against buggy platform behavior...
+ if (rate < 1.0)
+ rate = 60.0;
+ if (!qFuzzyCompare(s->d_func()->refreshRate, rate)) {
+ s->d_func()->refreshRate = rate;
+ emit s->refreshRateChanged(s->refreshRate());
+ }
}
void QGuiApplicationPrivate::processExposeEvent(QWindowSystemInterfacePrivate::ExposeEvent *e)
diff --git a/src/gui/kernel/qplatformdrag.cpp b/src/gui/kernel/qplatformdrag.cpp
index 8a5c7264d1..326f092ead 100644
--- a/src/gui/kernel/qplatformdrag.cpp
+++ b/src/gui/kernel/qplatformdrag.cpp
@@ -241,6 +241,18 @@ QPixmap QPlatformDrag::defaultPixmap()
return *qt_drag_default_pixmap();
}
+/*!
+ \since 5.4
+ \brief Returns bool indicating whether QPlatformDrag takes ownership
+ and therefore responsibility of deleting the QDrag object passed in
+ from QPlatformDrag::drag. This can be useful on platforms where QDrag
+ object has to be kept around.
+ */
+bool QPlatformDrag::ownsDragObject() const
+{
+ return false;
+}
+
#endif // QT_NO_DRAGANDDROP
QT_END_NAMESPACE
diff --git a/src/gui/kernel/qplatformdrag.h b/src/gui/kernel/qplatformdrag.h
index 34ad11e45f..ce7a9aa1f2 100644
--- a/src/gui/kernel/qplatformdrag.h
+++ b/src/gui/kernel/qplatformdrag.h
@@ -98,6 +98,8 @@ public:
static QPixmap defaultPixmap();
+ virtual bool ownsDragObject() const;
+
private:
QPlatformDragPrivate *d_ptr;
diff --git a/src/gui/kernel/qscreen_p.h b/src/gui/kernel/qscreen_p.h
index cdb923c429..53d4f3404a 100644
--- a/src/gui/kernel/qscreen_p.h
+++ b/src/gui/kernel/qscreen_p.h
@@ -64,6 +64,9 @@ public:
availableGeometry = platformScreen->availableGeometry();
logicalDpi = platformScreen->logicalDpi();
refreshRate = platformScreen->refreshRate();
+ // safeguard ourselves against buggy platform behavior...
+ if (refreshRate < 1.0)
+ refreshRate = 60.0;
updatePrimaryOrientation();