From 76fdf7180bff9add177b6a91334171428b3806f4 Mon Sep 17 00:00:00 2001 From: Gerry Boland Date: Mon, 13 Jul 2015 19:51:25 +0100 Subject: We depend on Qt 5.4, remove compatibility code for older versions --- src/platforms/mirserver/miropenglcontext.cpp | 6 ++---- src/platforms/mirserver/miropenglcontext.h | 9 +++------ src/platforms/mirserver/mirserverintegration.cpp | 17 ----------------- src/platforms/mirserver/mirserverintegration.h | 8 -------- 4 files changed, 5 insertions(+), 35 deletions(-) (limited to 'src') 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 &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 &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 -#define GL_DEBUG (QT_VERSION >= QT_VERSION_CHECK(5, 2, 0) && !defined(QT_NO_DEBUG)) - -#if GL_DEBUG +#ifndef QT_NO_DEBUG #include #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 #include - -#if QT_VERSION < QT_VERSION_CHECK(5, 2, 0) -#include -#endif - #include // 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 m_accessibility; QScopedPointer m_fontDb; QScopedPointer m_services; -#if QT_VERSION < QT_VERSION_CHECK(5, 2, 0) - QScopedPointer m_eventDispatcher; -#endif QScopedPointer m_mirServer; -- cgit v1.2.3