39 Q_PROPERTY(QIcon windowIcon READ windowIcon WRITE setWindowIcon)
40 Q_PROPERTY(QString applicationDisplayName READ applicationDisplayName
41 WRITE setApplicationDisplayName NOTIFY applicationDisplayNameChanged)
42 Q_PROPERTY(QString desktopFileName READ desktopFileName WRITE setDesktopFileName)
43 Q_PROPERTY(Qt::LayoutDirection layoutDirection READ layoutDirection WRITE setLayoutDirection
44 NOTIFY layoutDirectionChanged)
45 Q_PROPERTY(QString platformName READ platformName STORED
false CONSTANT)
46 Q_PROPERTY(
bool quitOnLastWindowClosed READ quitOnLastWindowClosed
47 WRITE setQuitOnLastWindowClosed)
48 Q_PROPERTY(QScreen *primaryScreen READ primaryScreen NOTIFY primaryScreenChanged STORED
false)
52 QGuiApplication(
int &argc,
char **argv);
54 QGuiApplication(
int &argc,
char **argv,
int = ApplicationFlags);
58 static void setApplicationDisplayName(
const QString &name);
59 static QString applicationDisplayName();
61 Q_SLOT
void setBadgeNumber(qint64 number);
63 static void setDesktopFileName(
const QString &name);
64 static QString desktopFileName();
66 static QWindowList allWindows();
67 static QWindowList topLevelWindows();
68 static QWindow *topLevelAt(
const QPoint &pos);
70 static void setWindowIcon(
const QIcon &icon);
71 static QIcon windowIcon();
73 static QString platformName();
75 static QWindow *modalWindow();
77 static QWindow *focusWindow();
78 static QObject *focusObject();
80 static QScreen *primaryScreen();
81 static QList<QScreen *> screens();
82 static QScreen *screenAt(
const QPoint &point);
84 qreal devicePixelRatio()
const;
87 static QCursor *overrideCursor();
88 static void setOverrideCursor(
const QCursor &);
89 static void changeOverrideCursor(
const QCursor &);
90 static void restoreOverrideCursor();
94 static void setFont(
const QFont &);
96#ifndef QT_NO_CLIPBOARD
97 static QClipboard *clipboard();
100 static QPalette palette();
101 static void setPalette(
const QPalette &pal);
103 static Qt::KeyboardModifiers keyboardModifiers();
104 static Qt::KeyboardModifiers queryKeyboardModifiers();
105 static Qt::MouseButtons mouseButtons();
107 static void setLayoutDirection(Qt::LayoutDirection direction);
108 static Qt::LayoutDirection layoutDirection();
110 static inline bool isRightToLeft() {
return layoutDirection() == Qt::RightToLeft; }
111 static inline bool isLeftToRight() {
return layoutDirection() == Qt::LeftToRight; }
113 static QStyleHints *styleHints();
114 static void setDesktopSettingsAware(
bool on);
115 static bool desktopSettingsAware();
117 static QInputMethod *inputMethod();
119 static QPlatformNativeInterface *platformNativeInterface();
121 static QFunctionPointer platformFunction(
const QByteArray &function);
123 static void setQuitOnLastWindowClosed(
bool quit);
124 static bool quitOnLastWindowClosed();
126 static Qt::ApplicationState applicationState();
128 static void setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy policy);
129 static Qt::HighDpiScaleFactorRoundingPolicy highDpiScaleFactorRoundingPolicy();
132 bool notify(QObject *, QEvent *) override;
134#ifndef QT_NO_SESSIONMANAGER
136 bool isSessionRestored()
const;
137 QString sessionId()
const;
138 QString sessionKey()
const;
139 bool isSavingSession()
const;
142 QT_DECLARE_NATIVE_INTERFACE_ACCESSOR(QGuiApplication)
146 void fontDatabaseChanged();
147 void screenAdded(QScreen *screen);
148 void screenRemoved(QScreen *screen);
149 void primaryScreenChanged(QScreen *screen);
150 void lastWindowClosed();
151 void focusObjectChanged(QObject *focusObject);
152 void focusWindowChanged(QWindow *focusWindow);
153 void applicationStateChanged(Qt::ApplicationState state);
154 void layoutDirectionChanged(Qt::LayoutDirection direction);
155#ifndef QT_NO_SESSIONMANAGER
156 void commitDataRequest(QSessionManager &sessionManager);
157 void saveStateRequest(QSessionManager &sessionManager);
159 void applicationDisplayNameChanged();
160#if QT_DEPRECATED_SINCE(6
, 0
)
161 QT_DEPRECATED_VERSION_X_6_0(
"Handle QEvent::ApplicationPaletteChange instead")
void paletteChanged(
const QPalette &pal);
162 QT_DEPRECATED_VERSION_X_6_0(
"Handle QEvent::ApplicationFontChange instead")
void fontChanged(
const QFont &font);
165 bool event(QEvent *) override;
166# if QT_VERSION < QT_VERSION_CHECK(7
, 0
, 0
)
167 bool compressEvent(QEvent *, QObject *receiver, QPostEventList *) override;
170 QGuiApplication(QGuiApplicationPrivate &p);
173 Q_DISABLE_COPY(QGuiApplication)
174 Q_DECLARE_PRIVATE(QGuiApplication)
176 Q_PRIVATE_SLOT(d_func(),
void _q_updateFocusObject(QObject *object))
178#ifndef QT_NO_GESTURES
179 friend class QGestureManager;
181 friend class QFontDatabasePrivate;
182 friend class QPlatformIntegration;
183#ifndef QT_NO_SESSIONMANAGER
184 friend class QPlatformSessionManager;