diff options
Diffstat (limited to 'src/gui/kernel/qguiapplication_p.h')
-rw-r--r-- | src/gui/kernel/qguiapplication_p.h | 50 |
1 files changed, 41 insertions, 9 deletions
diff --git a/src/gui/kernel/qguiapplication_p.h b/src/gui/kernel/qguiapplication_p.h index cc8b6a206c..cca79534fc 100644 --- a/src/gui/kernel/qguiapplication_p.h +++ b/src/gui/kernel/qguiapplication_p.h @@ -34,6 +34,8 @@ # include "private/qshortcutmap_p.h" #endif +#include <QtCore/qpointer.h> + #include <memory> QT_BEGIN_NAMESPACE @@ -57,7 +59,7 @@ class Q_GUI_EXPORT QGuiApplicationPrivate : public QCoreApplicationPrivate { Q_DECLARE_PUBLIC(QGuiApplication) public: - QGuiApplicationPrivate(int &argc, char **argv, int flags); + QGuiApplicationPrivate(int &argc, char **argv); ~QGuiApplicationPrivate(); void init(); @@ -113,9 +115,11 @@ public: static void processEnterEvent(QWindowSystemInterfacePrivate::EnterEvent *e); static void processLeaveEvent(QWindowSystemInterfacePrivate::LeaveEvent *e); - static void processActivatedEvent(QWindowSystemInterfacePrivate::ActivatedWindowEvent *e); + static void processFocusWindowEvent(QWindowSystemInterfacePrivate::FocusWindowEvent *e); + static void processWindowStateChangedEvent(QWindowSystemInterfacePrivate::WindowStateChangedEvent *e); static void processWindowScreenChangedEvent(QWindowSystemInterfacePrivate::WindowScreenChangedEvent *e); + static void processWindowDevicePixelRatioChangedEvent(QWindowSystemInterfacePrivate::WindowDevicePixelRatioChangedEvent *e); static void processSafeAreaMarginsChangedEvent(QWindowSystemInterfacePrivate::SafeAreaMarginsChangedEvent *e); @@ -188,7 +192,10 @@ public: static void showModalWindow(QWindow *window); static void hideModalWindow(QWindow *window); static void updateBlockedStatus(QWindow *window); - virtual bool isWindowBlocked(QWindow *window, QWindow **blockingWindow = nullptr) const; + + virtual Qt::WindowModality defaultModality() const; + virtual bool windowNeverBlocked(QWindow *window) const; + bool isWindowBlocked(QWindow *window, QWindow **blockingWindow = nullptr) const; virtual bool popupActive() { return false; } virtual bool closeAllPopups() { return false; } @@ -203,6 +210,28 @@ public: constexpr void reset() noexcept { *this = QLastCursorPosition{}; } + // QGuiApplicationPrivate::lastCursorPosition is used for mouse-move detection + // but even QPointF's qFuzzCompare on doubles is too precise, and causes move-noise + // e.g. on macOS (see QTBUG-111170). So we specialize the equality operators here + // to use single-point precision. + friend constexpr bool operator==(const QLastCursorPosition &p1, const QPointF &p2) noexcept + { + return qFuzzyCompare(float(p1.x()), float(p2.x())) + && qFuzzyCompare(float(p1.y()), float(p2.y())); + } + friend constexpr bool operator!=(const QLastCursorPosition &p1, const QPointF &p2) noexcept + { + return !(p1 == p2); + } + friend constexpr bool operator==(const QPointF &p1, const QLastCursorPosition &p2) noexcept + { + return p2 == p1; + } + friend constexpr bool operator!=(const QPointF &p1, const QLastCursorPosition &p2) noexcept + { + return !(p2 == p1); + } + private: QPointF thePoint; } lastCursorPosition; @@ -328,11 +357,12 @@ private: // ----------------- QNativeInterface ----------------- +class QWindowsMimeConverter; + namespace QNativeInterface::Private { -#if defined(Q_OS_WIN) || defined(Q_CLANG_QDOC) +#if defined(Q_OS_WIN) || defined(Q_QDOC) -class QWindowsMime; struct Q_GUI_EXPORT QWindowsApplication { @@ -364,18 +394,18 @@ struct Q_GUI_EXPORT QWindowsApplication virtual WindowActivationBehavior windowActivationBehavior() const = 0; virtual void setWindowActivationBehavior(WindowActivationBehavior behavior) = 0; + virtual void setHasBorderInFullScreenDefault(bool border) = 0; + virtual bool isTabletMode() const = 0; virtual bool isWinTabEnabled() const = 0; virtual bool setWinTabEnabled(bool enabled) = 0; - virtual bool isDarkMode() const = 0; - virtual DarkModeHandling darkModeHandling() const = 0; virtual void setDarkModeHandling(DarkModeHandling handling) = 0; - virtual void registerMime(QWindowsMime *mime) = 0; - virtual void unregisterMime(QWindowsMime *mime) = 0; + virtual void registerMime(QWindowsMimeConverter *mime) = 0; + virtual void unregisterMime(QWindowsMimeConverter *mime) = 0; virtual int registerMimeType(const QString &mime) = 0; @@ -388,6 +418,8 @@ struct Q_GUI_EXPORT QWindowsApplication virtual QVariant gpu() const = 0; // internal, used by qtdiag virtual QVariant gpuList() const = 0; + + virtual void populateLightSystemPalette(QPalette &pal) const = 0; }; #endif // Q_OS_WIN |