summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2016-07-15 20:47:57 +0200
committerEdward Welbourne <edward.welbourne@qt.io>2016-07-15 20:47:57 +0200
commit82ea53ad24c92b345ac2b542a174887f5de5723a (patch)
tree7d326274b52bbedac481be522a20732f77457073 /src/gui
parente46e112eb10850801218bd810ecaeb8fd29f4c34 (diff)
parent178ab885626bcd67507fde7f67f65c1872ac3be3 (diff)
Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts: qmake/library/qmakeevaluator.cpp One side changed the iterator to use ranged-for, the other changed its body; they only conflicted because the latter had to add braces around the body, intruding on the for-line. Trivial resolution. Change-Id: Ib487bc3bd6e3c5225db15f94b9a8f6caaa33456b
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/accessible/qaccessible.cpp4
-rw-r--r--src/gui/accessible/qaccessiblecache.cpp9
-rw-r--r--src/gui/accessible/qaccessiblecache_p.h2
-rw-r--r--src/gui/kernel/qguiapplication.cpp47
-rw-r--r--src/gui/opengl/qopenglframebufferobject.cpp5
5 files changed, 40 insertions, 27 deletions
diff --git a/src/gui/accessible/qaccessible.cpp b/src/gui/accessible/qaccessible.cpp
index 757543281c..e95315aea8 100644
--- a/src/gui/accessible/qaccessible.cpp
+++ b/src/gui/accessible/qaccessible.cpp
@@ -758,7 +758,7 @@ void QAccessible::deleteAccessibleInterface(Id id)
*/
QAccessible::Id QAccessible::uniqueId(QAccessibleInterface *iface)
{
- Id id = QAccessibleCache::instance()->idToInterface.key(iface);
+ Id id = QAccessibleCache::instance()->idForInterface(iface);
if (!id)
id = registerAccessibleInterface(iface);
return id;
@@ -771,7 +771,7 @@ QAccessible::Id QAccessible::uniqueId(QAccessibleInterface *iface)
*/
QAccessibleInterface *QAccessible::accessibleInterface(Id id)
{
- return QAccessibleCache::instance()->idToInterface.value(id);
+ return QAccessibleCache::instance()->interfaceForId(id);
}
diff --git a/src/gui/accessible/qaccessiblecache.cpp b/src/gui/accessible/qaccessiblecache.cpp
index 6fbe9b5582..43c4b15cb0 100644
--- a/src/gui/accessible/qaccessiblecache.cpp
+++ b/src/gui/accessible/qaccessiblecache.cpp
@@ -83,6 +83,11 @@ QAccessibleInterface *QAccessibleCache::interfaceForId(QAccessible::Id id) const
return idToInterface.value(id);
}
+QAccessible::Id QAccessibleCache::idForInterface(QAccessibleInterface *iface) const
+{
+ return interfaceToId.value(iface);
+}
+
QAccessible::Id QAccessibleCache::insert(QObject *object, QAccessibleInterface *iface) const
{
Q_ASSERT(iface);
@@ -90,7 +95,7 @@ QAccessible::Id QAccessibleCache::insert(QObject *object, QAccessibleInterface *
// object might be 0
Q_ASSERT(!objectToId.contains(object));
- Q_ASSERT_X(!idToInterface.values().contains(iface), "", "Accessible interface inserted into cache twice!");
+ Q_ASSERT_X(!interfaceToId.contains(iface), "", "Accessible interface inserted into cache twice!");
QAccessible::Id id = acquireId();
QObject *obj = iface->object();
@@ -100,6 +105,7 @@ QAccessible::Id QAccessibleCache::insert(QObject *object, QAccessibleInterface *
connect(obj, &QObject::destroyed, this, &QAccessibleCache::objectDestroyed);
}
idToInterface.insert(id, iface);
+ interfaceToId.insert(iface, id);
return id;
}
@@ -115,6 +121,7 @@ void QAccessibleCache::objectDestroyed(QObject* obj)
void QAccessibleCache::deleteInterface(QAccessible::Id id, QObject *obj)
{
QAccessibleInterface *iface = idToInterface.take(id);
+ interfaceToId.take(iface);
if (!obj)
obj = iface->object();
if (obj)
diff --git a/src/gui/accessible/qaccessiblecache_p.h b/src/gui/accessible/qaccessiblecache_p.h
index b1fc0bbee5..a9208702e4 100644
--- a/src/gui/accessible/qaccessiblecache_p.h
+++ b/src/gui/accessible/qaccessiblecache_p.h
@@ -70,6 +70,7 @@ class Q_GUI_EXPORT QAccessibleCache :public QObject
public:
static QAccessibleCache *instance();
QAccessibleInterface *interfaceForId(QAccessible::Id id) const;
+ QAccessible::Id idForInterface(QAccessibleInterface *iface) const;
QAccessible::Id insert(QObject *object, QAccessibleInterface *iface) const;
void deleteInterface(QAccessible::Id id, QObject *obj = 0);
@@ -85,6 +86,7 @@ private:
QAccessible::Id acquireId() const;
mutable QHash<QAccessible::Id, QAccessibleInterface *> idToInterface;
+ mutable QHash<QAccessibleInterface *, QAccessible::Id> interfaceToId;
mutable QHash<QObject *, QAccessible::Id> objectToId;
#ifdef Q_OS_MAC
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp
index 137310ffbd..33b3d3f715 100644
--- a/src/gui/kernel/qguiapplication.cpp
+++ b/src/gui/kernel/qguiapplication.cpp
@@ -3331,28 +3331,6 @@ bool QGuiApplication::isSavingSession() const
return d->is_saving_session;
}
-/*!
- \since 5.2
-
- Function that can be used to sync Qt state with the Window Systems state.
-
- This function will first empty Qts events by calling QCoreApplication::processEvents(),
- then the platform plugin will sync up with the windowsystem, and finally Qts events
- will be delived by another call to QCoreApplication::processEvents();
-
- This function is timeconsuming and its use is discouraged.
-*/
-void QGuiApplication::sync()
-{
- QCoreApplication::processEvents();
- if (QGuiApplicationPrivate::platform_integration
- && QGuiApplicationPrivate::platform_integration->hasCapability(QPlatformIntegration::SyncState)) {
- QGuiApplicationPrivate::platform_integration->sync();
- QCoreApplication::processEvents();
- QWindowSystemInterface::flushWindowSystemEvents();
- }
-}
-
void QGuiApplicationPrivate::commitData()
{
Q_Q(QGuiApplication);
@@ -3378,6 +3356,28 @@ void QGuiApplicationPrivate::saveState()
#endif //QT_NO_SESSIONMANAGER
/*!
+ \since 5.2
+
+ Function that can be used to sync Qt state with the Window Systems state.
+
+ This function will first empty Qts events by calling QCoreApplication::processEvents(),
+ then the platform plugin will sync up with the windowsystem, and finally Qts events
+ will be delived by another call to QCoreApplication::processEvents();
+
+ This function is timeconsuming and its use is discouraged.
+*/
+void QGuiApplication::sync()
+{
+ QCoreApplication::processEvents();
+ if (QGuiApplicationPrivate::platform_integration
+ && QGuiApplicationPrivate::platform_integration->hasCapability(QPlatformIntegration::SyncState)) {
+ QGuiApplicationPrivate::platform_integration->sync();
+ QCoreApplication::processEvents();
+ QWindowSystemInterface::flushWindowSystemEvents();
+ }
+}
+
+/*!
\property QGuiApplication::layoutDirection
\brief the default layout direction for this application
@@ -3623,7 +3623,8 @@ QPixmap QGuiApplicationPrivate::getPixmapCursor(Qt::CursorShape cshape)
void QGuiApplicationPrivate::notifyThemeChanged()
{
- if (!(applicationResourceFlags & ApplicationPaletteExplicitlySet)) {
+ if (!(applicationResourceFlags & ApplicationPaletteExplicitlySet) &&
+ !QCoreApplication::testAttribute(Qt::AA_SetPalette)) {
clearPalette();
initPalette();
}
diff --git a/src/gui/opengl/qopenglframebufferobject.cpp b/src/gui/opengl/qopenglframebufferobject.cpp
index c5818e9373..0eee0c9879 100644
--- a/src/gui/opengl/qopenglframebufferobject.cpp
+++ b/src/gui/opengl/qopenglframebufferobject.cpp
@@ -1289,6 +1289,7 @@ static inline QImage qt_gl_read_framebuffer_rgba8(const QSize &size, bool includ
const char *ver = reinterpret_cast<const char *>(funcs->glGetString(GL_VERSION));
// Blacklist GPU chipsets that have problems with their BGRA support.
+#ifndef Q_OS_IOS
const bool blackListed = (qstrcmp(renderer, "PowerVR Rogue G6200") == 0
&& ::strstr(ver, "1.3") != 0) ||
(qstrcmp(renderer, "Mali-T760") == 0
@@ -1296,7 +1297,9 @@ static inline QImage qt_gl_read_framebuffer_rgba8(const QSize &size, bool includ
(qstrcmp(renderer, "Mali-T720") == 0
&& ::strstr(ver, "3.1") != 0) ||
qstrcmp(renderer, "PowerVR SGX 554") == 0;
-
+#else
+ const bool blackListed = true;
+#endif
const bool supports_bgra = has_bgra_ext && !blackListed;
if (supports_bgra) {