summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2017-03-21 19:07:53 +0100
committerLiang Qi <liang.qi@qt.io>2017-03-21 19:07:53 +0100
commit65faf4565595d91996ddec4af25af5e97c7f0317 (patch)
treea7415e90db3fa1e46f638e1c31d2f2b9a5d0ec4a /src/plugins
parenta9383ef99a29c333a1edd32695ddc29ea0ba805d (diff)
parent26bc4ac5cb56ce8f2d3d10125fa9c6a72140573a (diff)
Merge remote-tracking branch 'origin/5.8' into 5.9
Conflicts: src/plugins/platforms/eglfs/eglfs-plugin.pro Change-Id: Id76cdbb41b7758572a3b8ea4dcb40d49bac968db
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/bearer/generic/generic.pro2
-rw-r--r--src/plugins/platforms/android/androidjniaccessibility.cpp9
-rw-r--r--src/plugins/platforms/eglfs/eglfs-plugin.pro3
-rw-r--r--src/plugins/platforms/xcb/qxcbwindow.cpp20
-rw-r--r--src/plugins/sqldrivers/psql/qsql_psql.cpp13
5 files changed, 25 insertions, 22 deletions
diff --git a/src/plugins/bearer/generic/generic.pro b/src/plugins/bearer/generic/generic.pro
index 02b3e96bfa..f30bdc4951 100644
--- a/src/plugins/bearer/generic/generic.pro
+++ b/src/plugins/bearer/generic/generic.pro
@@ -12,7 +12,7 @@ SOURCES += qgenericengine.cpp \
OTHER_FILES += generic.json
-win32:!winrt:LIBS += -lIphlpapi
+win32:!winrt:LIBS += -liphlpapi
PLUGIN_TYPE = bearer
PLUGIN_CLASS_NAME = QGenericEnginePlugin
diff --git a/src/plugins/platforms/android/androidjniaccessibility.cpp b/src/plugins/platforms/android/androidjniaccessibility.cpp
index 3b1ce6d21d..eeaecd53b4 100644
--- a/src/plugins/platforms/android/androidjniaccessibility.cpp
+++ b/src/plugins/platforms/android/androidjniaccessibility.cpp
@@ -49,6 +49,7 @@
#include <QtCore/qmath.h>
#include <QtCore/private/qjnihelpers_p.h>
#include <QtCore/private/qjni_p.h>
+#include <QtGui/private/qhighdpiscaling_p.h>
#include "qdebug.h"
@@ -137,7 +138,7 @@ namespace QtAndroidAccessibility
QRect rect;
QAccessibleInterface *iface = interfaceFromId(objectId);
if (iface && iface->isValid()) {
- rect = iface->rect();
+ rect = QHighDpi::toNativePixels(iface->rect(), iface->window());
}
jclass rectClass = env->FindClass("android/graphics/Rect");
@@ -150,11 +151,13 @@ namespace QtAndroidAccessibility
{
QAccessibleInterface *root = interfaceFromId(-1);
if (root) {
- QAccessibleInterface *child = root->childAt((int)x, (int)y);
+ QPoint pos = QHighDpi::fromNativePixels(QPoint(int(x), int(y)), root->window());
+
+ QAccessibleInterface *child = root->childAt(pos.x(), pos.y());
QAccessibleInterface *lastChild = 0;
while (child && (child != lastChild)) {
lastChild = child;
- child = child->childAt((int)x, (int)y);
+ child = child->childAt(pos.x(), pos.y());
}
if (lastChild)
return QAccessible::uniqueId(lastChild);
diff --git a/src/plugins/platforms/eglfs/eglfs-plugin.pro b/src/plugins/platforms/eglfs/eglfs-plugin.pro
index 3844328ee0..ec229796e5 100644
--- a/src/plugins/platforms/eglfs/eglfs-plugin.pro
+++ b/src/plugins/platforms/eglfs/eglfs-plugin.pro
@@ -4,6 +4,9 @@ QT += eglfsdeviceintegration-private
CONFIG += egl
+# Avoid X11 header collision, use generic EGL native types
+DEFINES += QT_EGL_NO_X11
+
SOURCES += $$PWD/qeglfsmain.cpp
OTHER_FILES += $$PWD/eglfs.json
diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp
index 3f0493669f..f6fa903ec2 100644
--- a/src/plugins/platforms/xcb/qxcbwindow.cpp
+++ b/src/plugins/platforms/xcb/qxcbwindow.cpp
@@ -898,19 +898,17 @@ void QXcbWindow::hide()
}
}
-static QWindow *tlWindow(QWindow *window)
-{
- if (window && window->parent())
- return tlWindow(window->parent());
- return window;
-}
-
bool QXcbWindow::relayFocusToModalWindow() const
{
- QWindow *w = tlWindow(static_cast<QWindowPrivate *>(QObjectPrivate::get(window()))->eventReceiver());
- QWindow *modal_window = 0;
- if (QGuiApplicationPrivate::instance()->isWindowBlocked(w,&modal_window) && modal_window != w) {
- modal_window->requestActivate();
+ QWindow *w = static_cast<QWindowPrivate *>(QObjectPrivate::get(window()))->eventReceiver();
+ // get top-level window
+ while (w && w->parent())
+ w = w->parent();
+
+ QWindow *modalWindow = 0;
+ const bool blocked = QGuiApplicationPrivate::instance()->isWindowBlocked(w, &modalWindow);
+ if (blocked && modalWindow != w) {
+ modalWindow->requestActivate();
connection()->flush();
return true;
}
diff --git a/src/plugins/sqldrivers/psql/qsql_psql.cpp b/src/plugins/sqldrivers/psql/qsql_psql.cpp
index e0f9222902..19de9a8003 100644
--- a/src/plugins/sqldrivers/psql/qsql_psql.cpp
+++ b/src/plugins/sqldrivers/psql/qsql_psql.cpp
@@ -50,7 +50,7 @@
#include <qsqlquery.h>
#include <qsocketnotifier.h>
#include <qstringlist.h>
-#include <qmutex.h>
+#include <qlocale.h>
#include <QtSql/private/qsqlresult_p.h>
#include <QtSql/private/qsqldriver_p.h>
@@ -618,13 +618,10 @@ static QString qCreateParamString(const QVector<QVariant> &boundValues, const QS
return params;
}
-Q_GLOBAL_STATIC(QMutex, qMutex)
QString qMakePreparedStmtId()
{
- qMutex()->lock();
- static unsigned int qPreparedStmtCount = 0;
- QString id = QLatin1String("qpsqlpstmt_") + QString::number(++qPreparedStmtCount, 16);
- qMutex()->unlock();
+ static QBasicAtomicInt qPreparedStmtCount = Q_BASIC_ATOMIC_INITIALIZER(0);
+ QString id = QLatin1String("qpsqlpstmt_") + QString::number(qPreparedStmtCount.fetchAndAddRelaxed(1) + 1, 16);
return id;
}
@@ -1311,7 +1308,9 @@ QString QPSQLDriver::formatValue(const QSqlField &field, bool trimStrings) const
// we force the value to be considered with a timezone information, and we force it to be UTC
// this is safe since postgresql stores only the UTC value and not the timezone offset (only used
// while parsing), so we have correct behavior in both case of with timezone and without tz
- r = QLatin1String("TIMESTAMP WITH TIME ZONE ") + QLatin1Char('\'') + field.value().toDateTime().toUTC().toString(QLatin1String("yyyy-MM-ddThh:mm:ss.zzz")) + QLatin1Char('Z') + QLatin1Char('\'');
+ r = QLatin1String("TIMESTAMP WITH TIME ZONE ") + QLatin1Char('\'') +
+ QLocale::c().toString(field.value().toDateTime().toUTC(), QLatin1String("yyyy-MM-ddThh:mm:ss.zzz")) +
+ QLatin1Char('Z') + QLatin1Char('\'');
} else {
r = QLatin1String("NULL");
}