diff options
author | Liang Qi <liang.qi@qt.io> | 2016-12-13 09:36:26 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2016-12-13 09:39:20 +0100 |
commit | 6755ec891a1740110c48895afd53d39e8370704a (patch) | |
tree | 982606f3bc582262e4b315a63f55ccb141fff97b /src/plugins/platforms | |
parent | 449204f8c0d6679ae0e58dbb8a30b8a86fbdb4ec (diff) | |
parent | 00c9ec63a552d040e851b561c11428fabf1a2b08 (diff) |
Merge remote-tracking branch 'origin/5.8' into dev
Conflicts:
configure
qmake/Makefile.unix.macos
qmake/Makefile.unix.win32
qmake/generators/win32/msvc_vcproj.cpp
src/3rdparty/pcre/qt_attribution.json
src/corelib/io/qsettings.cpp
src/corelib/kernel/qdeadlinetimer.cpp
src/platformsupport/kmsconvenience/qkmsdevice.cpp
src/platformsupport/kmsconvenience/qkmsdevice_p.h
src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmscreen.cpp
src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.cpp
src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldevicescreen.cpp
src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsdevice.cpp
src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsscreen.h
tests/manual/qstorageinfo/printvolumes.cpp
tools/configure/configureapp.cpp
Change-Id: Ibaabcc8e965c44926f9fb018466e8b132b8df49e
Diffstat (limited to 'src/plugins/platforms')
108 files changed, 982 insertions, 612 deletions
diff --git a/src/plugins/platforms/android/androidplatformplugin.cpp b/src/plugins/platforms/android/androidplatformplugin.cpp index 8e365e9a59..297e167f47 100644 --- a/src/plugins/platforms/android/androidplatformplugin.cpp +++ b/src/plugins/platforms/android/androidplatformplugin.cpp @@ -47,7 +47,7 @@ class QAndroidPlatformIntegrationPlugin: public QPlatformIntegrationPlugin Q_OBJECT Q_PLUGIN_METADATA(IID QPlatformIntegrationFactoryInterface_iid FILE "android.json") public: - QPlatformIntegration *create(const QString &key, const QStringList ¶mList); + QPlatformIntegration *create(const QString &key, const QStringList ¶mList) override; }; diff --git a/src/plugins/platforms/android/qandroidassetsfileenginehandler.cpp b/src/plugins/platforms/android/qandroidassetsfileenginehandler.cpp index 7e8e1ba9c5..e1dcebfa4c 100644 --- a/src/plugins/platforms/android/qandroidassetsfileenginehandler.cpp +++ b/src/plugins/platforms/android/qandroidassetsfileenginehandler.cpp @@ -75,12 +75,12 @@ public: m_path = path; } - virtual QFileInfo currentFileInfo() const + QFileInfo currentFileInfo() const override { return QFileInfo(currentFilePath()); } - virtual QString currentFileName() const + QString currentFileName() const override { if (m_index < 0 || m_index >= m_items.size()) return QString(); @@ -95,12 +95,12 @@ public: return m_path + currentFileName(); } - virtual bool hasNext() const + bool hasNext() const override { return m_items.size() && (m_index < m_items.size() - 1); } - virtual QString next() + QString next() override { if (!hasNext()) return QString(); @@ -137,12 +137,12 @@ public: close(); } - virtual bool open(QIODevice::OpenMode openMode) + bool open(QIODevice::OpenMode openMode) override { return m_assetFile != 0 && (openMode & QIODevice::WriteOnly) == 0; } - virtual bool close() + bool close() override { if (m_assetFile) { AAsset_close(m_assetFile); @@ -152,50 +152,50 @@ public: return false; } - virtual qint64 size() const + qint64 size() const override { if (m_assetFile) return AAsset_getLength(m_assetFile); return -1; } - virtual qint64 pos() const + qint64 pos() const override { if (m_assetFile) return AAsset_seek(m_assetFile, 0, SEEK_CUR); return -1; } - virtual bool seek(qint64 pos) + bool seek(qint64 pos) override { if (m_assetFile) return pos == AAsset_seek(m_assetFile, pos, SEEK_SET); return false; } - virtual qint64 read(char *data, qint64 maxlen) + qint64 read(char *data, qint64 maxlen) override { if (m_assetFile) return AAsset_read(m_assetFile, data, maxlen); return -1; } - virtual bool isSequential() const + bool isSequential() const override { return false; } - virtual bool caseSensitive() const + bool caseSensitive() const override { return true; } - virtual bool isRelativePath() const + bool isRelativePath() const override { return false; } - virtual FileFlags fileFlags(FileFlags type = FileInfoAll) const + FileFlags fileFlags(FileFlags type = FileInfoAll) const override { FileFlags flags(ReadOwnerPerm|ReadUserPerm|ReadGroupPerm|ReadOtherPerm|ExistsFlag); if (m_assetFile) @@ -206,7 +206,7 @@ public: return type & flags; } - virtual QString fileName(FileName file = DefaultName) const + QString fileName(FileName file = DefaultName) const override { int pos; switch (file) { @@ -231,7 +231,7 @@ public: } } - virtual void setFileName(const QString &file) + void setFileName(const QString &file) override { if (file == m_fileName) return; @@ -243,7 +243,7 @@ public: close(); } - virtual Iterator *beginEntryList(QDir::Filters filters, const QStringList &filterNames) + Iterator *beginEntryList(QDir::Filters filters, const QStringList &filterNames) override { if (!m_assetDir.isNull()) return new AndroidAbstractFileEngineIterator(filters, filterNames, m_assetDir, m_fileName); diff --git a/src/plugins/platforms/android/qandroidassetsfileenginehandler.h b/src/plugins/platforms/android/qandroidassetsfileenginehandler.h index b09d8090a4..f99dc9a11a 100644 --- a/src/plugins/platforms/android/qandroidassetsfileenginehandler.h +++ b/src/plugins/platforms/android/qandroidassetsfileenginehandler.h @@ -55,7 +55,7 @@ class AndroidAssetsFileEngineHandler: public QAbstractFileEngineHandler public: AndroidAssetsFileEngineHandler(); virtual ~AndroidAssetsFileEngineHandler(); - QAbstractFileEngine *create(const QString &fileName) const; + QAbstractFileEngine *create(const QString &fileName) const override; private: void prepopulateCache() const; diff --git a/src/plugins/platforms/android/qandroideventdispatcher.h b/src/plugins/platforms/android/qandroideventdispatcher.h index 86a7e460b3..057a1660c9 100644 --- a/src/plugins/platforms/android/qandroideventdispatcher.h +++ b/src/plugins/platforms/android/qandroideventdispatcher.h @@ -56,7 +56,7 @@ public: void goingToStop(bool stop); protected: - bool processEvents(QEventLoop::ProcessEventsFlags flags); + bool processEvents(QEventLoop::ProcessEventsFlags flags) override; private: QAtomicInt m_stopRequest; diff --git a/src/plugins/platforms/android/qandroidinputcontext.h b/src/plugins/platforms/android/qandroidinputcontext.h index 8a33ff71cc..ce0ec8724c 100644 --- a/src/plugins/platforms/android/qandroidinputcontext.h +++ b/src/plugins/platforms/android/qandroidinputcontext.h @@ -80,21 +80,21 @@ public: QAndroidInputContext(); ~QAndroidInputContext(); static QAndroidInputContext * androidInputContext(); - bool isValid() const { return true; } - - void reset(); - void commit(); - void update(Qt::InputMethodQueries queries); - void invokeAction(QInputMethod::Action action, int cursorPosition); - QRectF keyboardRect() const; - bool isAnimating() const; - void showInputPanel(); - void hideInputPanel(); - bool isInputPanelVisible() const; + bool isValid() const override { return true; } + + void reset() override; + void commit() override; + void update(Qt::InputMethodQueries queries) override; + void invokeAction(QInputMethod::Action action, int cursorPosition) override; + QRectF keyboardRect() const override; + bool isAnimating() const override; + void showInputPanel() override; + void hideInputPanel() override; + bool isInputPanelVisible() const override; bool isComposing() const; void clear(); - void setFocusObject(QObject *object); + void setFocusObject(QObject *object) override; void sendShortcut(const QKeySequence &); //---------------// diff --git a/src/plugins/platforms/android/qandroidplatformaccessibility.h b/src/plugins/platforms/android/qandroidplatformaccessibility.h index 3a428ca1ad..8216c05fa6 100644 --- a/src/plugins/platforms/android/qandroidplatformaccessibility.h +++ b/src/plugins/platforms/android/qandroidplatformaccessibility.h @@ -51,7 +51,7 @@ public: QAndroidPlatformAccessibility(); ~QAndroidPlatformAccessibility(); - virtual void notifyAccessibilityUpdate(QAccessibleEvent *event); + void notifyAccessibilityUpdate(QAccessibleEvent *event) override; }; QT_END_NAMESPACE diff --git a/src/plugins/platforms/android/qandroidplatformbackingstore.h b/src/plugins/platforms/android/qandroidplatformbackingstore.h index e4a161d608..a3a65aa30e 100644 --- a/src/plugins/platforms/android/qandroidplatformbackingstore.h +++ b/src/plugins/platforms/android/qandroidplatformbackingstore.h @@ -50,10 +50,10 @@ class QAndroidPlatformBackingStore : public QPlatformBackingStore { public: explicit QAndroidPlatformBackingStore(QWindow *window); - virtual QPaintDevice *paintDevice(); - virtual void flush(QWindow *window, const QRegion ®ion, const QPoint &offset); - virtual void resize(const QSize &size, const QRegion &staticContents); - QImage toImage() const { return m_image; } + QPaintDevice *paintDevice() override; + void flush(QWindow *window, const QRegion ®ion, const QPoint &offset) override; + void resize(const QSize &size, const QRegion &staticContents) override; + QImage toImage() const override { return m_image; } void setBackingStore(QWindow *window); protected: QImage m_image; diff --git a/src/plugins/platforms/android/qandroidplatformclipboard.h b/src/plugins/platforms/android/qandroidplatformclipboard.h index 47976c1693..dfc3629c10 100644 --- a/src/plugins/platforms/android/qandroidplatformclipboard.h +++ b/src/plugins/platforms/android/qandroidplatformclipboard.h @@ -51,9 +51,9 @@ class QAndroidPlatformClipboard: public QPlatformClipboard public: QAndroidPlatformClipboard(); - virtual QMimeData *mimeData(QClipboard::Mode mode = QClipboard::Clipboard); - virtual void setMimeData(QMimeData *data, QClipboard::Mode mode = QClipboard::Clipboard); - virtual bool supportsMode(QClipboard::Mode mode) const; + QMimeData *mimeData(QClipboard::Mode mode = QClipboard::Clipboard) override; + void setMimeData(QMimeData *data, QClipboard::Mode mode = QClipboard::Clipboard) override; + bool supportsMode(QClipboard::Mode mode) const override; private: QMimeData m_mimeData; diff --git a/src/plugins/platforms/android/qandroidplatformdialoghelpers.h b/src/plugins/platforms/android/qandroidplatformdialoghelpers.h index 5c3aef2bc1..694b4c7580 100644 --- a/src/plugins/platforms/android/qandroidplatformdialoghelpers.h +++ b/src/plugins/platforms/android/qandroidplatformdialoghelpers.h @@ -53,11 +53,11 @@ class QAndroidPlatformMessageDialogHelper: public QPlatformMessageDialogHelper Q_OBJECT public: QAndroidPlatformMessageDialogHelper(); - void exec(); + void exec() override; bool show(Qt::WindowFlags windowFlags, - Qt::WindowModality windowModality, - QWindow *parent); - void hide(); + Qt::WindowModality windowModality, + QWindow *parent) override; + void hide() override; public slots: void dialogResult(int buttonID); diff --git a/src/plugins/platforms/android/qandroidplatformfontdatabase.h b/src/plugins/platforms/android/qandroidplatformfontdatabase.h index b20fd75cb2..533d6e50a9 100644 --- a/src/plugins/platforms/android/qandroidplatformfontdatabase.h +++ b/src/plugins/platforms/android/qandroidplatformfontdatabase.h @@ -47,12 +47,12 @@ QT_BEGIN_NAMESPACE class QAndroidPlatformFontDatabase: public QBasicFontDatabase { public: - QString fontDir() const; - void populateFontDatabase(); + QString fontDir() const override; + void populateFontDatabase() override; QStringList fallbacksForFamily(const QString &family, - QFont::Style style, - QFont::StyleHint styleHint, - QChar::Script script) const; + QFont::Style style, + QFont::StyleHint styleHint, + QChar::Script script) const override; }; QT_END_NAMESPACE diff --git a/src/plugins/platforms/android/qandroidplatformforeignwindow.h b/src/plugins/platforms/android/qandroidplatformforeignwindow.h index 100e0adcdf..d42c36dcee 100644 --- a/src/plugins/platforms/android/qandroidplatformforeignwindow.h +++ b/src/plugins/platforms/android/qandroidplatformforeignwindow.h @@ -51,12 +51,12 @@ class QAndroidPlatformForeignWindow : public QAndroidPlatformWindow public: explicit QAndroidPlatformForeignWindow(QWindow *window); ~QAndroidPlatformForeignWindow(); - void lower() Q_DECL_OVERRIDE; - void raise() Q_DECL_OVERRIDE; - void setGeometry(const QRect &rect) Q_DECL_OVERRIDE; - void setVisible(bool visible) Q_DECL_OVERRIDE; - void applicationStateChanged(Qt::ApplicationState state) Q_DECL_OVERRIDE; - void setParent(const QPlatformWindow *window) Q_DECL_OVERRIDE; + void lower() override; + void raise() override; + void setGeometry(const QRect &rect) override; + void setVisible(bool visible) override; + void applicationStateChanged(Qt::ApplicationState state) override; + void setParent(const QPlatformWindow *window) override; private: int m_surfaceId; diff --git a/src/plugins/platforms/android/qandroidplatformintegration.cpp b/src/plugins/platforms/android/qandroidplatformintegration.cpp index 6669ee3176..de9e27e595 100644 --- a/src/plugins/platforms/android/qandroidplatformintegration.cpp +++ b/src/plugins/platforms/android/qandroidplatformintegration.cpp @@ -66,6 +66,8 @@ #include "qandroidplatformtheme.h" #include "qandroidsystemlocale.h" +#include <QtPlatformHeaders/QEGLNativeContext> + QT_BEGIN_NAMESPACE int QAndroidPlatformIntegration::m_defaultGeometryWidth = 320; @@ -251,7 +253,9 @@ QPlatformOpenGLContext *QAndroidPlatformIntegration::createPlatformOpenGLContext format.setRedBufferSize(8); format.setGreenBufferSize(8); format.setBlueBufferSize(8); - return new QAndroidPlatformOpenGLContext(format, context->shareHandle(), m_eglDisplay); + auto ctx = new QAndroidPlatformOpenGLContext(format, context->shareHandle(), m_eglDisplay, context->nativeHandle()); + context->setNativeHandle(QVariant::fromValue<QEGLNativeContext>(QEGLNativeContext(ctx->eglContext(), m_eglDisplay))); + return ctx; } QPlatformOffscreenSurface *QAndroidPlatformIntegration::createPlatformOffscreenSurface(QOffscreenSurface *surface) const diff --git a/src/plugins/platforms/android/qandroidplatformintegration.h b/src/plugins/platforms/android/qandroidplatformintegration.h index bda0bee9ad..2337801250 100644 --- a/src/plugins/platforms/android/qandroidplatformintegration.h +++ b/src/plugins/platforms/android/qandroidplatformintegration.h @@ -63,7 +63,7 @@ struct AndroidStyle; class QAndroidPlatformNativeInterface: public QPlatformNativeInterface { public: - void *nativeResourceForIntegration(const QByteArray &resource); + void *nativeResourceForIntegration(const QByteArray &resource) override; std::shared_ptr<AndroidStyle> m_androidStyle; }; @@ -75,39 +75,39 @@ public: QAndroidPlatformIntegration(const QStringList ¶mList); ~QAndroidPlatformIntegration(); - bool hasCapability(QPlatformIntegration::Capability cap) const; + bool hasCapability(QPlatformIntegration::Capability cap) const override; - QPlatformWindow *createPlatformWindow(QWindow *window) const; - QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const; - QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const; - QAbstractEventDispatcher *createEventDispatcher() const; + QPlatformWindow *createPlatformWindow(QWindow *window) const override; + QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const override; + QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const override; + QAbstractEventDispatcher *createEventDispatcher() const override; QAndroidPlatformScreen *screen() { return m_primaryScreen; } - QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const; + QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const override; virtual void setDesktopSize(int width, int height); virtual void setDisplayMetrics(int width, int height); void setScreenSize(int width, int height); bool isVirtualDesktop() { return true; } - QPlatformFontDatabase *fontDatabase() const; + QPlatformFontDatabase *fontDatabase() const override; #ifndef QT_NO_CLIPBOARD - QPlatformClipboard *clipboard() const; + QPlatformClipboard *clipboard() const override; #endif - QPlatformInputContext *inputContext() const; - QPlatformNativeInterface *nativeInterface() const; - QPlatformServices *services() const; + QPlatformInputContext *inputContext() const override; + QPlatformNativeInterface *nativeInterface() const override; + QPlatformServices *services() const override; #ifndef QT_NO_ACCESSIBILITY - virtual QPlatformAccessibility *accessibility() const; + virtual QPlatformAccessibility *accessibility() const override; #endif - QVariant styleHint(StyleHint hint) const; - Qt::WindowState defaultWindowState(Qt::WindowFlags flags) const; + QVariant styleHint(StyleHint hint) const override; + Qt::WindowState defaultWindowState(Qt::WindowFlags flags) const override; - QStringList themeNames() const; - QPlatformTheme *createPlatformTheme(const QString &name) const; + QStringList themeNames() const override; + QPlatformTheme *createPlatformTheme(const QString &name) const override; static void setDefaultDisplayMetrics(int gw, int gh, int sw, int sh, int width, int height); static void setDefaultDesktopSize(int gw, int gh); diff --git a/src/plugins/platforms/android/qandroidplatformmenu.h b/src/plugins/platforms/android/qandroidplatformmenu.h index cb1b431d31..00968672c5 100644 --- a/src/plugins/platforms/android/qandroidplatformmenu.h +++ b/src/plugins/platforms/android/qandroidplatformmenu.h @@ -56,25 +56,25 @@ public: QAndroidPlatformMenu(); ~QAndroidPlatformMenu(); - void insertMenuItem(QPlatformMenuItem *menuItem, QPlatformMenuItem *before); - void removeMenuItem(QPlatformMenuItem *menuItem); - void syncMenuItem(QPlatformMenuItem *menuItem); - void syncSeparatorsCollapsible(bool enable); + void insertMenuItem(QPlatformMenuItem *menuItem, QPlatformMenuItem *before) override; + void removeMenuItem(QPlatformMenuItem *menuItem) override; + void syncMenuItem(QPlatformMenuItem *menuItem) override; + void syncSeparatorsCollapsible(bool enable) override; - void setTag(quintptr tag); - quintptr tag() const; - void setText(const QString &text); + void setTag(quintptr tag) override; + quintptr tag() const override; + void setText(const QString &text) override; QString text() const; - void setIcon(const QIcon &icon); + void setIcon(const QIcon &icon) override; QIcon icon() const; - void setEnabled(bool enabled); - bool isEnabled() const; - void setVisible(bool visible); + void setEnabled(bool enabled) override; + bool isEnabled() const override; + void setVisible(bool visible) override; bool isVisible() const; - void showPopup(const QWindow *parentWindow, const QRect &targetRect, const QPlatformMenuItem *item); + void showPopup(const QWindow *parentWindow, const QRect &targetRect, const QPlatformMenuItem *item) override; - QPlatformMenuItem *menuItemAt(int position) const; - QPlatformMenuItem *menuItemForTag(quintptr tag) const; + QPlatformMenuItem *menuItemAt(int position) const override; + QPlatformMenuItem *menuItemForTag(quintptr tag) const override; PlatformMenuItemsType menuItems() const; QMutex *menuItemsMutex(); diff --git a/src/plugins/platforms/android/qandroidplatformmenubar.h b/src/plugins/platforms/android/qandroidplatformmenubar.h index d98d02d5de..0316ea9362 100644 --- a/src/plugins/platforms/android/qandroidplatformmenubar.h +++ b/src/plugins/platforms/android/qandroidplatformmenubar.h @@ -55,11 +55,11 @@ public: QAndroidPlatformMenuBar(); ~QAndroidPlatformMenuBar(); - void insertMenu(QPlatformMenu *menu, QPlatformMenu *before); - void removeMenu(QPlatformMenu *menu); - void syncMenu(QPlatformMenu *menu); - void handleReparent(QWindow *newParentWindow); - QPlatformMenu *menuForTag(quintptr tag) const; + void insertMenu(QPlatformMenu *menu, QPlatformMenu *before) override; + void removeMenu(QPlatformMenu *menu) override; + void syncMenu(QPlatformMenu *menu) override; + void handleReparent(QWindow *newParentWindow) override; + QPlatformMenu *menuForTag(quintptr tag) const override; QWindow *parentWindow() const; PlatformMenusType menus() const; diff --git a/src/plugins/platforms/android/qandroidplatformmenuitem.h b/src/plugins/platforms/android/qandroidplatformmenuitem.h index e843c9eedc..be5240cfa6 100644 --- a/src/plugins/platforms/android/qandroidplatformmenuitem.h +++ b/src/plugins/platforms/android/qandroidplatformmenuitem.h @@ -49,41 +49,41 @@ class QAndroidPlatformMenuItem: public QPlatformMenuItem { public: QAndroidPlatformMenuItem(); - void setTag(quintptr tag); - quintptr tag() const; + void setTag(quintptr tag) override; + quintptr tag() const override; - void setText(const QString &text); + void setText(const QString &text) override; QString text() const; - void setIcon(const QIcon &icon); + void setIcon(const QIcon &icon) override; QIcon icon() const; - void setMenu(QPlatformMenu *menu); + void setMenu(QPlatformMenu *menu) override; QAndroidPlatformMenu *menu() const; - void setVisible(bool isVisible); + void setVisible(bool isVisible) override; bool isVisible() const; - void setIsSeparator(bool isSeparator); + void setIsSeparator(bool isSeparator) override; bool isSeparator() const; - void setFont(const QFont &font); + void setFont(const QFont &font) override; - void setRole(MenuRole role); + void setRole(MenuRole role) override; MenuRole role() const; - void setCheckable(bool checkable); + void setCheckable(bool checkable) override; bool isCheckable() const; - void setChecked(bool isChecked); + void setChecked(bool isChecked) override; bool isChecked() const; - void setShortcut(const QKeySequence &shortcut); + void setShortcut(const QKeySequence &shortcut) override; - void setEnabled(bool enabled); + void setEnabled(bool enabled) override; bool isEnabled() const; - void setIconSize(int size); + void setIconSize(int size) override; private: quintptr m_tag; diff --git a/src/plugins/platforms/android/qandroidplatformopenglcontext.cpp b/src/plugins/platforms/android/qandroidplatformopenglcontext.cpp index 2644fa27f6..eeec7a8106 100644 --- a/src/plugins/platforms/android/qandroidplatformopenglcontext.cpp +++ b/src/plugins/platforms/android/qandroidplatformopenglcontext.cpp @@ -49,8 +49,9 @@ QT_BEGIN_NAMESPACE -QAndroidPlatformOpenGLContext::QAndroidPlatformOpenGLContext(const QSurfaceFormat &format, QPlatformOpenGLContext *share, EGLDisplay display) - :QEGLPlatformContext(format, share, display) +QAndroidPlatformOpenGLContext::QAndroidPlatformOpenGLContext(const QSurfaceFormat &format, QPlatformOpenGLContext *share, EGLDisplay display, + const QVariant &nativeHandle) + :QEGLPlatformContext(format, share, display, nullptr, nativeHandle) { } diff --git a/src/plugins/platforms/android/qandroidplatformopenglcontext.h b/src/plugins/platforms/android/qandroidplatformopenglcontext.h index d3f6cf13a4..3897b3166b 100644 --- a/src/plugins/platforms/android/qandroidplatformopenglcontext.h +++ b/src/plugins/platforms/android/qandroidplatformopenglcontext.h @@ -48,12 +48,12 @@ QT_BEGIN_NAMESPACE class QAndroidPlatformOpenGLContext : public QEGLPlatformContext { public: - QAndroidPlatformOpenGLContext(const QSurfaceFormat &format, QPlatformOpenGLContext *share, EGLDisplay display); - void swapBuffers(QPlatformSurface *surface); - bool makeCurrent(QPlatformSurface *surface); + QAndroidPlatformOpenGLContext(const QSurfaceFormat &format, QPlatformOpenGLContext *share, EGLDisplay display, const QVariant &nativeHandle); + void swapBuffers(QPlatformSurface *surface) override; + bool makeCurrent(QPlatformSurface *surface) override; private: - virtual EGLSurface eglSurfaceForPlatformSurface(QPlatformSurface *surface); + EGLSurface eglSurfaceForPlatformSurface(QPlatformSurface *surface) override; static bool needsFBOReadBackWorkaround(); }; diff --git a/src/plugins/platforms/android/qandroidplatformopenglwindow.h b/src/plugins/platforms/android/qandroidplatformopenglwindow.h index c7cb881973..d3072f766d 100644 --- a/src/plugins/platforms/android/qandroidplatformopenglwindow.h +++ b/src/plugins/platforms/android/qandroidplatformopenglwindow.h @@ -56,18 +56,18 @@ public: explicit QAndroidPlatformOpenGLWindow(QWindow *window, EGLDisplay display); ~QAndroidPlatformOpenGLWindow(); - void setGeometry(const QRect &rect); + void setGeometry(const QRect &rect) override; EGLSurface eglSurface(EGLConfig config); - QSurfaceFormat format() const; + QSurfaceFormat format() const override; bool checkNativeSurface(EGLConfig config); - void applicationStateChanged(Qt::ApplicationState); + void applicationStateChanged(Qt::ApplicationState) override; - void repaint(const QRegion ®ion) Q_DECL_OVERRIDE; + void repaint(const QRegion ®ion) override; protected: - virtual void surfaceChanged(JNIEnv *jniEnv, jobject surface, int w, int h); + void surfaceChanged(JNIEnv *jniEnv, jobject surface, int w, int h) override; void createEgl(EGLConfig config); void clearEgl(); diff --git a/src/plugins/platforms/android/qandroidplatformscreen.h b/src/plugins/platforms/android/qandroidplatformscreen.h index 6e601d5f87..923c9e8832 100644 --- a/src/plugins/platforms/android/qandroidplatformscreen.h +++ b/src/plugins/platforms/android/qandroidplatformscreen.h @@ -63,14 +63,14 @@ public: QAndroidPlatformScreen(); ~QAndroidPlatformScreen(); - QRect geometry() const { return QRect(QPoint(), m_size); } - QRect availableGeometry() const { return m_availableGeometry; } - int depth() const { return m_depth; } - QImage::Format format() const { return m_format; } - QSizeF physicalSize() const { return m_physicalSize; } + QRect geometry() const override { return QRect(QPoint(), m_size); } + QRect availableGeometry() const override { return m_availableGeometry; } + int depth() const override { return m_depth; } + QImage::Format format() const override { return m_format; } + QSizeF physicalSize() const override { return m_physicalSize; } inline QWindow *topWindow() const; - QWindow *topLevelAt(const QPoint & p) const; + QWindow *topLevelAt(const QPoint & p) const override; // compositor api void addWindow(QAndroidPlatformWindow *window); @@ -100,11 +100,11 @@ protected: QSizeF m_physicalSize; private: - QDpi logicalDpi() const; - qreal pixelDensity() const; - Qt::ScreenOrientation orientation() const; - Qt::ScreenOrientation nativeOrientation() const; - void surfaceChanged(JNIEnv *env, jobject surface, int w, int h); + QDpi logicalDpi() const override; + qreal pixelDensity() const override; + Qt::ScreenOrientation orientation() const override; + Qt::ScreenOrientation nativeOrientation() const override; + void surfaceChanged(JNIEnv *env, jobject surface, int w, int h) override; void releaseSurface(); void applicationStateChanged(Qt::ApplicationState); diff --git a/src/plugins/platforms/android/qandroidplatformservices.h b/src/plugins/platforms/android/qandroidplatformservices.h index 5cdc3e95b2..6f2f0a394f 100644 --- a/src/plugins/platforms/android/qandroidplatformservices.h +++ b/src/plugins/platforms/android/qandroidplatformservices.h @@ -49,9 +49,9 @@ class QAndroidPlatformServices: public QPlatformServices { public: QAndroidPlatformServices(); - bool openUrl(const QUrl &url); - bool openDocument(const QUrl &url); - QByteArray desktopEnvironment() const; + bool openUrl(const QUrl &url) override; + bool openDocument(const QUrl &url) override; + QByteArray desktopEnvironment() const override; }; QT_END_NAMESPACE diff --git a/src/plugins/platforms/android/qandroidplatformtheme.h b/src/plugins/platforms/android/qandroidplatformtheme.h index b4d8fa35b1..b49d2516f1 100644 --- a/src/plugins/platforms/android/qandroidplatformtheme.h +++ b/src/plugins/platforms/android/qandroidplatformtheme.h @@ -65,16 +65,16 @@ class QAndroidPlatformTheme: public QPlatformTheme { public: QAndroidPlatformTheme(QAndroidPlatformNativeInterface * androidPlatformNativeInterface); - virtual QPlatformMenuBar *createPlatformMenuBar() const; - virtual QPlatformMenu *createPlatformMenu() const; - virtual QPlatformMenuItem *createPlatformMenuItem() const; - virtual void showPlatformMenuBar(); - virtual const QPalette *palette(Palette type = SystemPalette) const; - virtual const QFont *font(Font type = SystemFont) const; - virtual QVariant themeHint(ThemeHint hint) const; - QString standardButtonText(int button) const Q_DECL_OVERRIDE; - virtual bool usePlatformNativeDialog(DialogType type) const; - virtual QPlatformDialogHelper *createPlatformDialogHelper(DialogType type) const; + QPlatformMenuBar *createPlatformMenuBar() const override; + QPlatformMenu *createPlatformMenu() const override; + QPlatformMenuItem *createPlatformMenuItem() const override; + void showPlatformMenuBar() override; + const QPalette *palette(Palette type = SystemPalette) const override; + const QFont *font(Font type = SystemFont) const override; + QVariant themeHint(ThemeHint hint) const override; + QString standardButtonText(int button) const override; + bool usePlatformNativeDialog(DialogType type) const override; + QPlatformDialogHelper *createPlatformDialogHelper(DialogType type) const override; private: diff --git a/src/plugins/platforms/android/qandroidplatformwindow.h b/src/plugins/platforms/android/qandroidplatformwindow.h index 8d69532d08..87e5cbaa4f 100644 --- a/src/plugins/platforms/android/qandroidplatformwindow.h +++ b/src/plugins/platforms/android/qandroidplatformwindow.h @@ -54,21 +54,21 @@ class QAndroidPlatformWindow: public QPlatformWindow public: explicit QAndroidPlatformWindow(QWindow *window); - void lower(); - void raise(); + void lower() override; + void raise() override; - void setVisible(bool visible); + void setVisible(bool visible) override; - void setWindowState(Qt::WindowState state); - void setWindowFlags(Qt::WindowFlags flags); + void setWindowState(Qt::WindowState state) override; + void setWindowFlags(Qt::WindowFlags flags) override; Qt::WindowFlags windowFlags() const; - void setParent(const QPlatformWindow *window); - WId winId() const { return m_windowId; } + void setParent(const QPlatformWindow *window) override; + WId winId() const override { return m_windowId; } QAndroidPlatformScreen *platformScreen() const; - void propagateSizeHints(); - void requestActivateWindow(); + void propagateSizeHints() override; + void requestActivateWindow() override; void updateStatusBarVisibility(); inline bool isRaster() const { if ((window()->flags() & Qt::ForeignWindow) == Qt::ForeignWindow) @@ -77,7 +77,7 @@ public: return window()->surfaceType() == QSurface::RasterSurface || window()->surfaceType() == QSurface::RasterGLSurface; } - bool isExposed() const; + bool isExposed() const override; virtual void applicationStateChanged(Qt::ApplicationState); @@ -87,7 +87,7 @@ public: virtual void repaint(const QRegion &) { } protected: - void setGeometry(const QRect &rect); + void setGeometry(const QRect &rect) override; protected: Qt::WindowFlags m_windowFlags; diff --git a/src/plugins/platforms/android/qandroidsystemlocale.h b/src/plugins/platforms/android/qandroidsystemlocale.h index 26af1ee51d..bc96d2e8f6 100644 --- a/src/plugins/platforms/android/qandroidsystemlocale.h +++ b/src/plugins/platforms/android/qandroidsystemlocale.h @@ -50,8 +50,8 @@ class QAndroidSystemLocale : public QSystemLocale public: QAndroidSystemLocale(); - virtual QVariant query(QueryType type, QVariant in) const; - virtual QLocale fallbackUiLocale() const; + QVariant query(QueryType type, QVariant in) const override; + QLocale fallbackUiLocale() const override; private: void getLocaleFromJava() const; diff --git a/src/plugins/platforms/cocoa/COCOA_LICENSE.txt b/src/plugins/platforms/cocoa/COCOA_LICENSE.txt new file mode 100644 index 0000000000..8c08f48528 --- /dev/null +++ b/src/plugins/platforms/cocoa/COCOA_LICENSE.txt @@ -0,0 +1,29 @@ +Copyright (c) 2007-2008, Apple, Inc. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + * Neither the name of Apple, Inc. nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm b/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm index da755aa189..7368aabf7d 100644 --- a/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm +++ b/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm @@ -282,14 +282,18 @@ QT_END_NAMESPACE { Q_UNUSED(aNotification); inLaunch = false; - // qt_release_apple_event_handler(); - - // Insert code here to initialize your application + if (qEnvironmentVariableIsEmpty("QT_MAC_DISABLE_FOREGROUND_APPLICATION_TRANSFORM")) { + if (QSysInfo::macVersion() >= QSysInfo::MV_10_12) { + // Move the application window to front to avoid launching behind the terminal. + // Ignoring other apps is neccessary (we must ignore the terminal), but makes + // Qt apps play slightly less nice with other apps when lanching from Finder + // (See the activateIgnoringOtherApps docs.) + [[NSApplication sharedApplication] activateIgnoringOtherApps:YES]; + } + } } - - - (void)application:(NSApplication *)sender openFiles:(NSArray *)filenames { Q_UNUSED(filenames); diff --git a/src/plugins/platforms/cocoa/qcocoaintegration.mm b/src/plugins/platforms/cocoa/qcocoaintegration.mm index db483949e0..6e145682a1 100644 --- a/src/plugins/platforms/cocoa/qcocoaintegration.mm +++ b/src/plugins/platforms/cocoa/qcocoaintegration.mm @@ -328,11 +328,15 @@ QCocoaIntegration::QCocoaIntegration(const QStringList ¶mList) // see the function implementation for exceptions.) qt_mac_transformProccessToForegroundApplication(); - // Move the application window to front to avoid launching behind the terminal. - // Ignoring other apps is neccessary (we must ignore the terminal), but makes - // Qt apps play slightly less nice with other apps when lanching from Finder - // (See the activateIgnoringOtherApps docs.) - [cocoaApplication activateIgnoringOtherApps : YES]; + // Move the application window to front to make it take focus, also when launching + // from the terminal. On 10.12+ this call has been moved to applicationDidFinishLauching + // to work around issues with loss of focus at startup. + if (QSysInfo::macVersion() < QSysInfo::MV_10_12) { + // Ignoring other apps is neccessary (we must ignore the terminal), but makes + // Qt apps play slightly less nice with other apps when lanching from Finder + // (See the activateIgnoringOtherApps docs.) + [cocoaApplication activateIgnoringOtherApps : YES]; + } } // ### For AA_MacPluginApplication we don't want to load the menu nib. diff --git a/src/plugins/platforms/cocoa/qcocoamenuitem.mm b/src/plugins/platforms/cocoa/qcocoamenuitem.mm index b8a64641a8..e32ff26ff5 100644 --- a/src/plugins/platforms/cocoa/qcocoamenuitem.mm +++ b/src/plugins/platforms/cocoa/qcocoamenuitem.mm @@ -360,7 +360,7 @@ NSMenuItem *QCocoaMenuItem::sync() NSImage *img = nil; if (!m_icon.isNull()) { - img = qt_mac_create_nsimage(m_icon); + img = qt_mac_create_nsimage(m_icon, m_iconSize); [img setSize:NSMakeSize(m_iconSize, m_iconSize)]; } [m_native setImage:img]; diff --git a/src/plugins/platforms/cocoa/qt_attribution.json b/src/plugins/platforms/cocoa/qt_attribution.json new file mode 100644 index 0000000000..37c0937f29 --- /dev/null +++ b/src/plugins/platforms/cocoa/qt_attribution.json @@ -0,0 +1,13 @@ +{ + "Id": "cocoa-platform-plugin", + "Name": "Cocoa Platform Plugin", + "QDocModule": "qtgui", + "QtUsage": "Code used in the Qt Platform Abstraction (QPA) for macOS.", + "Files": "qcocoaapplication.h qcocoaapplication.mm qcocoaapplicationdelegate.h qcocoaapplicationdelegate.mm qcocoaeventdispatcher.h qcocoaeventdispatcher.mm qcocoaintrospection.h qcocoaintrospection.mm qcocoasystemtrayicon.mm qmacdefines_mac.h", + + "Description": "Allows Qt to integrate into Apple's Cocoa API.", + "LicenseId": "BSD-3-Clause", + "License": "BSD 3-clause \"New\" or \"Revised\" License", + "LicenseFile": "COCOA_LICENSE.txt", + "Copyright": "Copyright (c) 2007-2008, Apple, Inc." +} diff --git a/src/plugins/platforms/direct2d/qwindowsdirect2dpaintengine.cpp b/src/plugins/platforms/direct2d/qwindowsdirect2dpaintengine.cpp index 85f333ac78..164429ba30 100644 --- a/src/plugins/platforms/direct2d/qwindowsdirect2dpaintengine.cpp +++ b/src/plugins/platforms/direct2d/qwindowsdirect2dpaintengine.cpp @@ -1031,7 +1031,7 @@ public: if (fontFace) return fontFace; - LOGFONT lf = QWindowsFontDatabase::fontDefToLOGFONT(fontDef); + LOGFONT lf = QWindowsFontDatabase::fontDefToLOGFONT(fontDef, QString()); // Get substitute name static const char keyC[] = "HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows NT\\CurrentVersion\\FontSubstitutes"; diff --git a/src/plugins/platforms/eglfs/api/qeglfsintegration.cpp b/src/plugins/platforms/eglfs/api/qeglfsintegration.cpp index 3cc3776e3b..190f5a80d0 100644 --- a/src/plugins/platforms/eglfs/api/qeglfsintegration.cpp +++ b/src/plugins/platforms/eglfs/api/qeglfsintegration.cpp @@ -200,7 +200,7 @@ QPlatformBackingStore *QEglFSIntegration::createPlatformBackingStore(QWindow *wi QPlatformWindow *QEglFSIntegration::createPlatformWindow(QWindow *window) const { - QWindowSystemInterface::flushWindowSystemEvents(); + QWindowSystemInterface::flushWindowSystemEvents(QEventLoop::ExcludeUserInputEvents); QEglFSWindow *w = qt_egl_device_integration()->createWindow(window); w->create(); if (window->type() != Qt::ToolTip) diff --git a/src/plugins/platforms/eglfs/api/qeglfswindow.cpp b/src/plugins/platforms/eglfs/api/qeglfswindow.cpp index 1e202e4ff4..12108fd1c4 100644 --- a/src/plugins/platforms/eglfs/api/qeglfswindow.cpp +++ b/src/plugins/platforms/eglfs/api/qeglfswindow.cpp @@ -231,7 +231,7 @@ void QEglFSWindow::setVisible(bool visible) QWindowSystemInterface::handleExposeEvent(wnd, QRect(QPoint(0, 0), wnd->geometry().size())); if (visible) - QWindowSystemInterface::flushWindowSystemEvents(); + QWindowSystemInterface::flushWindowSystemEvents(QEventLoop::ExcludeUserInputEvents); } void QEglFSWindow::setGeometry(const QRect &r) diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmscreen.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmscreen.cpp index ebce0a4776..3723142f0b 100644 --- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmscreen.cpp +++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmscreen.cpp @@ -184,24 +184,41 @@ void QEglFSKmsGbmScreen::flip() FrameBuffer *fb = framebufferForBufferObject(m_gbm_bo_next); - if (!output().mode_set) { - int ret = drmModeSetCrtc(device()->fd(), - output().crtc_id, + QKmsOutput &op(output()); + const int fd = device()->fd(); + const uint32_t w = op.modes[op.mode].hdisplay; + const uint32_t h = op.modes[op.mode].vdisplay; + + if (!op.mode_set) { + int ret = drmModeSetCrtc(fd, + op.crtc_id, fb->fb, 0, 0, - &output().connector_id, 1, - &output().modes[output().mode]); + &op.connector_id, 1, + &op.modes[op.mode]); - if (ret) { - qErrnoWarning("Could not set DRM mode!"); + if (ret == -1) { + qErrnoWarning(errno, "Could not set DRM mode!"); } else { - output().mode_set = true; + op.mode_set = true; setPowerState(PowerStateOn); + + if (!op.plane_set) { + op.plane_set = true; + if (op.wants_plane) { + int ret = drmModeSetPlane(fd, op.plane_id, op.crtc_id, + uint32_t(-1), 0, + 0, 0, w, h, + 0 << 16, 0 << 16, w << 16, h << 16); + if (ret == -1) + qErrnoWarning(errno, "drmModeSetPlane failed"); + } + } } } - int ret = drmModePageFlip(device()->fd(), - output().crtc_id, + int ret = drmModePageFlip(fd, + op.crtc_id, fb->fb, DRM_MODE_PAGE_FLIP_EVENT, this); diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.cpp index 4a1ed8875a..3e333fc25a 100644 --- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.cpp +++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.cpp @@ -39,11 +39,11 @@ ****************************************************************************/ #include "qeglfskmsegldeviceintegration.h" +#include "qeglfskmsegldevice.h" +#include "qeglfskmsegldevicescreen.h" #include <QtEglSupport/private/qeglconvenience_p.h> #include "private/qeglfswindow_p.h" #include "private/qeglfscursor_p.h" -#include "qeglfskmsegldevice.h" -#include "qeglfskmsscreen.h" #include <QLoggingCategory> #include <private/qmath_p.h> @@ -128,10 +128,16 @@ void QEglFSKmsEglDeviceWindow::resetSurface() qCDebug(qLcEglfsKmsDebug, "Creating stream"); EGLDisplay display = screen()->display(); - EGLOutputLayerEXT layer = EGL_NO_OUTPUT_LAYER_EXT; - EGLint count; + EGLint streamAttribs[3]; + int streamAttribCount = 0; + int fifoLength = qEnvironmentVariableIntValue("QT_QPA_EGLFS_STREAM_FIFO_LENGTH"); + if (fifoLength > 0) { + streamAttribs[streamAttribCount++] = EGL_STREAM_FIFO_LENGTH_KHR; + streamAttribs[streamAttribCount++] = fifoLength; + } + streamAttribs[streamAttribCount++] = EGL_NONE; - m_egl_stream = m_integration->m_funcs->create_stream(display, Q_NULLPTR); + m_egl_stream = m_integration->m_funcs->create_stream(display, streamAttribs); if (m_egl_stream == EGL_NO_STREAM_KHR) { qWarning("resetSurface: Couldn't create EGLStream for native window"); return; @@ -139,6 +145,16 @@ void QEglFSKmsEglDeviceWindow::resetSurface() qCDebug(qLcEglfsKmsDebug, "Created stream %p on display %p", m_egl_stream, display); + EGLint count; + if (m_integration->m_funcs->query_stream(display, m_egl_stream, EGL_STREAM_FIFO_LENGTH_KHR, &count)) { + if (count > 0) + qCDebug(qLcEglfsKmsDebug, "Using EGLStream FIFO mode with %d frames", count); + else + qCDebug(qLcEglfsKmsDebug, "Using EGLStream mailbox mode"); + } else { + qCDebug(qLcEglfsKmsDebug, "Could not query number of EGLStream FIFO frames"); + } + if (!m_integration->m_funcs->get_output_layers(display, Q_NULLPTR, Q_NULLPTR, 0, &count) || count == 0) { qWarning("No output layers found"); return; @@ -154,19 +170,23 @@ void QEglFSKmsEglDeviceWindow::resetSurface() return; } - QEglFSKmsScreen *cur_screen = static_cast<QEglFSKmsScreen*>(screen()); + QEglFSKmsEglDeviceScreen *cur_screen = static_cast<QEglFSKmsEglDeviceScreen *>(screen()); Q_ASSERT(cur_screen); - qCDebug(qLcEglfsKmsDebug, "Searching for id: %d", cur_screen->output().crtc_id); + QKmsOutput &output(cur_screen->output()); + const uint32_t wantedId = !output.wants_plane ? output.crtc_id : output.plane_id; + qCDebug(qLcEglfsKmsDebug, "Searching for id: %d", wantedId); + EGLOutputLayerEXT layer = EGL_NO_OUTPUT_LAYER_EXT; for (int i = 0; i < actualCount; ++i) { EGLAttrib id; if (m_integration->m_funcs->query_output_layer_attrib(display, layers[i], EGL_DRM_CRTC_EXT, &id)) { qCDebug(qLcEglfsKmsDebug, " [%d] layer %p - crtc %d", i, layers[i], (int) id); - if (id == EGLAttrib(cur_screen->output().crtc_id)) + if (id == EGLAttrib(wantedId)) layer = layers[i]; } else if (m_integration->m_funcs->query_output_layer_attrib(display, layers[i], EGL_DRM_PLANE_EXT, &id)) { - // Not used yet, just for debugging. qCDebug(qLcEglfsKmsDebug, " [%d] layer %p - plane %d", i, layers[i], (int) id); + if (id == EGLAttrib(wantedId)) + layer = layers[i]; } else { qCDebug(qLcEglfsKmsDebug, " [%d] layer %p - unknown", i, layers[i]); } @@ -175,8 +195,10 @@ void QEglFSKmsEglDeviceWindow::resetSurface() QByteArray reqLayerIndex = qgetenv("QT_QPA_EGLFS_LAYER_INDEX"); if (!reqLayerIndex.isEmpty()) { int idx = reqLayerIndex.toInt(); - if (idx >= 0 && idx < layers.count()) + if (idx >= 0 && idx < layers.count()) { + qCDebug(qLcEglfsKmsDebug, "EGLOutput layer index override = %d", idx); layer = layers[idx]; + } } if (layer == EGL_NO_OUTPUT_LAYER_EXT) { diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldevicescreen.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldevicescreen.cpp index 532ec0b440..7e5477e4bf 100644 --- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldevicescreen.cpp +++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldevicescreen.cpp @@ -73,13 +73,16 @@ QPlatformCursor *QEglFSKmsEglDeviceScreen::cursor() const void QEglFSKmsEglDeviceScreen::waitForFlip() { - if (!output().mode_set) { - output().mode_set = true; + QKmsOutput &op(output()); + const int fd = device()->fd(); + const uint32_t w = op.modes[op.mode].hdisplay; + const uint32_t h = op.modes[op.mode].vdisplay; - drmModeCrtcPtr currentMode = drmModeGetCrtc(device()->fd(), output().crtc_id); - const bool alreadySet = currentMode - && currentMode->width == output().modes[output().mode].hdisplay - && currentMode->height == output().modes[output().mode].vdisplay; + if (!op.mode_set) { + op.mode_set = true; + + drmModeCrtcPtr currentMode = drmModeGetCrtc(fd, op.crtc_id); + const bool alreadySet = currentMode && currentMode->width == w && currentMode->height == h; if (currentMode) drmModeFreeCrtc(currentMode); if (alreadySet) { @@ -93,14 +96,26 @@ void QEglFSKmsEglDeviceScreen::waitForFlip() } qCDebug(qLcEglfsKmsDebug, "Setting mode"); - int ret = drmModeSetCrtc(device()->fd(), output().crtc_id, + int ret = drmModeSetCrtc(fd, op.crtc_id, uint32_t(-1), 0, 0, - &output().connector_id, 1, - &output().modes[output().mode]); + &op.connector_id, 1, + &op.modes[op.mode]); if (ret) - qFatal("drmModeSetCrtc failed"); + qErrnoWarning(errno, "drmModeSetCrtc failed"); } + if (!op.plane_set) { + op.plane_set = true; + + if (op.wants_plane) { + qCDebug(qLcEglfsKmsDebug, "Setting plane %u", op.plane_id); + int ret = drmModeSetPlane(fd, op.plane_id, op.crtc_id, uint32_t(-1), 0, + 0, 0, w, h, + 0 << 16, 0 << 16, w << 16, h << 16); + if (ret == -1) + qErrnoWarning(errno, "drmModeSetPlane failed"); + } + } } QT_END_NAMESPACE diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_mali/qeglfsmaliintegration.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_mali/qeglfsmaliintegration.cpp index cd468c989f..8eb07d727b 100644 --- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_mali/qeglfsmaliintegration.cpp +++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_mali/qeglfsmaliintegration.cpp @@ -48,7 +48,7 @@ QT_BEGIN_NAMESPACE -struct fbdev_window { +struct shadow_fbdev_window { unsigned short width; unsigned short height; }; @@ -91,7 +91,7 @@ EGLNativeWindowType QEglFSMaliIntegration::createNativeWindow(QPlatformWindow *w Q_UNUSED(window); Q_UNUSED(format); - fbdev_window *fbwin = reinterpret_cast<fbdev_window *>(malloc(sizeof(fbdev_window))); + shadow_fbdev_window *fbwin = reinterpret_cast<shadow_fbdev_window *>(malloc(sizeof(shadow_fbdev_window))); if (NULL == fbwin) return 0; diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_x11/qeglfsx11integration.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_x11/qeglfsx11integration.cpp index f9924fe5ce..0a547b832f 100644 --- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_x11/qeglfsx11integration.cpp +++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_x11/qeglfsx11integration.cpp @@ -55,7 +55,7 @@ public: EventReader(QEglFSX11Integration *integration) : m_integration(integration) { } - void run(); + void run() override; private: QEglFSX11Integration *m_integration; diff --git a/src/plugins/platforms/qnx/main.h b/src/plugins/platforms/qnx/main.h index 8d99d2432e..5d5bf95686 100644 --- a/src/plugins/platforms/qnx/main.h +++ b/src/plugins/platforms/qnx/main.h @@ -46,7 +46,7 @@ class QQnxIntegrationPlugin : public QPlatformIntegrationPlugin Q_OBJECT Q_PLUGIN_METADATA(IID QPlatformIntegrationFactoryInterface_iid FILE "qnx.json") public: - QPlatformIntegration *create(const QString&, const QStringList&); + QPlatformIntegration *create(const QString&, const QStringList&) override; }; QT_END_NAMESPACE diff --git a/src/plugins/platforms/qnx/qqnxclipboard.cpp b/src/plugins/platforms/qnx/qqnxclipboard.cpp index 0d2cc45c30..78174549b1 100644 --- a/src/plugins/platforms/qnx/qqnxclipboard.cpp +++ b/src/plugins/platforms/qnx/qqnxclipboard.cpp @@ -103,14 +103,14 @@ public: qClipboardDebug() << "formats=" << m_formatsToCheck; } - bool hasFormat(const QString &mimetype) const + bool hasFormat(const QString &mimetype) const override { const bool result = is_clipboard_format_present(mimetype.toUtf8().constData()) == 0; qClipboardDebug() << "mimetype=" << mimetype << "result=" << result; return result; } - QStringList formats() const + QStringList formats() const override { QStringList result; @@ -141,7 +141,7 @@ public: } protected: - QVariant retrieveData(const QString &mimetype, QVariant::Type preferredType) const + QVariant retrieveData(const QString &mimetype, QVariant::Type preferredType) const override { qClipboardDebug() << "mimetype=" << mimetype << "preferredType=" << preferredType; if (is_clipboard_format_present(mimetype.toUtf8().constData()) != 0) diff --git a/src/plugins/platforms/qnx/qqnxclipboard.h b/src/plugins/platforms/qnx/qqnxclipboard.h index 5113742087..b9466214f8 100644 --- a/src/plugins/platforms/qnx/qqnxclipboard.h +++ b/src/plugins/platforms/qnx/qqnxclipboard.h @@ -52,8 +52,8 @@ class QQnxClipboard : public QPlatformClipboard public: QQnxClipboard(); ~QQnxClipboard(); - QMimeData *mimeData(QClipboard::Mode mode = QClipboard::Clipboard); - void setMimeData(QMimeData *data, QClipboard::Mode mode = QClipboard::Clipboard); + QMimeData *mimeData(QClipboard::Mode mode = QClipboard::Clipboard) override; + void setMimeData(QMimeData *data, QClipboard::Mode mode = QClipboard::Clipboard) override; private: class MimeData; diff --git a/src/plugins/platforms/qnx/qqnxcursor.h b/src/plugins/platforms/qnx/qqnxcursor.h index 5c0d582107..9559bfb4ce 100644 --- a/src/plugins/platforms/qnx/qqnxcursor.h +++ b/src/plugins/platforms/qnx/qqnxcursor.h @@ -50,11 +50,11 @@ public: QQnxCursor(); #if !defined(QT_NO_CURSOR) - void changeCursor(QCursor *windowCursor, QWindow *window); + void changeCursor(QCursor *windowCursor, QWindow *window) override; #endif - void setPos(const QPoint &pos); + void setPos(const QPoint &pos) override; - QPoint pos() const; + QPoint pos() const override; private: QPoint m_pos; diff --git a/src/plugins/platforms/qnx/qqnxeglwindow.h b/src/plugins/platforms/qnx/qqnxeglwindow.h index 943ae44bd9..183be11ddc 100644 --- a/src/plugins/platforms/qnx/qqnxeglwindow.h +++ b/src/plugins/platforms/qnx/qqnxeglwindow.h @@ -61,11 +61,11 @@ public: void setPlatformOpenGLContext(QQnxGLContext *platformOpenGLContext); QQnxGLContext *platformOpenGLContext() const { return m_platformOpenGLContext; } - void setGeometry(const QRect &rect); + void setGeometry(const QRect &rect) override; protected: - int pixelFormat() const; - void resetBuffers(); + int pixelFormat() const override; + void resetBuffers() override; private: QSize m_requestedBufferSize; diff --git a/src/plugins/platforms/qnx/qqnxglcontext.h b/src/plugins/platforms/qnx/qqnxglcontext.h index 74cd3b4c48..6e5408e8bf 100644 --- a/src/plugins/platforms/qnx/qqnxglcontext.h +++ b/src/plugins/platforms/qnx/qqnxglcontext.h @@ -64,13 +64,13 @@ public: void requestSurfaceChange(); - bool makeCurrent(QPlatformSurface *surface); - void doneCurrent(); - void swapBuffers(QPlatformSurface *surface); - QFunctionPointer getProcAddress(const char *procName); + bool makeCurrent(QPlatformSurface *surface) override; + void doneCurrent() override; + void swapBuffers(QPlatformSurface *surface) override; + QFunctionPointer getProcAddress(const char *procName) override; - virtual QSurfaceFormat format() const { return m_windowFormat; } - bool isSharing() const; + virtual QSurfaceFormat format() const override { return m_windowFormat; } + bool isSharing() const override; static EGLDisplay getEglDisplay(); EGLConfig getEglConfig() const { return m_eglConfig;} diff --git a/src/plugins/platforms/qnx/qqnxinputcontext_imf.h b/src/plugins/platforms/qnx/qqnxinputcontext_imf.h index c4c2057059..e758ae5bf3 100644 --- a/src/plugins/platforms/qnx/qqnxinputcontext_imf.h +++ b/src/plugins/platforms/qnx/qqnxinputcontext_imf.h @@ -71,22 +71,22 @@ public: Reverted, }; - bool isValid() const; + bool isValid() const override; - bool filterEvent(const QEvent *event); - QRectF keyboardRect() const; - void reset(); - void commit(); - void update(Qt::InputMethodQueries); - bool handleKeyboardEvent(int flags, int sym, int mod, int scan, int cap, int sequenceId); + bool filterEvent(const QEvent *event) override; + QRectF keyboardRect() const override; + void reset() override; + void commit() override; + void update(Qt::InputMethodQueries) override; + bool handleKeyboardEvent(int flags, int sym, int mod, int scan, int cap, int sequenceId) override; - void showInputPanel(); - void hideInputPanel(); - bool isInputPanelVisible() const; + void showInputPanel() override; + void hideInputPanel() override; + bool isInputPanelVisible() const override; - QLocale locale() const; - void setFocusObject(QObject *object); + QLocale locale() const override; + void setFocusObject(QObject *object) override; static void setHighlightColor(int index, const QColor &color); diff --git a/src/plugins/platforms/qnx/qqnxinputcontext_noimf.h b/src/plugins/platforms/qnx/qqnxinputcontext_noimf.h index aab8dabedf..8d6104af80 100644 --- a/src/plugins/platforms/qnx/qqnxinputcontext_noimf.h +++ b/src/plugins/platforms/qnx/qqnxinputcontext_noimf.h @@ -56,19 +56,19 @@ public: explicit QQnxInputContext(QQnxIntegration *integration, QQnxAbstractVirtualKeyboard &keyboard); ~QQnxInputContext(); - bool isValid() const; + bool isValid() const override; - void reset(); - bool filterEvent( const QEvent *event ); - QRectF keyboardRect() const; + void reset() override; + bool filterEvent(const QEvent *event) override; + QRectF keyboardRect() const override; bool handleKeyboardEvent(int flags, int sym, int mod, int scan, int cap); - void showInputPanel(); - void hideInputPanel(); - bool isInputPanelVisible() const; + void showInputPanel() override; + void hideInputPanel() override; + bool isInputPanelVisible() const override; - QLocale locale() const; - void setFocusObject(QObject *object); + QLocale locale() const override; + void setFocusObject(QObject *object) override; private Q_SLOTS: void keyboardHeightChanged(); diff --git a/src/plugins/platforms/qnx/qqnxintegration.h b/src/plugins/platforms/qnx/qqnxintegration.h index 3b43837dec..b2008baa0c 100644 --- a/src/plugins/platforms/qnx/qqnxintegration.h +++ b/src/plugins/platforms/qnx/qqnxintegration.h @@ -87,38 +87,38 @@ public: explicit QQnxIntegration(const QStringList ¶mList); ~QQnxIntegration(); - bool hasCapability(QPlatformIntegration::Capability cap) const; + bool hasCapability(QPlatformIntegration::Capability cap) const override; - QPlatformWindow *createPlatformWindow(QWindow *window) const; - QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const; + QPlatformWindow *createPlatformWindow(QWindow *window) const override; + QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const override; #if !defined(QT_NO_OPENGL) - QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const; + QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const override; #endif #if defined(QQNX_PPS) - QPlatformInputContext *inputContext() const; + QPlatformInputContext *inputContext() const override; #endif void moveToScreen(QWindow *window, int screen); bool supportsNavigatorEvents() const; - QAbstractEventDispatcher *createEventDispatcher() const; + QAbstractEventDispatcher *createEventDispatcher() const override; - QPlatformFontDatabase *fontDatabase() const { return m_fontDatabase; } + QPlatformFontDatabase *fontDatabase() const override { return m_fontDatabase; } - QPlatformNativeInterface *nativeInterface() const; + QPlatformNativeInterface *nativeInterface() const override; #if !defined(QT_NO_CLIPBOARD) - QPlatformClipboard *clipboard() const; + QPlatformClipboard *clipboard() const override; #endif #if !defined(QT_NO_DRAGANDDROP) - QPlatformDrag *drag() const; + QPlatformDrag *drag() const override; #endif - QVariant styleHint(StyleHint hint) const; + QVariant styleHint(StyleHint hint) const override; - QPlatformServices *services() const; + QPlatformServices *services() const override; static QWindow *window(screen_window_t qnxWindow); diff --git a/src/plugins/platforms/qnx/qqnxnativeinterface.h b/src/plugins/platforms/qnx/qqnxnativeinterface.h index 26e34b9d54..25f1c29b02 100644 --- a/src/plugins/platforms/qnx/qqnxnativeinterface.h +++ b/src/plugins/platforms/qnx/qqnxnativeinterface.h @@ -50,16 +50,16 @@ class QQnxNativeInterface : public QPlatformNativeInterface { public: QQnxNativeInterface(QQnxIntegration *integration); - void *nativeResourceForWindow(const QByteArray &resource, QWindow *window); - void *nativeResourceForScreen(const QByteArray &resource, QScreen *screen); - void *nativeResourceForIntegration(const QByteArray &resource); + void *nativeResourceForWindow(const QByteArray &resource, QWindow *window) override; + void *nativeResourceForScreen(const QByteArray &resource, QScreen *screen) override; + void *nativeResourceForIntegration(const QByteArray &resource) override; #if !defined(QT_NO_OPENGL) - void *nativeResourceForContext(const QByteArray &resource, QOpenGLContext *context); + void *nativeResourceForContext(const QByteArray &resource, QOpenGLContext *context) override; #endif - void setWindowProperty(QPlatformWindow *window, const QString &name, const QVariant &value); - NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource); + void setWindowProperty(QPlatformWindow *window, const QString &name, const QVariant &value) override; + NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource) override; private: QQnxIntegration *m_integration; diff --git a/src/plugins/platforms/qnx/qqnxnavigatorpps.h b/src/plugins/platforms/qnx/qqnxnavigatorpps.h index 08315f166f..3c818f51a6 100644 --- a/src/plugins/platforms/qnx/qqnxnavigatorpps.h +++ b/src/plugins/platforms/qnx/qqnxnavigatorpps.h @@ -54,7 +54,7 @@ public: ~QQnxNavigatorPps(); protected: - bool requestInvokeUrl(const QByteArray &encodedUrl); + bool requestInvokeUrl(const QByteArray &encodedUrl) override; private: bool openPpsConnection(); diff --git a/src/plugins/platforms/qnx/qqnxrasterbackingstore.h b/src/plugins/platforms/qnx/qqnxrasterbackingstore.h index e4ac8f02b1..96ac193dda 100644 --- a/src/plugins/platforms/qnx/qqnxrasterbackingstore.h +++ b/src/plugins/platforms/qnx/qqnxrasterbackingstore.h @@ -54,12 +54,12 @@ public: QQnxRasterBackingStore(QWindow *window); ~QQnxRasterBackingStore(); - QPaintDevice *paintDevice(); - void flush(QWindow *window, const QRegion ®ion, const QPoint &offset); - void resize(const QSize &size, const QRegion &staticContents); - bool scroll(const QRegion &area, int dx, int dy); - void beginPaint(const QRegion ®ion); - void endPaint(); + QPaintDevice *paintDevice() override; + void flush(QWindow *window, const QRegion ®ion, const QPoint &offset) override; + void resize(const QSize &size, const QRegion &staticContents) override; + bool scroll(const QRegion &area, int dx, int dy) override; + void beginPaint(const QRegion ®ion) override; + void endPaint() override; private: QQnxRasterWindow *platformWindow() const; diff --git a/src/plugins/platforms/qnx/qqnxrasterwindow.h b/src/plugins/platforms/qnx/qqnxrasterwindow.h index 53ab29e443..99396efd57 100644 --- a/src/plugins/platforms/qnx/qqnxrasterwindow.h +++ b/src/plugins/platforms/qnx/qqnxrasterwindow.h @@ -58,13 +58,13 @@ public: bool hasBuffers() const { return !bufferSize().isEmpty(); } - void setParent(const QPlatformWindow *window); + void setParent(const QPlatformWindow *window) override; void adjustBufferSize(); protected: - int pixelFormat() const; - void resetBuffers(); + int pixelFormat() const override; + void resetBuffers() override; // Copies content from the previous buffer (back buffer) to the current buffer (front buffer) void blitPreviousToCurrent(const QRegion ®ion, int dx, int dy, bool flush=false); diff --git a/src/plugins/platforms/qnx/qqnxscreen.h b/src/plugins/platforms/qnx/qqnxscreen.h index b7264d0973..8a498434aa 100644 --- a/src/plugins/platforms/qnx/qqnxscreen.h +++ b/src/plugins/platforms/qnx/qqnxscreen.h @@ -71,26 +71,26 @@ public: QQnxScreen(screen_context_t context, screen_display_t display, bool primaryScreen); ~QQnxScreen(); - QPixmap grabWindow(WId window, int x, int y, int width, int height) const; + QPixmap grabWindow(WId window, int x, int y, int width, int height) const override; - QRect geometry() const { return m_currentGeometry; } - QRect availableGeometry() const; - int depth() const; - QImage::Format format() const { return (depth() == 32) ? QImage::Format_RGB32 : QImage::Format_RGB16; } - QSizeF physicalSize() const { return m_currentPhysicalSize; } + QRect geometry() const override { return m_currentGeometry; } + QRect availableGeometry() const override; + int depth() const override; + QImage::Format format() const override { return (depth() == 32) ? QImage::Format_RGB32 : QImage::Format_RGB16; } + QSizeF physicalSize() const override { return m_currentPhysicalSize; } - qreal refreshRate() const; + qreal refreshRate() const override; - Qt::ScreenOrientation nativeOrientation() const; - Qt::ScreenOrientation orientation() const; + Qt::ScreenOrientation nativeOrientation() const override; + Qt::ScreenOrientation orientation() const override; - QWindow *topLevelAt(const QPoint &point) const; + QWindow *topLevelAt(const QPoint &point) const override; bool isPrimaryScreen() const { return m_primaryScreen; } int rotation() const { return m_currentRotation; } - QString name() const { return m_name; } + QString name() const override { return m_name; } int nativeFormat() const { return (depth() == 32) ? SCREEN_FORMAT_RGBA8888 : SCREEN_FORMAT_RGB565; } screen_display_t nativeDisplay() const { return m_display; } @@ -111,7 +111,7 @@ public: QQnxWindow *rootWindow() const; void setRootWindow(QQnxWindow*); - QPlatformCursor *cursor() const; + QPlatformCursor *cursor() const override; Q_SIGNALS: void foreignWindowCreated(void *window); diff --git a/src/plugins/platforms/qnx/qqnxscreeneventhandler.h b/src/plugins/platforms/qnx/qqnxscreeneventhandler.h index 78b089764f..d872f9b9aa 100644 --- a/src/plugins/platforms/qnx/qqnxscreeneventhandler.h +++ b/src/plugins/platforms/qnx/qqnxscreeneventhandler.h @@ -71,7 +71,7 @@ Q_SIGNALS: void windowClosed(void *window); protected: - void timerEvent(QTimerEvent *event); + void timerEvent(QTimerEvent *event) override; private Q_SLOTS: void processEventsFromScreenThread(); diff --git a/src/plugins/platforms/qnx/qqnxscreeneventthread.h b/src/plugins/platforms/qnx/qqnxscreeneventthread.h index b672fcf991..140f53aa50 100644 --- a/src/plugins/platforms/qnx/qqnxscreeneventthread.h +++ b/src/plugins/platforms/qnx/qqnxscreeneventthread.h @@ -65,7 +65,7 @@ public: void unlock(); protected: - void run(); + void run() override; Q_SIGNALS: void eventPending(); diff --git a/src/plugins/platforms/qnx/qqnxservices.h b/src/plugins/platforms/qnx/qqnxservices.h index 94dd5dc0b4..cbf029fdb9 100644 --- a/src/plugins/platforms/qnx/qqnxservices.h +++ b/src/plugins/platforms/qnx/qqnxservices.h @@ -52,8 +52,8 @@ public: explicit QQnxServices(QQnxAbstractNavigator *navigator); ~QQnxServices(); - bool openUrl(const QUrl &url); - bool openDocument(const QUrl &url); + bool openUrl(const QUrl &url) override; + bool openDocument(const QUrl &url) override; private: bool navigatorInvoke(const QUrl &url); diff --git a/src/plugins/platforms/qnx/qqnxvirtualkeyboardpps.h b/src/plugins/platforms/qnx/qqnxvirtualkeyboardpps.h index 8580ee151b..51d55a2036 100644 --- a/src/plugins/platforms/qnx/qqnxvirtualkeyboardpps.h +++ b/src/plugins/platforms/qnx/qqnxvirtualkeyboardpps.h @@ -56,14 +56,14 @@ public: QQnxVirtualKeyboardPps(); ~QQnxVirtualKeyboardPps(); - bool showKeyboard(); - bool hideKeyboard(); + bool showKeyboard() override; + bool hideKeyboard() override; public Q_SLOTS: void start(); protected: - void applyKeyboardOptions(); + void applyKeyboardOptions() override; private Q_SLOTS: void ppsDataReady(); diff --git a/src/plugins/platforms/qnx/qqnxwindow.h b/src/plugins/platforms/qnx/qqnxwindow.h index 2e636c7e3e..e248e04462 100644 --- a/src/plugins/platforms/qnx/qqnxwindow.h +++ b/src/plugins/platforms/qnx/qqnxwindow.h @@ -67,13 +67,13 @@ public: QQnxWindow(QWindow *window, screen_context_t context, bool needRootWindow); virtual ~QQnxWindow(); - void setGeometry(const QRect &rect); - void setVisible(bool visible); - void setOpacity(qreal level); + void setGeometry(const QRect &rect) override; + void setVisible(bool visible) override; + void setOpacity(qreal level) override; - bool isExposed() const; + bool isExposed() const override; - WId winId() const { return window()->type() == Qt::Desktop ? -1 : (WId)m_window; } + WId winId() const override { return window()->type() == Qt::Desktop ? -1 : (WId)m_window; } screen_window_t nativeHandle() const { return m_window; } void setBufferSize(const QSize &size); @@ -81,14 +81,14 @@ public: void setScreen(QQnxScreen *platformScreen); - void setParent(const QPlatformWindow *window); - void raise(); - void lower(); - void requestActivateWindow(); - void setWindowState(Qt::WindowState state); + void setParent(const QPlatformWindow *window) override; + void raise() override; + void lower() override; + void requestActivateWindow() override; + void setWindowState(Qt::WindowState state) override; void setExposed(bool exposed); - void propagateSizeHints(); + void propagateSizeHints() override; void setMMRendererWindowName(const QString &name); void setMMRendererWindow(screen_window_t handle); diff --git a/src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.cpp b/src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.cpp index 06d481b3af..25b1577772 100644 --- a/src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.cpp +++ b/src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.cpp @@ -890,7 +890,7 @@ HRESULT STDMETHODCALLTYPE QWindowsMsaaAccessible::get_accName(VARIANT varID, BST QString shortcut = accessible->text(QAccessible::Accelerator); if (!shortcut.isEmpty()) - name.append(QLatin1Char(' ') + shortcut); + name += QLatin1Char(' ') + shortcut; if (name.size()) { *pszName = QStringToBSTR(name); diff --git a/src/plugins/platforms/windows/qwin10helpers.cpp b/src/plugins/platforms/windows/qwin10helpers.cpp new file mode 100644 index 0000000000..3ded96b9d6 --- /dev/null +++ b/src/plugins/platforms/windows/qwin10helpers.cpp @@ -0,0 +1,167 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qwin10helpers.h" + +#include <QtCore/QDebug> +#include <QtCore/private/qsystemlibrary_p.h> + +#if defined(Q_CC_MINGW) +# define HAS_UI_VIEW_SETTINGS_INTEROP +#elif !defined(Q_CC_MSVC) || _MSC_VER >= 1900 // MSVC2013 is lacking both +# define HAS_UI_VIEW_SETTINGS_INTEROP +# define HAS_UI_VIEW_SETTINGS +#endif + +#include <inspectable.h> + +#ifdef HAS_UI_VIEW_SETTINGS +# include <windows.ui.viewmanagement.h> +#endif + +#ifdef HAS_UI_VIEW_SETTINGS_INTEROP +# include <UIViewSettingsInterop.h> +#endif + +#ifndef HAS_UI_VIEW_SETTINGS_INTEROP +MIDL_INTERFACE("3694dbf9-8f68-44be-8ff5-195c98ede8a6") +IUIViewSettingsInterop : public IInspectable +{ +public: + virtual HRESULT STDMETHODCALLTYPE GetForWindow( + __RPC__in HWND hwnd, + __RPC__in REFIID riid, + __RPC__deref_out_opt void **ppv) = 0; +}; +#endif // !HAS_UI_VIEW_SETTINGS_INTEROP + +#ifndef HAS_UI_VIEW_SETTINGS +namespace ABI { +namespace Windows { +namespace UI { +namespace ViewManagement { + +enum UserInteractionMode { Mouse, Touch }; + +MIDL_INTERFACE("C63657F6-8850-470D-88F8-455E16EA2C26") +IUIViewSettings : public IInspectable +{ +public: + virtual HRESULT STDMETHODCALLTYPE get_UserInteractionMode(UserInteractionMode *value) = 0; +}; + +} // namespace ViewManagement +} // namespace UI +} // namespace Windows +} // namespace ABI +#endif // HAS_UI_VIEW_SETTINGS + +QT_BEGIN_NAMESPACE + +// Starting from Windows 10 +struct QWindowsComBaseDLL +{ + bool init(); + bool isValid() const + { + return roGetActivationFactory != nullptr && windowsCreateStringReference != nullptr; + } + + typedef HRESULT (WINAPI *RoGetActivationFactory)(HSTRING, REFIID, void **); + typedef HRESULT (WINAPI *WindowsCreateStringReference)(PCWSTR, UINT32, HSTRING_HEADER *, HSTRING *); + + RoGetActivationFactory roGetActivationFactory = nullptr; + WindowsCreateStringReference windowsCreateStringReference = nullptr; +}; + +static QWindowsComBaseDLL baseComDll; + +bool QWindowsComBaseDLL::init() +{ + if (QSysInfo::windowsVersion() >= QSysInfo::WV_WINDOWS10 && !isValid()) { + QSystemLibrary library(QStringLiteral("combase")); + roGetActivationFactory = + reinterpret_cast<RoGetActivationFactory>(library.resolve("RoGetActivationFactory")); + windowsCreateStringReference = + reinterpret_cast<WindowsCreateStringReference>(library.resolve("WindowsCreateStringReference")); + } + return isValid(); +} + +// Return tablet mode, note: Does not work for GetDesktopWindow(). +bool qt_windowsIsTabletMode(HWND hwnd) +{ + bool result = false; + + if (!baseComDll.init()) + return false; + + const wchar_t uiViewSettingsId[] = L"Windows.UI.ViewManagement.UIViewSettings"; + HSTRING_HEADER uiViewSettingsIdRefHeader; + HSTRING uiViewSettingsIdHs = nullptr; + const UINT32 uiViewSettingsIdLen = UINT32(sizeof(uiViewSettingsId) / sizeof(uiViewSettingsId[0]) - 1); + if (FAILED(baseComDll.windowsCreateStringReference(uiViewSettingsId, uiViewSettingsIdLen, &uiViewSettingsIdRefHeader, &uiViewSettingsIdHs))) + return false; + + IUIViewSettingsInterop *uiViewSettingsInterop = nullptr; + // __uuidof(IUIViewSettingsInterop); + const GUID uiViewSettingsInteropRefId = {0x3694dbf9, 0x8f68, 0x44be,{0x8f, 0xf5, 0x19, 0x5c, 0x98, 0xed, 0xe8, 0xa6}}; + + HRESULT hr = baseComDll.roGetActivationFactory(uiViewSettingsIdHs, uiViewSettingsInteropRefId, + reinterpret_cast<void **>(&uiViewSettingsInterop)); + if (FAILED(hr)) + return false; + + // __uuidof(ABI::Windows::UI::ViewManagement::IUIViewSettings); + const GUID uiViewSettingsRefId = {0xc63657f6, 0x8850, 0x470d,{0x88, 0xf8, 0x45, 0x5e, 0x16, 0xea, 0x2c, 0x26}}; + ABI::Windows::UI::ViewManagement::IUIViewSettings *viewSettings = nullptr; + hr = uiViewSettingsInterop->GetForWindow(hwnd, uiViewSettingsRefId, + reinterpret_cast<void **>(&viewSettings)); + if (SUCCEEDED(hr)) { + ABI::Windows::UI::ViewManagement::UserInteractionMode currentMode; + hr = viewSettings->get_UserInteractionMode(¤tMode); + if (SUCCEEDED(hr)) + result = currentMode == 1; // Touch, 1 + viewSettings->Release(); + } + uiViewSettingsInterop->Release(); + return result; +} + +QT_END_NAMESPACE diff --git a/src/plugins/platforms/windows/qwin10helpers.h b/src/plugins/platforms/windows/qwin10helpers.h new file mode 100644 index 0000000000..e1485003dd --- /dev/null +++ b/src/plugins/platforms/windows/qwin10helpers.h @@ -0,0 +1,52 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QWIN10HELPERS_H +#define QWIN10HELPERS_H + +#include <QtCore/QtGlobal> +#include <QtCore/qt_windows.h> + +QT_BEGIN_NAMESPACE + +bool qt_windowsIsTabletMode(HWND hwnd); + +QT_END_NAMESPACE + +#endif // QWIN10HELPERS_H diff --git a/src/plugins/platforms/windows/qwindowsclipboard.h b/src/plugins/platforms/windows/qwindowsclipboard.h index 92a27990fc..4f3e7437f6 100644 --- a/src/plugins/platforms/windows/qwindowsclipboard.h +++ b/src/plugins/platforms/windows/qwindowsclipboard.h @@ -73,6 +73,8 @@ public: static QWindowsClipboard *instance() { return m_instance; } + HWND clipboardViewer() const { return m_clipboardViewer; } + private: void clear(); void releaseIData(); diff --git a/src/plugins/platforms/windows/qwindowsintegration.cpp b/src/plugins/platforms/windows/qwindowsintegration.cpp index 168bbd1f49..2f88989b3c 100644 --- a/src/plugins/platforms/windows/qwindowsintegration.cpp +++ b/src/plugins/platforms/windows/qwindowsintegration.cpp @@ -41,6 +41,7 @@ #include "qwindowsintegration.h" #include "qwindowswindow.h" #include "qwindowscontext.h" +#include "qwin10helpers.h" #include "qwindowsopenglcontext.h" #include "qwindowsscreen.h" @@ -508,6 +509,12 @@ QVariant QWindowsIntegration::styleHint(QPlatformIntegration::StyleHint hint) co case KeyboardAutoRepeatRate: return QVariant(keyBoardAutoRepeatRateMS()); #endif + case QPlatformIntegration::ShowIsMaximized: +#ifndef QT_NO_CLIPBOARD + return qt_windowsIsTabletMode(d->m_clipboard.clipboardViewer()); +#else + break; +#endif case QPlatformIntegration::StartDragTime: case QPlatformIntegration::StartDragDistance: case QPlatformIntegration::KeyboardInputInterval: diff --git a/src/plugins/platforms/windows/qwindowskeymapper.cpp b/src/plugins/platforms/windows/qwindowskeymapper.cpp index 1ff447b0c0..6375f89531 100644 --- a/src/plugins/platforms/windows/qwindowskeymapper.cpp +++ b/src/plugins/platforms/windows/qwindowskeymapper.cpp @@ -835,6 +835,9 @@ bool QWindowsKeyMapper::translateKeyEvent(QWindow *widget, HWND hwnd, bool QWindowsKeyMapper::translateMultimediaKeyEventInternal(QWindow *window, const MSG &msg) { #if defined(WM_APPCOMMAND) + // QTBUG-57198, do not send mouse-synthesized commands as key events in addition + if (GET_DEVICE_LPARAM(msg.lParam) == FAPPCOMMAND_MOUSE) + return false; const int cmd = GET_APPCOMMAND_LPARAM(msg.lParam); const int dwKeys = GET_KEYSTATE_LPARAM(msg.lParam); int state = 0; diff --git a/src/plugins/platforms/windows/windows.pri b/src/plugins/platforms/windows/windows.pri index 5071cd8e21..7d3ecc8aa2 100644 --- a/src/plugins/platforms/windows/windows.pri +++ b/src/plugins/platforms/windows/windows.pri @@ -25,7 +25,8 @@ SOURCES += \ $$PWD/qwindowsdialoghelpers.cpp \ $$PWD/qwindowsservices.cpp \ $$PWD/qwindowsnativeinterface.cpp \ - $$PWD/qwindowsopengltester.cpp + $$PWD/qwindowsopengltester.cpp \ + $$PWD/qwin10helpers.cpp HEADERS += \ $$PWD/qwindowswindow.h \ @@ -46,6 +47,7 @@ HEADERS += \ $$PWD/qwindowsnativeinterface.h \ $$PWD/qwindowsopengltester.h \ $$PWD/qwindowsthreadpoolrunner.h + $$PWD/qwin10helpers.h INCLUDEPATH += $$PWD diff --git a/src/plugins/platforms/winrt/main.cpp b/src/plugins/platforms/winrt/main.cpp index a0b31e0e25..5d0d9e94eb 100644 --- a/src/plugins/platforms/winrt/main.cpp +++ b/src/plugins/platforms/winrt/main.cpp @@ -50,7 +50,7 @@ class QWinRTIntegrationPlugin : public QPlatformIntegrationPlugin public: QStringList keys() const; - QPlatformIntegration *create(const QString&, const QStringList&); + QPlatformIntegration *create(const QString&, const QStringList&) override; }; QStringList QWinRTIntegrationPlugin::keys() const diff --git a/src/plugins/platforms/winrt/qwinrtbackingstore.h b/src/plugins/platforms/winrt/qwinrtbackingstore.h index 41b27debcc..cd05faa63e 100644 --- a/src/plugins/platforms/winrt/qwinrtbackingstore.h +++ b/src/plugins/platforms/winrt/qwinrtbackingstore.h @@ -58,12 +58,12 @@ class QWinRTBackingStore : public QPlatformBackingStore public: explicit QWinRTBackingStore(QWindow *window); ~QWinRTBackingStore(); - QPaintDevice *paintDevice(); - void beginPaint(const QRegion &); - void endPaint(); - void flush(QWindow *window, const QRegion ®ion, const QPoint &offset); - void resize(const QSize &size, const QRegion &staticContents); - QImage toImage() const Q_DECL_OVERRIDE; + QPaintDevice *paintDevice() override; + void beginPaint(const QRegion &) override; + void endPaint() override; + void flush(QWindow *window, const QRegion ®ion, const QPoint &offset) override; + void resize(const QSize &size, const QRegion &staticContents) override; + QImage toImage() const override; private: bool initialize(); diff --git a/src/plugins/platforms/winrt/qwinrtclipboard.h b/src/plugins/platforms/winrt/qwinrtclipboard.h index 3e6ee109fd..2e3e2b834d 100644 --- a/src/plugins/platforms/winrt/qwinrtclipboard.h +++ b/src/plugins/platforms/winrt/qwinrtclipboard.h @@ -64,9 +64,9 @@ class QWinRTClipboard: public QPlatformClipboard public: QWinRTClipboard(); - QMimeData *mimeData(QClipboard::Mode mode = QClipboard::Clipboard) Q_DECL_OVERRIDE; - void setMimeData(QMimeData *data, QClipboard::Mode mode = QClipboard::Clipboard) Q_DECL_OVERRIDE; - bool supportsMode(QClipboard::Mode mode) const Q_DECL_OVERRIDE; + QMimeData *mimeData(QClipboard::Mode mode = QClipboard::Clipboard) override; + void setMimeData(QMimeData *data, QClipboard::Mode mode = QClipboard::Clipboard) override; + bool supportsMode(QClipboard::Mode mode) const override; HRESULT onContentChanged(IInspectable *, IInspectable *); private: diff --git a/src/plugins/platforms/winrt/qwinrtcursor.h b/src/plugins/platforms/winrt/qwinrtcursor.h index baf902c7af..7f579f1531 100644 --- a/src/plugins/platforms/winrt/qwinrtcursor.h +++ b/src/plugins/platforms/winrt/qwinrtcursor.h @@ -51,9 +51,9 @@ public: explicit QWinRTCursor(); ~QWinRTCursor(); #ifndef QT_NO_CURSOR - void changeCursor(QCursor * windowCursor, QWindow *window); + void changeCursor(QCursor * windowCursor, QWindow *window) override; #endif - QPoint pos() const; + QPoint pos() const override; private: QScopedPointer<QWinRTCursorPrivate> d_ptr; diff --git a/src/plugins/platforms/winrt/qwinrtdrag.h b/src/plugins/platforms/winrt/qwinrtdrag.h index 97079d831b..dad3e9892d 100644 --- a/src/plugins/platforms/winrt/qwinrtdrag.h +++ b/src/plugins/platforms/winrt/qwinrtdrag.h @@ -75,9 +75,9 @@ public: QWinRTInternalMimeData(); virtual ~QWinRTInternalMimeData(); - bool hasFormat_sys(const QString &mimetype) const Q_DECL_OVERRIDE; - QStringList formats_sys() const Q_DECL_OVERRIDE; - QVariant retrieveData_sys(const QString &mimetype, QVariant::Type preferredType) const Q_DECL_OVERRIDE; + bool hasFormat_sys(const QString &mimetype) const override; + QStringList formats_sys() const override; + QVariant retrieveData_sys(const QString &mimetype, QVariant::Type preferredType) const override; void setDataView(const Microsoft::WRL::ComPtr<ABI::Windows::ApplicationModel::DataTransfer::IDataPackageView> &d); private: @@ -91,8 +91,8 @@ public: virtual ~QWinRTDrag(); static QWinRTDrag *instance(); - QMimeData *platformDropData(void) Q_DECL_OVERRIDE; - Qt::DropAction drag(QDrag *) Q_DECL_OVERRIDE; + QMimeData *platformDropData(void) override; + Qt::DropAction drag(QDrag *) override; void setDropTarget(QWindow *target); diff --git a/src/plugins/platforms/winrt/qwinrteglcontext.h b/src/plugins/platforms/winrt/qwinrteglcontext.h index 12b6238cb1..5c75aa90d0 100644 --- a/src/plugins/platforms/winrt/qwinrteglcontext.h +++ b/src/plugins/platforms/winrt/qwinrteglcontext.h @@ -52,14 +52,14 @@ public: explicit QWinRTEGLContext(QOpenGLContext *context); ~QWinRTEGLContext(); - void initialize() Q_DECL_OVERRIDE; + void initialize() override; - bool makeCurrent(QPlatformSurface *windowSurface) Q_DECL_OVERRIDE; - void doneCurrent() Q_DECL_OVERRIDE; - void swapBuffers(QPlatformSurface *windowSurface) Q_DECL_OVERRIDE; + bool makeCurrent(QPlatformSurface *windowSurface) override; + void doneCurrent() override; + void swapBuffers(QPlatformSurface *windowSurface) override; - QSurfaceFormat format() const Q_DECL_OVERRIDE; - QFunctionPointer getProcAddress(const char *procName) Q_DECL_OVERRIDE; + QSurfaceFormat format() const override; + QFunctionPointer getProcAddress(const char *procName) override; static EGLDisplay display(); private: diff --git a/src/plugins/platforms/winrt/qwinrteventdispatcher.h b/src/plugins/platforms/winrt/qwinrteventdispatcher.h index c04e9fca12..4c5c19c6b0 100644 --- a/src/plugins/platforms/winrt/qwinrteventdispatcher.h +++ b/src/plugins/platforms/winrt/qwinrteventdispatcher.h @@ -51,8 +51,8 @@ public: explicit QWinRTEventDispatcher(QObject *parent = 0); protected: - bool hasPendingEvents(); - bool sendPostedEvents(QEventLoop::ProcessEventsFlags flags); + bool hasPendingEvents() override; + bool sendPostedEvents(QEventLoop::ProcessEventsFlags flags) override; }; QT_END_NAMESPACE diff --git a/src/plugins/platforms/winrt/qwinrtfiledialoghelper.h b/src/plugins/platforms/winrt/qwinrtfiledialoghelper.h index f88bed76ae..413dee7459 100644 --- a/src/plugins/platforms/winrt/qwinrtfiledialoghelper.h +++ b/src/plugins/platforms/winrt/qwinrtfiledialoghelper.h @@ -72,21 +72,21 @@ public: explicit QWinRTFileDialogHelper(); ~QWinRTFileDialogHelper(); - void exec() Q_DECL_OVERRIDE; - bool show(Qt::WindowFlags, Qt::WindowModality, QWindow *) Q_DECL_OVERRIDE; - void hide() Q_DECL_OVERRIDE; + void exec() override; + bool show(Qt::WindowFlags, Qt::WindowModality, QWindow *) override; + void hide() override; #ifdef Q_OS_WINPHONE - bool eventFilter(QObject *o, QEvent *e) Q_DECL_OVERRIDE; + bool eventFilter(QObject *o, QEvent *e) override; #endif - bool defaultNameFilterDisables() const Q_DECL_OVERRIDE { return false; } - void setDirectory(const QUrl &directory) Q_DECL_OVERRIDE; - QUrl directory() const Q_DECL_OVERRIDE; - void selectFile(const QUrl &saveFileName); - QList<QUrl> selectedFiles() const Q_DECL_OVERRIDE; - void setFilter() Q_DECL_OVERRIDE { } - void selectNameFilter(const QString &selectedNameFilter) Q_DECL_OVERRIDE; - QString selectedNameFilter() const; + bool defaultNameFilterDisables() const override { return false; } + void setDirectory(const QUrl &directory) override; + QUrl directory() const override; + void selectFile(const QUrl &saveFileName) override; + QList<QUrl> selectedFiles() const override; + void setFilter() override { } + void selectNameFilter(const QString &selectedNameFilter) override; + QString selectedNameFilter() const override; #ifndef Q_OS_WINPHONE HRESULT onSingleFilePicked(ABI::Windows::Foundation::IAsyncOperation<ABI::Windows::Storage::StorageFile *> *, diff --git a/src/plugins/platforms/winrt/qwinrtfileengine.h b/src/plugins/platforms/winrt/qwinrtfileengine.h index 70d5aea30d..73ff54b0c8 100644 --- a/src/plugins/platforms/winrt/qwinrtfileengine.h +++ b/src/plugins/platforms/winrt/qwinrtfileengine.h @@ -58,7 +58,7 @@ class QWinRTFileEngineHandler : public QAbstractFileEngineHandler public: QWinRTFileEngineHandler(); ~QWinRTFileEngineHandler(); - QAbstractFileEngine *create(const QString &fileName) const Q_DECL_OVERRIDE; + QAbstractFileEngine *create(const QString &fileName) const override; static void registerFile(const QString &fileName, ABI::Windows::Storage::IStorageItem *file); static ABI::Windows::Storage::IStorageItem *registeredFile(const QString &fileName); @@ -75,23 +75,23 @@ public: QWinRTFileEngine(const QString &fileName, ABI::Windows::Storage::IStorageItem *file); ~QWinRTFileEngine(); - bool open(QIODevice::OpenMode openMode) Q_DECL_OVERRIDE; - bool close() Q_DECL_OVERRIDE; - bool flush() Q_DECL_OVERRIDE; - qint64 size() const Q_DECL_OVERRIDE; - qint64 pos() const Q_DECL_OVERRIDE; - bool seek(qint64 pos) Q_DECL_OVERRIDE; - bool remove() Q_DECL_OVERRIDE; - bool copy(const QString &newName) Q_DECL_OVERRIDE; - bool rename(const QString &newName) Q_DECL_OVERRIDE; - bool renameOverwrite(const QString &newName) Q_DECL_OVERRIDE; - FileFlags fileFlags(FileFlags type=FileInfoAll) const Q_DECL_OVERRIDE; - bool setPermissions(uint perms) Q_DECL_OVERRIDE; - QString fileName(FileName type=DefaultName) const Q_DECL_OVERRIDE; - QDateTime fileTime(FileTime type) const Q_DECL_OVERRIDE; + bool open(QIODevice::OpenMode openMode) override; + bool close() override; + bool flush() override; + qint64 size() const override; + qint64 pos() const override; + bool seek(qint64 pos) override; + bool remove() override; + bool copy(const QString &newName) override; + bool rename(const QString &newName) override; + bool renameOverwrite(const QString &newName) override; + FileFlags fileFlags(FileFlags type=FileInfoAll) const override; + bool setPermissions(uint perms) override; + QString fileName(FileName type=DefaultName) const override; + QDateTime fileTime(FileTime type) const override; - qint64 read(char *data, qint64 maxlen) Q_DECL_OVERRIDE; - qint64 write(const char *data, qint64 len) Q_DECL_OVERRIDE; + qint64 read(char *data, qint64 maxlen) override; + qint64 write(const char *data, qint64 len) override; private: QScopedPointer<QWinRTFileEnginePrivate> d_ptr; diff --git a/src/plugins/platforms/winrt/qwinrtinputcontext.h b/src/plugins/platforms/winrt/qwinrtinputcontext.h index 9d5c4187e2..13a0088ddc 100644 --- a/src/plugins/platforms/winrt/qwinrtinputcontext.h +++ b/src/plugins/platforms/winrt/qwinrtinputcontext.h @@ -70,13 +70,13 @@ class QWinRTInputContext : public QPlatformInputContext public: explicit QWinRTInputContext(QWinRTScreen *); - QRectF keyboardRect() const; + QRectF keyboardRect() const override; - bool isInputPanelVisible() const; + bool isInputPanelVisible() const override; #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP) - void showInputPanel(); - void hideInputPanel(); + void showInputPanel() override; + void hideInputPanel() override; #endif private slots: diff --git a/src/plugins/platforms/winrt/qwinrtintegration.h b/src/plugins/platforms/winrt/qwinrtintegration.h index 7b4d5531fc..e22532a266 100644 --- a/src/plugins/platforms/winrt/qwinrtintegration.h +++ b/src/plugins/platforms/winrt/qwinrtintegration.h @@ -85,28 +85,28 @@ public: bool succeeded() const; - bool hasCapability(QPlatformIntegration::Capability cap) const Q_DECL_OVERRIDE; - QVariant styleHint(StyleHint hint) const Q_DECL_OVERRIDE; - - QPlatformWindow *createPlatformWindow(QWindow *window) const Q_DECL_OVERRIDE; - QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const Q_DECL_OVERRIDE; - QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const Q_DECL_OVERRIDE; - QAbstractEventDispatcher *createEventDispatcher() const Q_DECL_OVERRIDE; - void initialize() Q_DECL_OVERRIDE; - QPlatformFontDatabase *fontDatabase() const Q_DECL_OVERRIDE; - QPlatformInputContext *inputContext() const Q_DECL_OVERRIDE; - QPlatformServices *services() const Q_DECL_OVERRIDE; - QPlatformClipboard *clipboard() const Q_DECL_OVERRIDE; + bool hasCapability(QPlatformIntegration::Capability cap) const override; + QVariant styleHint(StyleHint hint) const override; + + QPlatformWindow *createPlatformWindow(QWindow *window) const override; + QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const override; + QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const override; + QAbstractEventDispatcher *createEventDispatcher() const override; + void initialize() override; + QPlatformFontDatabase *fontDatabase() const override; + QPlatformInputContext *inputContext() const override; + QPlatformServices *services() const override; + QPlatformClipboard *clipboard() const override; #ifndef QT_NO_DRAGANDDROP - QPlatformDrag *drag() const Q_DECL_OVERRIDE; + QPlatformDrag *drag() const override; #endif - Qt::KeyboardModifiers queryKeyboardModifiers() const Q_DECL_OVERRIDE; + Qt::KeyboardModifiers queryKeyboardModifiers() const override; - QStringList themeNames() const Q_DECL_OVERRIDE; - QPlatformTheme *createPlatformTheme(const QString &name) const Q_DECL_OVERRIDE; + QStringList themeNames() const override; + QPlatformTheme *createPlatformTheme(const QString &name) const override; - QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const Q_DECL_OVERRIDE; + QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const override; private: #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP) HRESULT onBackButtonPressed(IInspectable *, ABI::Windows::Phone::UI::Input::IBackPressedEventArgs *args); diff --git a/src/plugins/platforms/winrt/qwinrtmessagedialoghelper.h b/src/plugins/platforms/winrt/qwinrtmessagedialoghelper.h index 439e8f592f..14b6d4b715 100644 --- a/src/plugins/platforms/winrt/qwinrtmessagedialoghelper.h +++ b/src/plugins/platforms/winrt/qwinrtmessagedialoghelper.h @@ -69,11 +69,11 @@ public: explicit QWinRTMessageDialogHelper(const QWinRTTheme *theme); ~QWinRTMessageDialogHelper(); - void exec(); + void exec() override; bool show(Qt::WindowFlags windowFlags, Qt::WindowModality windowModality, - QWindow *parent); - void hide(); + QWindow *parent) override; + void hide() override; private: HRESULT onCompleted(ABI::Windows::Foundation::IAsyncOperation<ABI::Windows::UI::Popups::IUICommand *> *asyncInfo, diff --git a/src/plugins/platforms/winrt/qwinrtscreen.h b/src/plugins/platforms/winrt/qwinrtscreen.h index e489e208d5..2f1112472c 100644 --- a/src/plugins/platforms/winrt/qwinrtscreen.h +++ b/src/plugins/platforms/winrt/qwinrtscreen.h @@ -89,19 +89,19 @@ public: explicit QWinRTScreen(); ~QWinRTScreen(); - QRect geometry() const Q_DECL_OVERRIDE; - QRect availableGeometry() const Q_DECL_OVERRIDE; - int depth() const Q_DECL_OVERRIDE; - QImage::Format format() const Q_DECL_OVERRIDE; - QSizeF physicalSize() const Q_DECL_OVERRIDE; - QDpi logicalDpi() const Q_DECL_OVERRIDE; - qreal pixelDensity() const Q_DECL_OVERRIDE; + QRect geometry() const override; + QRect availableGeometry() const override; + int depth() const override; + QImage::Format format() const override; + QSizeF physicalSize() const override; + QDpi logicalDpi() const override; + qreal pixelDensity() const override; qreal scaleFactor() const; - QPlatformCursor *cursor() const Q_DECL_OVERRIDE; + QPlatformCursor *cursor() const override; Qt::KeyboardModifiers keyboardModifiers() const; - Qt::ScreenOrientation nativeOrientation() const Q_DECL_OVERRIDE; - Qt::ScreenOrientation orientation() const Q_DECL_OVERRIDE; + Qt::ScreenOrientation nativeOrientation() const override; + Qt::ScreenOrientation orientation() const override; QWindow *topWindow() const; QWindow *windowAt(const QPoint &pos); diff --git a/src/plugins/platforms/winrt/qwinrtservices.h b/src/plugins/platforms/winrt/qwinrtservices.h index 1adc6c381c..80b9a6c92a 100644 --- a/src/plugins/platforms/winrt/qwinrtservices.h +++ b/src/plugins/platforms/winrt/qwinrtservices.h @@ -52,8 +52,8 @@ public: explicit QWinRTServices(); ~QWinRTServices(); - bool openUrl(const QUrl &url); - bool openDocument(const QUrl &url); + bool openUrl(const QUrl &url) override; + bool openDocument(const QUrl &url) override; private: QScopedPointer<QWinRTServicesPrivate> d_ptr; diff --git a/src/plugins/platforms/winrt/qwinrttheme.h b/src/plugins/platforms/winrt/qwinrttheme.h index bd244f9fdb..cc5fc851e7 100644 --- a/src/plugins/platforms/winrt/qwinrttheme.h +++ b/src/plugins/platforms/winrt/qwinrttheme.h @@ -54,10 +54,10 @@ class QWinRTTheme : public QPlatformTheme public: QWinRTTheme(); - bool usePlatformNativeDialog(DialogType type) const; - QPlatformDialogHelper *createPlatformDialogHelper(DialogType type) const; + bool usePlatformNativeDialog(DialogType type) const override; + QPlatformDialogHelper *createPlatformDialogHelper(DialogType type) const override; - const QPalette *palette(Palette type = SystemPalette) const Q_DECL_OVERRIDE; + const QPalette *palette(Palette type = SystemPalette) const override; static QVariant styleHint(QPlatformIntegration::StyleHint hint); QVariant themeHint(ThemeHint hint) const override; diff --git a/src/plugins/platforms/winrt/qwinrtwindow.h b/src/plugins/platforms/winrt/qwinrtwindow.h index 48e092d455..968edcfa85 100644 --- a/src/plugins/platforms/winrt/qwinrtwindow.h +++ b/src/plugins/platforms/winrt/qwinrtwindow.h @@ -56,19 +56,19 @@ public: QWinRTWindow(QWindow *window); ~QWinRTWindow(); - QSurfaceFormat format() const; - bool isActive() const; - bool isExposed() const; - void setGeometry(const QRect &rect); - void setVisible(bool visible); - void setWindowTitle(const QString &title); - void raise(); - void lower(); + QSurfaceFormat format() const override; + bool isActive() const override; + bool isExposed() const override; + void setGeometry(const QRect &rect) override; + void setVisible(bool visible) override; + void setWindowTitle(const QString &title) override; + void raise() override; + void lower() override; - WId winId() const Q_DECL_OVERRIDE; + WId winId() const override; - qreal devicePixelRatio() const Q_DECL_OVERRIDE; - void setWindowState(Qt::WindowState state) Q_DECL_OVERRIDE; + qreal devicePixelRatio() const override; + void setWindowState(Qt::WindowState state) override; EGLSurface eglSurface() const; void createEglSurface(EGLDisplay display, EGLConfig config); diff --git a/src/plugins/platforms/xcb/gl_integrations/qxcbglintegrationfactory.cpp b/src/plugins/platforms/xcb/gl_integrations/qxcbglintegrationfactory.cpp index 8e1688dbe8..6650ca44ae 100644 --- a/src/plugins/platforms/xcb/gl_integrations/qxcbglintegrationfactory.cpp +++ b/src/plugins/platforms/xcb/gl_integrations/qxcbglintegrationfactory.cpp @@ -55,29 +55,6 @@ Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, directLoader, (QXcbGlIntegrationFactoryInterface_iid, QLatin1String(""), Qt::CaseInsensitive)) #endif // !QT_NO_LIBRARY -QStringList QXcbGlIntegrationFactory::keys(const QString &pluginPath) -{ - QStringList list; -#ifndef QT_NO_LIBRARY - if (!pluginPath.isEmpty()) { - QCoreApplication::addLibraryPath(pluginPath); - list = directLoader()->keyMap().values(); - if (!list.isEmpty()) { - const QString postFix = QStringLiteral(" (from ") - + QDir::toNativeSeparators(pluginPath) - + QLatin1Char(')'); - const QStringList::iterator end = list.end(); - for (QStringList::iterator it = list.begin(); it != end; ++it) - (*it).append(postFix); - } - } -#else - Q_UNUSED(pluginPath); -#endif - list.append(loader()->keyMap().values()); - return list; -} - QXcbGlIntegration *QXcbGlIntegrationFactory::create(const QString &platform, const QString &pluginPath) { #ifndef QT_NO_LIBRARY diff --git a/src/plugins/platforms/xcb/gl_integrations/qxcbglintegrationfactory.h b/src/plugins/platforms/xcb/gl_integrations/qxcbglintegrationfactory.h index 633b11a505..c4aa0a3d8d 100644 --- a/src/plugins/platforms/xcb/gl_integrations/qxcbglintegrationfactory.h +++ b/src/plugins/platforms/xcb/gl_integrations/qxcbglintegrationfactory.h @@ -49,7 +49,6 @@ class QXcbGlIntegration; class QXcbGlIntegrationFactory { public: - static QStringList keys(const QString &pluginPath = QString()); static QXcbGlIntegration *create(const QString &name, const QString &platformPluginPath = QString()); }; diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglintegration.h b/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglintegration.h index 0cb4a878a1..54a9f5cd83 100644 --- a/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglintegration.h +++ b/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglintegration.h @@ -62,13 +62,13 @@ public: QXcbEglIntegration(); ~QXcbEglIntegration(); - bool initialize(QXcbConnection *connection) Q_DECL_OVERRIDE; + bool initialize(QXcbConnection *connection) override; - QXcbWindow *createWindow(QWindow *window) const Q_DECL_OVERRIDE; - QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const Q_DECL_OVERRIDE; - QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const Q_DECL_OVERRIDE; + QXcbWindow *createWindow(QWindow *window) const override; + QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const override; + QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const override; - bool supportsThreadedOpenGL() const Q_DECL_OVERRIDE { return true; } + bool supportsThreadedOpenGL() const override { return true; } EGLDisplay eglDisplay() const { return m_egl_display; } void *xlib_display() const; diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglnativeinterfacehandler.h b/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglnativeinterfacehandler.h index 6e717e4491..7c83d0e240 100644 --- a/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglnativeinterfacehandler.h +++ b/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglnativeinterfacehandler.h @@ -55,9 +55,9 @@ public: QXcbEglNativeInterfaceHandler(QXcbNativeInterface *nativeInterface); - QPlatformNativeInterface::NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource) const Q_DECL_OVERRIDE; - QPlatformNativeInterface::NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) const Q_DECL_OVERRIDE; - QPlatformNativeInterface::NativeResourceForWindowFunction nativeResourceFunctionForWindow(const QByteArray &resource) const Q_DECL_OVERRIDE; + QPlatformNativeInterface::NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource) const override; + QPlatformNativeInterface::NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) const override; + QPlatformNativeInterface::NativeResourceForWindowFunction nativeResourceFunctionForWindow(const QByteArray &resource) const override; private: static void *eglDisplay(); static void *eglDisplayForWindow(QWindow *window); diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglwindow.h b/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglwindow.h index 48fc6dce70..3090cef735 100644 --- a/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglwindow.h +++ b/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglwindow.h @@ -59,11 +59,11 @@ public: QXcbEglIntegration *glIntegration() const { return m_glIntegration; } protected: - void create() Q_DECL_OVERRIDE; - void resolveFormat(const QSurfaceFormat &format) Q_DECL_OVERRIDE; + void create() override; + void resolveFormat(const QSurfaceFormat &format) override; #ifdef XCB_USE_XLIB - const xcb_visualtype_t *createVisual() Q_DECL_OVERRIDE; + const xcb_visualtype_t *createVisual() override; #endif private: diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.h b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.h index bf1f1b324b..3dfe0ac618 100644 --- a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.h +++ b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.h @@ -60,14 +60,14 @@ public: const QVariant &nativeHandle); ~QGLXContext(); - bool makeCurrent(QPlatformSurface *surface) Q_DECL_OVERRIDE; - void doneCurrent() Q_DECL_OVERRIDE; - void swapBuffers(QPlatformSurface *surface) Q_DECL_OVERRIDE; - QFunctionPointer getProcAddress(const char *procName) Q_DECL_OVERRIDE; + bool makeCurrent(QPlatformSurface *surface) override; + void doneCurrent() override; + void swapBuffers(QPlatformSurface *surface) override; + QFunctionPointer getProcAddress(const char *procName) override; - QSurfaceFormat format() const Q_DECL_OVERRIDE; - bool isSharing() const Q_DECL_OVERRIDE; - bool isValid() const Q_DECL_OVERRIDE; + QSurfaceFormat format() const override; + bool isSharing() const override; + bool isValid() const override; GLXContext glxContext() const { return m_context; } GLXFBConfig glxConfig() const { return m_config; } @@ -100,8 +100,8 @@ public: explicit QGLXPbuffer(QOffscreenSurface *offscreenSurface); ~QGLXPbuffer(); - QSurfaceFormat format() const Q_DECL_OVERRIDE { return m_format; } - bool isValid() const Q_DECL_OVERRIDE { return m_pbuffer != 0; } + QSurfaceFormat format() const override { return m_format; } + bool isValid() const override { return m_pbuffer != 0; } GLXPbuffer pbuffer() const { return m_pbuffer; } diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxintegration.h b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxintegration.h index 8f04db31b2..26cb233a59 100644 --- a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxintegration.h +++ b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxintegration.h @@ -52,15 +52,15 @@ public: QXcbGlxIntegration(); ~QXcbGlxIntegration(); - bool initialize(QXcbConnection *connection) Q_DECL_OVERRIDE; - bool handleXcbEvent(xcb_generic_event_t *event, uint responseType) Q_DECL_OVERRIDE; + bool initialize(QXcbConnection *connection) override; + bool handleXcbEvent(xcb_generic_event_t *event, uint responseType) override; - QXcbWindow *createWindow(QWindow *window) const Q_DECL_OVERRIDE; - QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const Q_DECL_OVERRIDE; - QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const Q_DECL_OVERRIDE; + QXcbWindow *createWindow(QWindow *window) const override; + QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const override; + QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const override; - virtual bool supportsThreadedOpenGL() const Q_DECL_OVERRIDE; - virtual bool supportsSwitchableWidgetComposition() const Q_DECL_OVERRIDE; + bool supportsThreadedOpenGL() const override; + bool supportsSwitchableWidgetComposition() const override; private: QXcbConnection *m_connection; diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxnativeinterfacehandler.h b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxnativeinterfacehandler.h index 1748f2298c..d877732725 100644 --- a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxnativeinterfacehandler.h +++ b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxnativeinterfacehandler.h @@ -53,7 +53,7 @@ public: }; QXcbGlxNativeInterfaceHandler(QXcbNativeInterface *nativeInterface); - QPlatformNativeInterface::NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) const Q_DECL_OVERRIDE; + QPlatformNativeInterface::NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) const override; private: static void *glxContextForContext(QOpenGLContext *context); diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxwindow.h b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxwindow.h index 9519245130..14b2d5e6eb 100644 --- a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxwindow.h +++ b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxwindow.h @@ -52,7 +52,7 @@ public: ~QXcbGlxWindow(); protected: - const xcb_visualtype_t *createVisual() Q_DECL_OVERRIDE; + const xcb_visualtype_t *createVisual() override; }; QT_END_NAMESPACE diff --git a/src/plugins/platforms/xcb/qxcbbackingstore.cpp b/src/plugins/platforms/xcb/qxcbbackingstore.cpp index 3d09b1c139..f095288221 100644 --- a/src/plugins/platforms/xcb/qxcbbackingstore.cpp +++ b/src/plugins/platforms/xcb/qxcbbackingstore.cpp @@ -122,7 +122,7 @@ public: , m_image(image) { } - bool doLock(AccessTypes access, const QRect &rect) Q_DECL_OVERRIDE + bool doLock(AccessTypes access, const QRect &rect) override { Q_UNUSED(rect); if (access & ~(QPlatformGraphicsBuffer::SWReadAccess | QPlatformGraphicsBuffer::SWWriteAccess)) @@ -131,13 +131,13 @@ public: m_access_lock |= access; return true; } - void doUnlock() Q_DECL_OVERRIDE { m_access_lock = None; } + void doUnlock() override { m_access_lock = None; } - const uchar *data() const Q_DECL_OVERRIDE { return m_image->bits(); } - uchar *data() Q_DECL_OVERRIDE { return m_image->bits(); } - int bytesPerLine() const Q_DECL_OVERRIDE { return m_image->bytesPerLine(); } + const uchar *data() const override { return m_image->bits(); } + uchar *data() override { return m_image->bits(); } + int bytesPerLine() const override { return m_image->bytesPerLine(); } - Origin origin() const Q_DECL_OVERRIDE { return QPlatformGraphicsBuffer::OriginTopLeft; } + Origin origin() const override { return QPlatformGraphicsBuffer::OriginTopLeft; } private: AccessTypes m_access_lock; QImage *m_image; diff --git a/src/plugins/platforms/xcb/qxcbbackingstore.h b/src/plugins/platforms/xcb/qxcbbackingstore.h index 6af679d28a..2985432b7f 100644 --- a/src/plugins/platforms/xcb/qxcbbackingstore.h +++ b/src/plugins/platforms/xcb/qxcbbackingstore.h @@ -57,22 +57,22 @@ public: QXcbBackingStore(QWindow *widget); ~QXcbBackingStore(); - QPaintDevice *paintDevice() Q_DECL_OVERRIDE; - void flush(QWindow *window, const QRegion ®ion, const QPoint &offset) Q_DECL_OVERRIDE; + QPaintDevice *paintDevice() override; + void flush(QWindow *window, const QRegion ®ion, const QPoint &offset) override; #ifndef QT_NO_OPENGL void composeAndFlush(QWindow *window, const QRegion ®ion, const QPoint &offset, QPlatformTextureList *textures, QOpenGLContext *context, - bool translucentBackground) Q_DECL_OVERRIDE; + bool translucentBackground) override; #endif - QImage toImage() const Q_DECL_OVERRIDE; + QImage toImage() const override; - QPlatformGraphicsBuffer *graphicsBuffer() const Q_DECL_OVERRIDE; + QPlatformGraphicsBuffer *graphicsBuffer() const override; - void resize(const QSize &size, const QRegion &staticContents) Q_DECL_OVERRIDE; - bool scroll(const QRegion &area, int dx, int dy) Q_DECL_OVERRIDE; + void resize(const QSize &size, const QRegion &staticContents) override; + bool scroll(const QRegion &area, int dx, int dy) override; - void beginPaint(const QRegion &) Q_DECL_OVERRIDE; - void endPaint() Q_DECL_OVERRIDE; + void beginPaint(const QRegion &) override; + void endPaint() override; private: QXcbShmImage *m_image; diff --git a/src/plugins/platforms/xcb/qxcbclipboard.cpp b/src/plugins/platforms/xcb/qxcbclipboard.cpp index 38e91cc9f6..cee011bbdf 100644 --- a/src/plugins/platforms/xcb/qxcbclipboard.cpp +++ b/src/plugins/platforms/xcb/qxcbclipboard.cpp @@ -90,7 +90,7 @@ public: } protected: - QStringList formats_sys() const Q_DECL_OVERRIDE + QStringList formats_sys() const override { if (isEmpty()) return QStringList(); @@ -120,13 +120,13 @@ protected: return formatList; } - bool hasFormat_sys(const QString &format) const Q_DECL_OVERRIDE + bool hasFormat_sys(const QString &format) const override { QStringList list = formats(); return list.contains(format); } - QVariant retrieveData_sys(const QString &fmt, QVariant::Type requestedType) const Q_DECL_OVERRIDE + QVariant retrieveData_sys(const QString &fmt, QVariant::Type requestedType) const override { if (fmt.isEmpty() || isEmpty()) return QByteArray(); @@ -238,7 +238,7 @@ public: } protected: - void timerEvent(QTimerEvent *ev) Q_DECL_OVERRIDE + void timerEvent(QTimerEvent *ev) override { if (ev->timerId() == abort_timer) { // this can happen when the X client we are sending data diff --git a/src/plugins/platforms/xcb/qxcbclipboard.h b/src/plugins/platforms/xcb/qxcbclipboard.h index ffd565c56f..a0a4f4e5a1 100644 --- a/src/plugins/platforms/xcb/qxcbclipboard.h +++ b/src/plugins/platforms/xcb/qxcbclipboard.h @@ -59,11 +59,11 @@ public: QXcbClipboard(QXcbConnection *connection); ~QXcbClipboard(); - QMimeData *mimeData(QClipboard::Mode mode) Q_DECL_OVERRIDE; - void setMimeData(QMimeData *data, QClipboard::Mode mode) Q_DECL_OVERRIDE; + QMimeData *mimeData(QClipboard::Mode mode) override; + void setMimeData(QMimeData *data, QClipboard::Mode mode) override; - bool supportsMode(QClipboard::Mode mode) const Q_DECL_OVERRIDE; - bool ownsMode(QClipboard::Mode mode) const Q_DECL_OVERRIDE; + bool supportsMode(QClipboard::Mode mode) const override; + bool ownsMode(QClipboard::Mode mode) const override; QXcbScreen *screen() const; diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp index 57ce357a17..2834ff3224 100644 --- a/src/plugins/platforms/xcb/qxcbconnection.cpp +++ b/src/plugins/platforms/xcb/qxcbconnection.cpp @@ -1997,8 +1997,7 @@ void QXcbConnection::initializeAllAtoms() { Q_ASSERT(i == QXcbAtom::NPredefinedAtoms); - QByteArray settings_atom_name("_QT_SETTINGS_TIMESTAMP_"); - settings_atom_name += m_displayName; + const QByteArray settings_atom_name = "_QT_SETTINGS_TIMESTAMP_" + m_displayName; names[i++] = settings_atom_name; xcb_intern_atom_cookie_t cookies[QXcbAtom::NAtoms]; diff --git a/src/plugins/platforms/xcb/qxcbconnection.h b/src/plugins/platforms/xcb/qxcbconnection.h index c9fc27997b..3754890796 100644 --- a/src/plugins/platforms/xcb/qxcbconnection.h +++ b/src/plugins/platforms/xcb/qxcbconnection.h @@ -315,7 +315,7 @@ class QXcbEventReader : public QThread public: QXcbEventReader(QXcbConnection *connection); - void run() Q_DECL_OVERRIDE; + void run() override; QXcbEventArray *lock(); void unlock(); @@ -504,6 +504,7 @@ public: #endif #ifdef XCB_USE_XINPUT22 + bool startSystemResizeForTouchBegin(xcb_window_t window, const QPoint &point, Qt::Corner corner); bool xi2SetMouseGrabEnabled(xcb_window_t w, bool grab); #endif Qt::MouseButton xiToQtMouseButton(uint32_t b); @@ -519,7 +520,7 @@ public: #endif protected: - bool event(QEvent *e) Q_DECL_OVERRIDE; + bool event(QEvent *e) override; public slots: void flush() { xcb_flush(m_connection); } @@ -639,6 +640,14 @@ private: QXcbEventReader *m_reader; #if defined(XCB_USE_XINPUT2) QHash<int, XInput2TouchDeviceData*> m_touchDevices; +#ifdef XCB_USE_XINPUT22 + struct StartSystemResizeInfo { + xcb_window_t window; + uint16_t deviceid; + uint32_t pointid; + Qt::Corner corner; + } m_startSystemResizeInfo; +#endif #endif #ifdef Q_XCB_DEBUG struct CallInfo { diff --git a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp index 93f8db92bf..0ace79a4f5 100644 --- a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp +++ b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp @@ -61,9 +61,9 @@ struct XInput2TouchDeviceData { XIDeviceInfo *xiDeviceInfo; QTouchDevice *qtTouchDevice; QHash<int, QWindowSystemInterface::TouchPoint> touchPoints; + QHash<int, QPointF> pointPressedPosition; // in screen coordinates where each point was pressed // Stuff that is relevant only for touchpads - QHash<int, QPointF> pointPressedPosition; // in screen coordinates where each point was pressed QPointF firstPressedPosition; // in screen coordinates where the first point was pressed QPointF firstPressedNormalPosition; // device coordinates (0 to 1, 0 to 1) where the first point was pressed QSizeF size; // device size in mm @@ -93,6 +93,7 @@ void QXcbConnection::initializeXInput2() if (m_xi2Enabled) { #ifdef XCB_USE_XINPUT22 qCDebug(lcQpaXInputDevices, "XInput version %d.%d is available and Qt supports 2.2 or greater", xiMajor, m_xi2Minor); + m_startSystemResizeInfo.window = XCB_NONE; #else qCDebug(lcQpaXInputDevices, "XInput version %d.%d is available and Qt supports 2.0", xiMajor, m_xi2Minor); #endif @@ -714,7 +715,21 @@ void QXcbConnection::xi2ProcessTouch(void *xiDevEvent, QXcbWindow *platformWindo touchPoint.state = Qt::TouchPointMoved; } else if (touchPoint.area.center() != QPoint(x, y)) { touchPoint.state = Qt::TouchPointMoved; - dev->pointPressedPosition[touchPoint.id] = QPointF(x, y); + if (dev->qtTouchDevice->type() == QTouchDevice::TouchPad) + dev->pointPressedPosition[touchPoint.id] = QPointF(x, y); + } + + if (dev->qtTouchDevice->type() == QTouchDevice::TouchScreen && + xiDeviceEvent->event == m_startSystemResizeInfo.window && + xiDeviceEvent->sourceid == m_startSystemResizeInfo.deviceid && + xiDeviceEvent->detail == m_startSystemResizeInfo.pointid) { + QXcbWindow *window = platformWindowFromId(m_startSystemResizeInfo.window); + if (window) { + XIAllowTouchEvents(static_cast<Display *>(m_xlib_display), xiDeviceEvent->deviceid, + xiDeviceEvent->detail, xiDeviceEvent->event, XIRejectTouch); + window->doStartSystemResize(QPoint(x, y), m_startSystemResizeInfo.corner); + m_startSystemResizeInfo.window = XCB_NONE; + } } break; case XI_TouchEnd: @@ -745,6 +760,27 @@ void QXcbConnection::xi2ProcessTouch(void *xiDevEvent, QXcbWindow *platformWindo touchPoint.state = Qt::TouchPointStationary; } +bool QXcbConnection::startSystemResizeForTouchBegin(xcb_window_t window, const QPoint &point, Qt::Corner corner) +{ + QHash<int, XInput2TouchDeviceData*>::const_iterator devIt = m_touchDevices.constBegin(); + for (; devIt != m_touchDevices.constEnd(); ++devIt) { + XInput2TouchDeviceData *deviceData = devIt.value(); + if (deviceData->qtTouchDevice->type() == QTouchDevice::TouchScreen) { + QHash<int, QPointF>::const_iterator pointIt = deviceData->pointPressedPosition.constBegin(); + for (; pointIt != deviceData->pointPressedPosition.constEnd(); ++pointIt) { + if (pointIt.value().toPoint() == point) { + m_startSystemResizeInfo.window = window; + m_startSystemResizeInfo.deviceid = devIt.key(); + m_startSystemResizeInfo.pointid = pointIt.key(); + m_startSystemResizeInfo.corner = corner; + return true; + } + } + } + } + return false; +} + bool QXcbConnection::xi2SetMouseGrabEnabled(xcb_window_t w, bool grab) { if (grab && !canGrab()) diff --git a/src/plugins/platforms/xcb/qxcbcursor.h b/src/plugins/platforms/xcb/qxcbcursor.h index 3284a9e3e1..c15225f6d2 100644 --- a/src/plugins/platforms/xcb/qxcbcursor.h +++ b/src/plugins/platforms/xcb/qxcbcursor.h @@ -76,10 +76,10 @@ public: QXcbCursor(QXcbConnection *conn, QXcbScreen *screen); ~QXcbCursor(); #ifndef QT_NO_CURSOR - void changeCursor(QCursor *cursor, QWindow *widget) Q_DECL_OVERRIDE; + void changeCursor(QCursor *cursor, QWindow *widget) override; #endif - QPoint pos() const Q_DECL_OVERRIDE; - void setPos(const QPoint &pos) Q_DECL_OVERRIDE; + QPoint pos() const override; + void setPos(const QPoint &pos) override; static void queryPointer(QXcbConnection *c, QXcbVirtualDesktop **virtualDesktop, QPoint *pos, int *keybMask = 0); diff --git a/src/plugins/platforms/xcb/qxcbdrag.cpp b/src/plugins/platforms/xcb/qxcbdrag.cpp index 4915bb1b11..494cecb3d1 100644 --- a/src/plugins/platforms/xcb/qxcbdrag.cpp +++ b/src/plugins/platforms/xcb/qxcbdrag.cpp @@ -130,9 +130,9 @@ public: ~QXcbDropData(); protected: - bool hasFormat_sys(const QString &mimeType) const Q_DECL_OVERRIDE; - QStringList formats_sys() const Q_DECL_OVERRIDE; - QVariant retrieveData_sys(const QString &mimeType, QVariant::Type type) const Q_DECL_OVERRIDE; + bool hasFormat_sys(const QString &mimeType) const override; + QStringList formats_sys() const override; + QVariant retrieveData_sys(const QString &mimeType, QVariant::Type type) const override; QVariant xdndObtainData(const QByteArray &format, QVariant::Type requestedType) const; diff --git a/src/plugins/platforms/xcb/qxcbdrag.h b/src/plugins/platforms/xcb/qxcbdrag.h index cb6e95cc9a..2d152edf76 100644 --- a/src/plugins/platforms/xcb/qxcbdrag.h +++ b/src/plugins/platforms/xcb/qxcbdrag.h @@ -74,14 +74,14 @@ public: QXcbDrag(QXcbConnection *c); ~QXcbDrag(); - virtual QMimeData *platformDropData() Q_DECL_OVERRIDE; - bool eventFilter(QObject *o, QEvent *e) Q_DECL_OVERRIDE; + QMimeData *platformDropData() override; + bool eventFilter(QObject *o, QEvent *e) override; - void startDrag() Q_DECL_OVERRIDE; - void cancel() Q_DECL_OVERRIDE; - void move(const QPoint &globalPos) Q_DECL_OVERRIDE; - void drop(const QPoint &globalPos) Q_DECL_OVERRIDE; - void endDrag() Q_DECL_OVERRIDE; + void startDrag() override; + void cancel() override; + void move(const QPoint &globalPos) override; + void drop(const QPoint &globalPos) override; + void endDrag() override; void handleEnter(QPlatformWindow *window, const xcb_client_message_event_t *event, xcb_window_t proxy = 0); void handlePosition(QPlatformWindow *w, const xcb_client_message_event_t *event); @@ -93,13 +93,13 @@ public: void handleFinished(const xcb_client_message_event_t *event); bool dndEnable(QXcbWindow *win, bool on); - bool ownsDragObject() const Q_DECL_OVERRIDE; + bool ownsDragObject() const override; void updatePixmap(); xcb_timestamp_t targetTime() { return target_time; } protected: - void timerEvent(QTimerEvent* e) Q_DECL_OVERRIDE; + void timerEvent(QTimerEvent* e) override; private: friend class QXcbDropData; diff --git a/src/plugins/platforms/xcb/qxcbintegration.cpp b/src/plugins/platforms/xcb/qxcbintegration.cpp index f4da7ba033..af9ffab8ae 100644 --- a/src/plugins/platforms/xcb/qxcbintegration.cpp +++ b/src/plugins/platforms/xcb/qxcbintegration.cpp @@ -447,12 +447,8 @@ QByteArray QXcbIntegration::wmClass() const className[0] = className.at(0).toUpper(); } - if (!name.isEmpty() && !className.isEmpty()) { - m_wmClass = name.toLocal8Bit(); - m_wmClass.append('\0'); - m_wmClass.append(className.toLocal8Bit()); - m_wmClass.append('\0'); - } + if (!name.isEmpty() && !className.isEmpty()) + m_wmClass = name.toLocal8Bit() + '\0' + className.toLocal8Bit() + '\0'; } return m_wmClass; } diff --git a/src/plugins/platforms/xcb/qxcbintegration.h b/src/plugins/platforms/xcb/qxcbintegration.h index 34dd44d491..f8034f436f 100644 --- a/src/plugins/platforms/xcb/qxcbintegration.h +++ b/src/plugins/platforms/xcb/qxcbintegration.h @@ -60,57 +60,57 @@ public: QXcbIntegration(const QStringList ¶meters, int &argc, char **argv); ~QXcbIntegration(); - QPlatformWindow *createPlatformWindow(QWindow *window) const Q_DECL_OVERRIDE; + QPlatformWindow *createPlatformWindow(QWindow *window) const override; #ifndef QT_NO_OPENGL - QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const Q_DECL_OVERRIDE; + QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const override; #endif - QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const Q_DECL_OVERRIDE; + QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const override; - QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const Q_DECL_OVERRIDE; + QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const override; - bool hasCapability(Capability cap) const Q_DECL_OVERRIDE; - QAbstractEventDispatcher *createEventDispatcher() const Q_DECL_OVERRIDE; - void initialize() Q_DECL_OVERRIDE; + bool hasCapability(Capability cap) const override; + QAbstractEventDispatcher *createEventDispatcher() const override; + void initialize() override; void moveToScreen(QWindow *window, int screen); - QPlatformFontDatabase *fontDatabase() const Q_DECL_OVERRIDE; + QPlatformFontDatabase *fontDatabase() const override; - QPlatformNativeInterface *nativeInterface()const Q_DECL_OVERRIDE; + QPlatformNativeInterface *nativeInterface()const override; #ifndef QT_NO_CLIPBOARD - QPlatformClipboard *clipboard() const Q_DECL_OVERRIDE; + QPlatformClipboard *clipboard() const override; #endif #ifndef QT_NO_DRAGANDDROP - QPlatformDrag *drag() const Q_DECL_OVERRIDE; + QPlatformDrag *drag() const override; #endif - QPlatformInputContext *inputContext() const Q_DECL_OVERRIDE; + QPlatformInputContext *inputContext() const override; #ifndef QT_NO_ACCESSIBILITY - QPlatformAccessibility *accessibility() const Q_DECL_OVERRIDE; + QPlatformAccessibility *accessibility() const override; #endif - QPlatformServices *services() const Q_DECL_OVERRIDE; + QPlatformServices *services() const override; - Qt::KeyboardModifiers queryKeyboardModifiers() const Q_DECL_OVERRIDE; - QList<int> possibleKeys(const QKeyEvent *e) const Q_DECL_OVERRIDE; + Qt::KeyboardModifiers queryKeyboardModifiers() const override; + QList<int> possibleKeys(const QKeyEvent *e) const override; - QStringList themeNames() const Q_DECL_OVERRIDE; - QPlatformTheme *createPlatformTheme(const QString &name) const Q_DECL_OVERRIDE; - QVariant styleHint(StyleHint hint) const Q_DECL_OVERRIDE; + QStringList themeNames() const override; + QPlatformTheme *createPlatformTheme(const QString &name) const override; + QVariant styleHint(StyleHint hint) const override; QXcbConnection *defaultConnection() const { return m_connections.first(); } QByteArray wmClass() const; #if !defined(QT_NO_SESSIONMANAGER) && defined(XCB_USE_SM) - QPlatformSessionManager *createPlatformSessionManager(const QString &id, const QString &key) const Q_DECL_OVERRIDE; + QPlatformSessionManager *createPlatformSessionManager(const QString &id, const QString &key) const override; #endif - void sync() Q_DECL_OVERRIDE; + void sync() override; - void beep() const Q_DECL_OVERRIDE; + void beep() const override; static QXcbIntegration *instance() { return m_instance; } diff --git a/src/plugins/platforms/xcb/qxcbmain.cpp b/src/plugins/platforms/xcb/qxcbmain.cpp index ab55bb7691..f8cb9a9269 100644 --- a/src/plugins/platforms/xcb/qxcbmain.cpp +++ b/src/plugins/platforms/xcb/qxcbmain.cpp @@ -47,7 +47,7 @@ class QXcbIntegrationPlugin : public QPlatformIntegrationPlugin Q_OBJECT Q_PLUGIN_METADATA(IID QPlatformIntegrationFactoryInterface_iid FILE "xcb.json") public: - QPlatformIntegration *create(const QString&, const QStringList&, int &, char **) Q_DECL_OVERRIDE; + QPlatformIntegration *create(const QString&, const QStringList&, int &, char **) override; }; QPlatformIntegration* QXcbIntegrationPlugin::create(const QString& system, const QStringList& parameters, int &argc, char **argv) diff --git a/src/plugins/platforms/xcb/qxcbnativeinterface.h b/src/plugins/platforms/xcb/qxcbnativeinterface.h index acecbf4116..a830829311 100644 --- a/src/plugins/platforms/xcb/qxcbnativeinterface.h +++ b/src/plugins/platforms/xcb/qxcbnativeinterface.h @@ -78,22 +78,22 @@ public: QXcbNativeInterface(); - void *nativeResourceForIntegration(const QByteArray &resource) Q_DECL_OVERRIDE; - void *nativeResourceForContext(const QByteArray &resourceString, QOpenGLContext *context) Q_DECL_OVERRIDE; - void *nativeResourceForScreen(const QByteArray &resource, QScreen *screen) Q_DECL_OVERRIDE; - void *nativeResourceForWindow(const QByteArray &resourceString, QWindow *window) Q_DECL_OVERRIDE; - void *nativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) Q_DECL_OVERRIDE; + void *nativeResourceForIntegration(const QByteArray &resource) override; + void *nativeResourceForContext(const QByteArray &resourceString, QOpenGLContext *context) override; + void *nativeResourceForScreen(const QByteArray &resource, QScreen *screen) override; + void *nativeResourceForWindow(const QByteArray &resourceString, QWindow *window) override; + void *nativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) override; #ifndef QT_NO_CURSOR - void *nativeResourceForCursor(const QByteArray &resource, const QCursor &cursor) Q_DECL_OVERRIDE; + void *nativeResourceForCursor(const QByteArray &resource, const QCursor &cursor) override; #endif - NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource) Q_DECL_OVERRIDE; - NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) Q_DECL_OVERRIDE; - NativeResourceForScreenFunction nativeResourceFunctionForScreen(const QByteArray &resource) Q_DECL_OVERRIDE; - NativeResourceForWindowFunction nativeResourceFunctionForWindow(const QByteArray &resource) Q_DECL_OVERRIDE; - NativeResourceForBackingStoreFunction nativeResourceFunctionForBackingStore(const QByteArray &resource) Q_DECL_OVERRIDE; + NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource) override; + NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) override; + NativeResourceForScreenFunction nativeResourceFunctionForScreen(const QByteArray &resource) override; + NativeResourceForWindowFunction nativeResourceFunctionForWindow(const QByteArray &resource) override; + NativeResourceForBackingStoreFunction nativeResourceFunctionForBackingStore(const QByteArray &resource) override; - QFunctionPointer platformFunction(const QByteArray &function) const Q_DECL_OVERRIDE; + QFunctionPointer platformFunction(const QByteArray &function) const override; inline const QByteArray &genericEventFilterType() const { return m_genericEventFilterType; } diff --git a/src/plugins/platforms/xcb/qxcbscreen.h b/src/plugins/platforms/xcb/qxcbscreen.h index 0d32c3d624..627397fcaf 100644 --- a/src/plugins/platforms/xcb/qxcbscreen.h +++ b/src/plugins/platforms/xcb/qxcbscreen.h @@ -115,24 +115,24 @@ public: QString getOutputName(xcb_randr_get_output_info_reply_t *outputInfo); - QPixmap grabWindow(WId window, int x, int y, int width, int height) const Q_DECL_OVERRIDE; + QPixmap grabWindow(WId window, int x, int y, int width, int height) const override; - QWindow *topLevelAt(const QPoint &point) const Q_DECL_OVERRIDE; + QWindow *topLevelAt(const QPoint &point) const override; - QRect geometry() const Q_DECL_OVERRIDE { return m_geometry; } - QRect availableGeometry() const Q_DECL_OVERRIDE {return m_availableGeometry;} - int depth() const Q_DECL_OVERRIDE { return screen()->root_depth; } - QImage::Format format() const Q_DECL_OVERRIDE; - QSizeF physicalSize() const Q_DECL_OVERRIDE { return m_sizeMillimeters; } + QRect geometry() const override { return m_geometry; } + QRect availableGeometry() const override {return m_availableGeometry;} + int depth() const override { return screen()->root_depth; } + QImage::Format format() const override; + QSizeF physicalSize() const override { return m_sizeMillimeters; } QSize virtualSize() const { return m_virtualSize; } QSizeF physicalVirtualSize() const { return m_virtualSizeMillimeters; } QDpi virtualDpi() const; - QDpi logicalDpi() const Q_DECL_OVERRIDE; - qreal pixelDensity() const Q_DECL_OVERRIDE; - QPlatformCursor *cursor() const Q_DECL_OVERRIDE; - qreal refreshRate() const Q_DECL_OVERRIDE { return m_refreshRate; } - Qt::ScreenOrientation orientation() const Q_DECL_OVERRIDE { return m_orientation; } - QList<QPlatformScreen *> virtualSiblings() const Q_DECL_OVERRIDE { return m_virtualDesktop->screens(); } + QDpi logicalDpi() const override; + qreal pixelDensity() const override; + QPlatformCursor *cursor() const override; + qreal refreshRate() const override { return m_refreshRate; } + Qt::ScreenOrientation orientation() const override { return m_orientation; } + QList<QPlatformScreen *> virtualSiblings() const override { return m_virtualDesktop->screens(); } QXcbVirtualDesktop *virtualDesktop() const { return m_virtualDesktop; } void setPrimary(bool primary) { m_primary = primary; } @@ -161,7 +161,7 @@ public: const xcb_visualtype_t *visualForId(xcb_visualid_t) const; quint8 depthOfVisual(xcb_visualid_t) const; - QString name() const Q_DECL_OVERRIDE { return m_outputName; } + QString name() const override { return m_outputName; } void handleScreenChange(xcb_randr_screen_change_notify_event_t *change_event); void updateGeometry(const QRect &geom, uint8_t rotation); diff --git a/src/plugins/platforms/xcb/qxcbsessionmanager.h b/src/plugins/platforms/xcb/qxcbsessionmanager.h index a184282034..0ad9445361 100644 --- a/src/plugins/platforms/xcb/qxcbsessionmanager.h +++ b/src/plugins/platforms/xcb/qxcbsessionmanager.h @@ -69,17 +69,17 @@ public: void setSessionId(const QString &id) { m_sessionId = id; } void setSessionKey(const QString &key) { m_sessionKey = key; } - bool allowsInteraction() Q_DECL_OVERRIDE; - bool allowsErrorInteraction() Q_DECL_OVERRIDE; - void release() Q_DECL_OVERRIDE; + bool allowsInteraction() override; + bool allowsErrorInteraction() override; + void release() override; - void cancel() Q_DECL_OVERRIDE; + void cancel() override; - void setManagerProperty(const QString &name, const QString &value) Q_DECL_OVERRIDE; - void setManagerProperty(const QString &name, const QStringList &value) Q_DECL_OVERRIDE; + void setManagerProperty(const QString &name, const QString &value) override; + void setManagerProperty(const QString &name, const QStringList &value) override; - bool isPhase2() const Q_DECL_OVERRIDE; - void requestPhase2() Q_DECL_OVERRIDE; + bool isPhase2() const override; + void requestPhase2() override; void exitEventLoop(); diff --git a/src/plugins/platforms/xcb/qxcbsystemtraytracker.h b/src/plugins/platforms/xcb/qxcbsystemtraytracker.h index 5cca4782aa..a6131e6d0e 100644 --- a/src/plugins/platforms/xcb/qxcbsystemtraytracker.h +++ b/src/plugins/platforms/xcb/qxcbsystemtraytracker.h @@ -61,7 +61,7 @@ public: void notifyManagerClientMessageEvent(const xcb_client_message_event_t *); - void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) Q_DECL_OVERRIDE; + void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) override; bool visualHasAlphaChannel(); signals: diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp index 0c8e78491e..5fa8541f26 100644 --- a/src/plugins/platforms/xcb/qxcbwindow.cpp +++ b/src/plugins/platforms/xcb/qxcbwindow.cpp @@ -2738,13 +2738,23 @@ bool QXcbWindow::startSystemResize(const QPoint &pos, Qt::Corner corner) const xcb_atom_t moveResize = connection()->atom(QXcbAtom::_NET_WM_MOVERESIZE); if (!connection()->wmSupport()->isSupportedByWM(moveResize)) return false; + const QPoint globalPos = window()->mapToGlobal(pos); +#ifdef XCB_USE_XINPUT22 + if (connection()->startSystemResizeForTouchBegin(m_window, globalPos, corner)) + return true; +#endif + return doStartSystemResize(globalPos, corner); +} + +bool QXcbWindow::doStartSystemResize(const QPoint &globalPos, Qt::Corner corner) +{ + const xcb_atom_t moveResize = connection()->atom(QXcbAtom::_NET_WM_MOVERESIZE); xcb_client_message_event_t xev; xev.response_type = XCB_CLIENT_MESSAGE; xev.type = moveResize; xev.sequence = 0; xev.window = xcb_window(); xev.format = 32; - const QPoint globalPos = window()->mapToGlobal(pos); xev.data.data32[0] = globalPos.x(); xev.data.data32[1] = globalPos.y(); const bool bottom = corner == Qt::BottomRightCorner || corner == Qt::BottomLeftCorner; diff --git a/src/plugins/platforms/xcb/qxcbwindow.h b/src/plugins/platforms/xcb/qxcbwindow.h index 92f3f7a67c..089df8f3f6 100644 --- a/src/plugins/platforms/xcb/qxcbwindow.h +++ b/src/plugins/platforms/xcb/qxcbwindow.h @@ -76,75 +76,75 @@ public: QXcbWindow(QWindow *window); ~QXcbWindow(); - void setGeometry(const QRect &rect) Q_DECL_OVERRIDE; + void setGeometry(const QRect &rect) override; - QMargins frameMargins() const Q_DECL_OVERRIDE; + QMargins frameMargins() const override; - void setVisible(bool visible) Q_DECL_OVERRIDE; - void setWindowFlags(Qt::WindowFlags flags) Q_DECL_OVERRIDE; - void setWindowState(Qt::WindowState state) Q_DECL_OVERRIDE; - WId winId() const Q_DECL_OVERRIDE; - void setParent(const QPlatformWindow *window) Q_DECL_OVERRIDE; + void setVisible(bool visible) override; + void setWindowFlags(Qt::WindowFlags flags) override; + void setWindowState(Qt::WindowState state) override; + WId winId() const override; + void setParent(const QPlatformWindow *window) override; - bool isExposed() const Q_DECL_OVERRIDE; - bool isEmbedded(const QPlatformWindow *parentWindow = 0) const Q_DECL_OVERRIDE; - QPoint mapToGlobal(const QPoint &pos) const Q_DECL_OVERRIDE; - QPoint mapFromGlobal(const QPoint &pos) const Q_DECL_OVERRIDE; + bool isExposed() const override; + bool isEmbedded(const QPlatformWindow *parentWindow = 0) const override; + QPoint mapToGlobal(const QPoint &pos) const override; + QPoint mapFromGlobal(const QPoint &pos) const override; - void setWindowTitle(const QString &title) Q_DECL_OVERRIDE; + void setWindowTitle(const QString &title) override; void setWindowIconText(const QString &title); - void setWindowIcon(const QIcon &icon) Q_DECL_OVERRIDE; - void raise() Q_DECL_OVERRIDE; - void lower() Q_DECL_OVERRIDE; - void propagateSizeHints() Q_DECL_OVERRIDE; + void setWindowIcon(const QIcon &icon) override; + void raise() override; + void lower() override; + void propagateSizeHints() override; - void requestActivateWindow() Q_DECL_OVERRIDE; + void requestActivateWindow() override; - bool setKeyboardGrabEnabled(bool grab) Q_DECL_OVERRIDE; - bool setMouseGrabEnabled(bool grab) Q_DECL_OVERRIDE; + bool setKeyboardGrabEnabled(bool grab) override; + bool setMouseGrabEnabled(bool grab) override; void setCursor(xcb_cursor_t cursor, bool isBitmapCursor); - QSurfaceFormat format() const Q_DECL_OVERRIDE; + QSurfaceFormat format() const override; - void windowEvent(QEvent *event) Q_DECL_OVERRIDE; + void windowEvent(QEvent *event) override; - bool startSystemResize(const QPoint &pos, Qt::Corner corner) Q_DECL_OVERRIDE; + bool startSystemResize(const QPoint &pos, Qt::Corner corner) override; - void setOpacity(qreal level) Q_DECL_OVERRIDE; - void setMask(const QRegion ®ion) Q_DECL_OVERRIDE; + void setOpacity(qreal level) override; + void setMask(const QRegion ®ion) override; - void setAlertState(bool enabled) Q_DECL_OVERRIDE; - bool isAlertState() const Q_DECL_OVERRIDE { return m_alertState; } + void setAlertState(bool enabled) override; + bool isAlertState() const override { return m_alertState; } xcb_window_t xcb_window() const { return m_window; } uint depth() const { return m_depth; } QImage::Format imageFormat() const { return m_imageFormat; } bool imageNeedsRgbSwap() const { return m_imageRgbSwap; } - bool handleGenericEvent(xcb_generic_event_t *event, long *result) Q_DECL_OVERRIDE; - - void handleExposeEvent(const xcb_expose_event_t *event) Q_DECL_OVERRIDE; - void handleClientMessageEvent(const xcb_client_message_event_t *event) Q_DECL_OVERRIDE; - void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *event) Q_DECL_OVERRIDE; - void handleMapNotifyEvent(const xcb_map_notify_event_t *event) Q_DECL_OVERRIDE; - void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *event) Q_DECL_OVERRIDE; - void handleButtonPressEvent(const xcb_button_press_event_t *event) Q_DECL_OVERRIDE; - void handleButtonReleaseEvent(const xcb_button_release_event_t *event) Q_DECL_OVERRIDE; - void handleMotionNotifyEvent(const xcb_motion_notify_event_t *event) Q_DECL_OVERRIDE; - - void handleEnterNotifyEvent(const xcb_enter_notify_event_t *event) Q_DECL_OVERRIDE; - void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *event) Q_DECL_OVERRIDE; - void handleFocusInEvent(const xcb_focus_in_event_t *event) Q_DECL_OVERRIDE; - void handleFocusOutEvent(const xcb_focus_out_event_t *event) Q_DECL_OVERRIDE; - void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) Q_DECL_OVERRIDE; + bool handleGenericEvent(xcb_generic_event_t *event, long *result) override; + + void handleExposeEvent(const xcb_expose_event_t *event) override; + void handleClientMessageEvent(const xcb_client_message_event_t *event) override; + void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *event) override; + void handleMapNotifyEvent(const xcb_map_notify_event_t *event) override; + void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *event) override; + void handleButtonPressEvent(const xcb_button_press_event_t *event) override; + void handleButtonReleaseEvent(const xcb_button_release_event_t *event) override; + void handleMotionNotifyEvent(const xcb_motion_notify_event_t *event) override; + + void handleEnterNotifyEvent(const xcb_enter_notify_event_t *event) override; + void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *event) override; + void handleFocusInEvent(const xcb_focus_in_event_t *event) override; + void handleFocusOutEvent(const xcb_focus_out_event_t *event) override; + void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; #ifdef XCB_USE_XINPUT22 void handleXIMouseButtonState(const xcb_ge_event_t *); - void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized) Q_DECL_OVERRIDE; - void handleXIEnterLeave(xcb_ge_event_t *) Q_DECL_OVERRIDE; + void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized) override; + void handleXIEnterLeave(xcb_ge_event_t *) override; #endif - QXcbWindow *toWindow() Q_DECL_OVERRIDE; + QXcbWindow *toWindow() override; void handleMouseEvent(xcb_timestamp_t time, const QPoint &local, const QPoint &global, Qt::KeyboardModifiers modifiers, Qt::MouseEventSource source); @@ -178,6 +178,8 @@ public: QXcbScreen *xcbScreen() const; + bool doStartSystemResize(const QPoint &globalPos, Qt::Corner corner); + virtual void create(); virtual void destroy(); diff --git a/src/plugins/platforms/xcb/qxcbxsettings.h b/src/plugins/platforms/xcb/qxcbxsettings.h index ff1932734a..ab1f784274 100644 --- a/src/plugins/platforms/xcb/qxcbxsettings.h +++ b/src/plugins/platforms/xcb/qxcbxsettings.h @@ -61,7 +61,7 @@ public: void removeCallbackForHandle(const QByteArray &property, void *handle); void removeCallbackForHandle(void *handle); - void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) Q_DECL_OVERRIDE; + void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; private: QXcbXSettingsPrivate *d_ptr; }; |