summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2017-04-20 11:19:14 +0200
committerLiang Qi <liang.qi@qt.io>2017-04-20 12:31:27 +0200
commit7950b6b283549c98f1e0f981c84b68071a13b616 (patch)
treecf7281872045ebd57c68e10064ff0f400084aa13 /src/gui/kernel
parent58d2927861d3e57cac4f6db599e209d2bfb17a2c (diff)
parent0794d61c822585530243f638687b8a75f0a15d0c (diff)
Merge remote-tracking branch 'origin/5.9' into dev
Conflicts: src/corelib/tools/qbytearray.h src/corelib/tools/qdatetime.h src/corelib/tools/qstring.h src/corelib/tools/qversionnumber.h src/plugins/platforms/android/qandroidplatformintegration.cpp tests/auto/corelib/tools/qhashfunctions/tst_qhashfunctions.cpp Change-Id: Iefd92a435e687a76cd593099e40d9a9620a1454d
Diffstat (limited to 'src/gui/kernel')
-rw-r--r--src/gui/kernel/qevent.cpp14
-rw-r--r--src/gui/kernel/qguiapplication.cpp14
-rw-r--r--src/gui/kernel/qopenglwindow.cpp4
-rw-r--r--src/gui/kernel/qplatformgraphicsbuffer.cpp2
-rw-r--r--src/gui/kernel/qplatformsystemtrayicon.cpp7
-rw-r--r--src/gui/kernel/qtouchdevice.cpp5
-rw-r--r--src/gui/kernel/qwindow.cpp4
7 files changed, 39 insertions, 11 deletions
diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp
index ac9edc8eb0..2777e408c1 100644
--- a/src/gui/kernel/qevent.cpp
+++ b/src/gui/kernel/qevent.cpp
@@ -4090,6 +4090,20 @@ QDebug operator<<(QDebug dbg, const QEvent *e)
}
dbg << ')';
break;
+ case QEvent::ScrollPrepare: {
+ const QScrollPrepareEvent *se = static_cast<const QScrollPrepareEvent *>(e);
+ dbg << "QScrollPrepareEvent(viewportSize=" << se->viewportSize()
+ << ", contentPosRange=" << se->contentPosRange()
+ << ", contentPos=" << se->contentPos() << ')';
+ }
+ break;
+ case QEvent::Scroll: {
+ const QScrollEvent *se = static_cast<const QScrollEvent *>(e);
+ dbg << "QScrollEvent(contentPos=" << se->contentPos()
+ << ", overshootDistance=" << se->overshootDistance()
+ << ", scrollState=" << se->scrollState() << ')';
+ }
+ break;
default:
dbg << eventClassName(type) << '(';
QtDebugUtils::formatQEnum(dbg, type);
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp
index a3b2c4c1e4..56f112c36c 100644
--- a/src/gui/kernel/qguiapplication.cpp
+++ b/src/gui/kernel/qguiapplication.cpp
@@ -2027,13 +2027,23 @@ void QGuiApplicationPrivate::processKeyEvent(QWindowSystemInterfacePrivate::KeyE
window = QGuiApplication::focusWindow();
}
+#if defined(Q_OS_ANDROID)
+ static bool backKeyPressAccepted = false;
+ static bool menuKeyPressAccepted = false;
+#endif
+
#if !defined(Q_OS_OSX)
// FIXME: Include OS X in this code path by passing the key event through
// QPlatformInputContext::filterEvent().
if (e->keyType == QEvent::KeyPress && window) {
if (QWindowSystemInterface::handleShortcutEvent(window, e->timestamp, e->key, e->modifiers,
- e->nativeScanCode, e->nativeVirtualKey, e->nativeModifiers, e->unicode, e->repeat, e->repeatCount))
+ e->nativeScanCode, e->nativeVirtualKey, e->nativeModifiers, e->unicode, e->repeat, e->repeatCount)) {
+#if defined(Q_OS_ANDROID)
+ backKeyPressAccepted = e->key == Qt::Key_Back;
+ menuKeyPressAccepted = e->key == Qt::Key_Menu;
+#endif
return;
+ }
}
#endif
@@ -2050,8 +2060,6 @@ void QGuiApplicationPrivate::processKeyEvent(QWindowSystemInterfacePrivate::KeyE
else
ev.setAccepted(false);
- static bool backKeyPressAccepted = false;
- static bool menuKeyPressAccepted = false;
if (e->keyType == QEvent::KeyPress) {
backKeyPressAccepted = e->key == Qt::Key_Back && ev.isAccepted();
menuKeyPressAccepted = e->key == Qt::Key_Menu && ev.isAccepted();
diff --git a/src/gui/kernel/qopenglwindow.cpp b/src/gui/kernel/qopenglwindow.cpp
index e1bd3d11b2..5170c7ab63 100644
--- a/src/gui/kernel/qopenglwindow.cpp
+++ b/src/gui/kernel/qopenglwindow.cpp
@@ -528,7 +528,9 @@ QImage QOpenGLWindow::grabFramebuffer()
return QImage();
makeCurrent();
- return qt_gl_read_framebuffer(size() * devicePixelRatio(), false, false);
+ QImage img = qt_gl_read_framebuffer(size() * devicePixelRatio(), false, false);
+ img.setDevicePixelRatio(devicePixelRatio());
+ return img;
}
/*!
diff --git a/src/gui/kernel/qplatformgraphicsbuffer.cpp b/src/gui/kernel/qplatformgraphicsbuffer.cpp
index 8080cb91ad..d42231e958 100644
--- a/src/gui/kernel/qplatformgraphicsbuffer.cpp
+++ b/src/gui/kernel/qplatformgraphicsbuffer.cpp
@@ -63,6 +63,8 @@ QT_BEGIN_NAMESPACE
QPlatformGraphicsBuffer is intended to be created by using platform specific
APIs available from QtPlatformHeaders, or there might be accessor functions
similar to the accessor function that QPlatformBackingstore has.
+
+ \internal
*/
/*!
diff --git a/src/gui/kernel/qplatformsystemtrayicon.cpp b/src/gui/kernel/qplatformsystemtrayicon.cpp
index 973b998059..5481997b3c 100644
--- a/src/gui/kernel/qplatformsystemtrayicon.cpp
+++ b/src/gui/kernel/qplatformsystemtrayicon.cpp
@@ -52,6 +52,7 @@ QT_BEGIN_NAMESPACE
\inmodule QtGui
\brief The QPlatformSystemTrayIcon class abstracts the system tray icon and interaction.
+ \internal
\sa QSystemTrayIcon
*/
@@ -82,16 +83,10 @@ QT_BEGIN_NAMESPACE
\sa activated()
*/
-/*!
- \internal
- */
QPlatformSystemTrayIcon::QPlatformSystemTrayIcon()
{
}
-/*!
- \internal
- */
QPlatformSystemTrayIcon::~QPlatformSystemTrayIcon()
{
}
diff --git a/src/gui/kernel/qtouchdevice.cpp b/src/gui/kernel/qtouchdevice.cpp
index 97cc8d179d..0f13412fb1 100644
--- a/src/gui/kernel/qtouchdevice.cpp
+++ b/src/gui/kernel/qtouchdevice.cpp
@@ -215,7 +215,10 @@ static void cleanupDevicesList()
/*!
Returns a list of all registered devices.
- \note The returned list cannot be used to add new devices. Use QWindowSystemInterface::registerTouchDevice() instead.
+ \note The returned list cannot be used to add new devices. To add a simulated
+ touch screen for an autotest, QTest::createTouchDevice() can be used.
+ To add real touch screens to QPA plugins, the private
+ \c QWindowSystemInterface::registerTouchDevice() function can be used.
*/
QList<const QTouchDevice *> QTouchDevice::devices()
{
diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp
index 3f5f71002b..6e7be2aec2 100644
--- a/src/gui/kernel/qwindow.cpp
+++ b/src/gui/kernel/qwindow.cpp
@@ -1317,6 +1317,10 @@ void QWindow::setTransientParent(QWindow *parent)
qWarning() << parent << "must be a top level window.";
return;
}
+ if (parent == this) {
+ qWarning() << "transient parent" << parent << "can not be same as window";
+ return;
+ }
d->transientParent = parent;