diff options
author | Gerry Boland <gerry.boland@canonical.com> | 2015-07-13 19:51:25 +0100 |
---|---|---|
committer | Gerry Boland <gerry.boland@canonical.com> | 2015-07-13 19:51:25 +0100 |
commit | 76fdf7180bff9add177b6a91334171428b3806f4 (patch) | |
tree | 72f115990f26d47f980c4e135d18a683252b4432 | |
parent | ec03118336af538ce0af198adb9cdc571150ae16 (diff) |
We depend on Qt 5.4, remove compatibility code for older versions
-rw-r--r-- | CMakeLists.txt | 14 | ||||
-rw-r--r-- | src/platforms/mirserver/miropenglcontext.cpp | 6 | ||||
-rw-r--r-- | src/platforms/mirserver/miropenglcontext.h | 9 | ||||
-rw-r--r-- | src/platforms/mirserver/mirserverintegration.cpp | 17 | ||||
-rw-r--r-- | src/platforms/mirserver/mirserverintegration.h | 8 |
5 files changed, 12 insertions, 42 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 665acfe..c3f9188 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -50,13 +50,13 @@ add_custom_target(cppcheck COMMAND cppcheck --enable=all -q --error-exitcode=2 ${CMAKE_SOURCE_DIR}/src ${CMAKE_SOURCE_DIR}/tests) include(FindPkgConfig) -find_package(Qt5Core 5.3 REQUIRED) -find_package(Qt5DBus 5.3 REQUIRED) -find_package(Qt5Gui 5.3 REQUIRED) -find_package(Qt5Qml 5.3 REQUIRED) -find_package(Qt5Quick 5.3 REQUIRED) -find_package(Qt5Sensors 5.3 REQUIRED) -find_package(Qt5Test 5.3 REQUIRED) +find_package(Qt5Core 5.4 REQUIRED) +find_package(Qt5DBus 5.4 REQUIRED) +find_package(Qt5Gui 5.4 REQUIRED) +find_package(Qt5Qml 5.4 REQUIRED) +find_package(Qt5Quick 5.4 REQUIRED) +find_package(Qt5Sensors 5.4 REQUIRED) +find_package(Qt5Test 5.4 REQUIRED) find_package(Threads REQUIRED) diff --git a/src/platforms/mirserver/miropenglcontext.cpp b/src/platforms/mirserver/miropenglcontext.cpp index cb84666..6c9360a 100644 --- a/src/platforms/mirserver/miropenglcontext.cpp +++ b/src/platforms/mirserver/miropenglcontext.cpp @@ -36,7 +36,7 @@ // (i.e. individual display output buffers) to use as a common base context. MirOpenGLContext::MirOpenGLContext(const QSharedPointer<MirServer> &server, const QSurfaceFormat &format) -#if GL_DEBUG +#ifndef QT_NO_DEBUG : m_logger(new QOpenGLDebugLogger(this)) #endif { @@ -96,10 +96,8 @@ MirOpenGLContext::MirOpenGLContext(const QSharedPointer<MirServer> &server, cons qDebug() << "OpenGL ES extensions:" << qPrintable(string); q_printEglConfig(eglDisplay, eglConfig); -#if GL_DEBUG QObject::connect(m_logger, &QOpenGLDebugLogger::messageLogged, this, &MirOpenGLContext::onGlDebugMessageLogged, Qt::DirectConnection); -#endif // Qt>=5.2 #endif // debug } @@ -122,7 +120,7 @@ bool MirOpenGLContext::makeCurrent(QPlatformSurface *surface) if (displayBuffer) { displayBuffer->makeCurrent(); -#if GL_DEBUG +#ifndef QT_NO_DEBUG if (!m_logger->isLogging() && m_logger->initialize()) { m_logger->startLogging(QOpenGLDebugLogger::SynchronousLogging); m_logger->enableMessages(); diff --git a/src/platforms/mirserver/miropenglcontext.h b/src/platforms/mirserver/miropenglcontext.h index de3ec9c..c1d6274 100644 --- a/src/platforms/mirserver/miropenglcontext.h +++ b/src/platforms/mirserver/miropenglcontext.h @@ -21,9 +21,7 @@ #include <qpa/qplatformopenglcontext.h> -#define GL_DEBUG (QT_VERSION >= QT_VERSION_CHECK(5, 2, 0) && !defined(QT_NO_DEBUG)) - -#if GL_DEBUG +#ifndef QT_NO_DEBUG #include <QOpenGLDebugLogger> #endif @@ -46,14 +44,13 @@ public: QFunctionPointer getProcAddress(const QByteArray &procName) override; -// "#if GL_DEBUG" does not work as MOC does not understand #define -#if (QT_VERSION >= QT_VERSION_CHECK(5, 2, 0) && !defined(QT_NO_DEBUG)) +#ifndef QT_NO_DEBUG Q_SLOT void onGlDebugMessageLogged(QOpenGLDebugMessage m) { qDebug() << m; } #endif private: QSurfaceFormat m_format; -#if GL_DEBUG +#ifndef QT_NO_DEBUG QOpenGLDebugLogger *m_logger; #endif }; diff --git a/src/platforms/mirserver/mirserverintegration.cpp b/src/platforms/mirserver/mirserverintegration.cpp index ad33caa..28c8c9d 100644 --- a/src/platforms/mirserver/mirserverintegration.cpp +++ b/src/platforms/mirserver/mirserverintegration.cpp @@ -31,11 +31,6 @@ #include <QCoreApplication> #include <QOpenGLContext> - -#if QT_VERSION < QT_VERSION_CHECK(5, 2, 0) -#include <private/qguiapplication_p.h> -#endif - #include <QDebug> // Mir @@ -59,9 +54,6 @@ MirServerIntegration::MirServerIntegration() : m_accessibility(new QPlatformAccessibility()) , m_fontDb(new QGenericUnixFontDatabase()) , m_services(new Services) -#if QT_VERSION < QT_VERSION_CHECK(5, 2, 0) - , m_eventDispatcher(createUnixEventDispatcher()) -#endif , m_mirServer(new QMirServer(QCoreApplication::arguments())) , m_display(nullptr) , m_nativeInterface(nullptr) @@ -82,11 +74,6 @@ MirServerIntegration::MirServerIntegration() QObject::connect(m_mirServer.data(), &QMirServer::stopped, QCoreApplication::instance(), &QCoreApplication::quit); -#if QT_VERSION < QT_VERSION_CHECK(5, 2, 0) - QGuiApplicationPrivate::instance()->setEventDispatcher(eventDispatcher_); - initialize(); -#endif - m_inputContext = QPlatformInputContextFactory::create(); } @@ -105,10 +92,8 @@ bool MirServerIntegration::hasCapability(QPlatformIntegration::Capability cap) c case SharedGraphicsCache: return true; case BufferQueueingOpenGL: return true; case MultipleWindows: return false; // multi-monitor support -#if QT_VERSION >= QT_VERSION_CHECK(5, 2, 0) case WindowManagement: return false; // platform has no WM, as this implements the WM! case NonFullScreenWindows: return false; -#endif default: return QPlatformIntegration::hasCapability(cap); } } @@ -158,12 +143,10 @@ QPlatformOpenGLContext *MirServerIntegration::createPlatformOpenGLContext(QOpenG return new MirOpenGLContext(m_mirServer->mirServer(), context->format()); } -#if QT_VERSION >= QT_VERSION_CHECK(5, 2, 0) QAbstractEventDispatcher *MirServerIntegration::createEventDispatcher() const { return createUnixEventDispatcher(); } -#endif void MirServerIntegration::initialize() { diff --git a/src/platforms/mirserver/mirserverintegration.h b/src/platforms/mirserver/mirserverintegration.h index a02405e..cc719e8 100644 --- a/src/platforms/mirserver/mirserverintegration.h +++ b/src/platforms/mirserver/mirserverintegration.h @@ -47,13 +47,8 @@ public: QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const override; QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const override; -#if QT_VERSION < QT_VERSION_CHECK(5, 2, 0) - QAbstractEventDispatcher* guiThreadEventDispatcher() const override { return eventDispatcher_; } - void initialize(); -#else QAbstractEventDispatcher *createEventDispatcher() const override; void initialize() override; -#endif QPlatformClipboard *clipboard() const override; @@ -72,9 +67,6 @@ private: QScopedPointer<QPlatformAccessibility> m_accessibility; QScopedPointer<QPlatformFontDatabase> m_fontDb; QScopedPointer<QPlatformServices> m_services; -#if QT_VERSION < QT_VERSION_CHECK(5, 2, 0) - QScopedPointer<QAbstractEventDispatcher> m_eventDispatcher; -#endif QScopedPointer<QMirServer> m_mirServer; |