diff options
Diffstat (limited to 'src/plugins/platforms/android/qandroidplatformintegration.cpp')
-rw-r--r-- | src/plugins/platforms/android/qandroidplatformintegration.cpp | 47 |
1 files changed, 34 insertions, 13 deletions
diff --git a/src/plugins/platforms/android/qandroidplatformintegration.cpp b/src/plugins/platforms/android/qandroidplatformintegration.cpp index 8925f04818..3dc8632374 100644 --- a/src/plugins/platforms/android/qandroidplatformintegration.cpp +++ b/src/plugins/platforms/android/qandroidplatformintegration.cpp @@ -47,20 +47,21 @@ #include <QtPlatformSupport/private/qgenericunixeventdispatcher_p.h> -#include <qpa/qplatformwindow.h> #include <qpa/qwindowsysteminterface.h> +#include <qpa/qplatformwindow.h> +#warning sort the headers #include "androidjnimain.h" #include "qabstracteventdispatcher.h" -#include "qandroidplatformaccessibility.h" -#include "qandroidplatformclipboard.h" -#include "qandroidplatformfontdatabase.h" +#include "qandroidplatformrasterwindow.h" +#include "qandroidplatformopenglwindow.h" #include "qandroidplatformbackingstore.h" +#include "qandroidplatformservices.h" +#include "qandroidplatformfontdatabase.h" +#include "qandroidplatformclipboard.h" +#include "qandroidplatformaccessibility.h" #include "qandroidplatformopenglcontext.h" -#include "qandroidplatformopenglwindow.h" -#include "qandroidplatformrasterwindow.h" #include "qandroidplatformscreen.h" -#include "qandroidplatformservices.h" #include "qandroidplatformtheme.h" #include "qandroidsystemlocale.h" @@ -85,6 +86,10 @@ void *QAndroidPlatformNativeInterface::nativeResourceForIntegration(const QByteA return &m_palettes; if (resource == "AndroidStyleFonts") return &m_fonts; + if (resource == "AndroidDeviceName") { + static QString deviceName = QtAndroid::deviceName(); + return &deviceName; + } return 0; } @@ -119,11 +124,23 @@ QAndroidPlatformIntegration::QAndroidPlatformIntegration(const QStringList ¶ m_androidFDB = new QAndroidPlatformFontDatabase(); m_androidPlatformServices = new QAndroidPlatformServices(); + +#ifndef QT_NO_CLIPBOARD m_androidPlatformClipboard = new QAndroidPlatformClipboard(); +#endif m_androidSystemLocale = new QAndroidSystemLocale; } +bool QAndroidPlatformIntegration::needsWorkaround() +{ + static bool needsWorkaround = + QtAndroid::deviceName().compare(QStringLiteral("samsung SM-T211"), Qt::CaseInsensitive) == 0 + || QtAndroid::deviceName().compare(QStringLiteral("samsung SM-T210"), Qt::CaseInsensitive) == 0 + || QtAndroid::deviceName().compare(QStringLiteral("samsung SM-T215"), Qt::CaseInsensitive) == 0; + return needsWorkaround; +} + bool QAndroidPlatformIntegration::hasCapability(Capability cap) const { switch (cap) { @@ -131,7 +148,10 @@ bool QAndroidPlatformIntegration::hasCapability(Capability cap) const case ApplicationState: return true; case NativeWidgets: return true; case OpenGL: return true; - case ThreadedOpenGL: return true; + case ThreadedOpenGL: + if (needsWorkaround()) + return false; + // fall through default: return QPlatformIntegration::hasCapability(cap); } @@ -173,6 +193,11 @@ QAndroidPlatformIntegration::~QAndroidPlatformIntegration() delete m_androidPlatformNativeInterface; delete m_androidFDB; delete m_androidSystemLocale; + +#ifndef QT_NO_CLIPBOARD + delete m_androidPlatformClipboard; +#endif + QtAndroid::setAndroidPlatformIntegration(NULL); } @@ -184,11 +209,7 @@ QPlatformFontDatabase *QAndroidPlatformIntegration::fontDatabase() const #ifndef QT_NO_CLIPBOARD QPlatformClipboard *QAndroidPlatformIntegration::clipboard() const { -static QAndroidPlatformClipboard *clipboard = 0; - if (!clipboard) - clipboard = new QAndroidPlatformClipboard; - - return clipboard; + return m_androidPlatformClipboard; } #endif |