40 Q_PROPERTY(QIcon windowIcon READ windowIcon WRITE setWindowIcon)
41 Q_PROPERTY(QString applicationDisplayName READ applicationDisplayName
42 WRITE setApplicationDisplayName NOTIFY applicationDisplayNameChanged)
43 Q_PROPERTY(QString desktopFileName READ desktopFileName WRITE setDesktopFileName)
44 Q_PROPERTY(Qt::LayoutDirection layoutDirection READ layoutDirection WRITE setLayoutDirection
45 NOTIFY layoutDirectionChanged)
46 Q_PROPERTY(QString platformName READ platformName STORED
false CONSTANT)
47 Q_PROPERTY(
bool quitOnLastWindowClosed READ quitOnLastWindowClosed
48 WRITE setQuitOnLastWindowClosed)
49 Q_PROPERTY(QScreen *primaryScreen READ primaryScreen NOTIFY primaryScreenChanged STORED
false)
50 Q_PROPERTY(qint64 badgeNumber READ badgeNumber WRITE setBadgeNumber
51 NOTIFY badgeNumberChanged REVISION(6, 13))
55 QGuiApplication(
int &argc,
char **argv);
57 QGuiApplication(
int &argc,
char **argv,
int = ApplicationFlags);
61 static void setApplicationDisplayName(
const QString &name);
62 static QString applicationDisplayName();
64 qint64 badgeNumber()
const;
65 Q_SLOT
void setBadgeNumber(qint64 number);
67 static void setDesktopFileName(
const QString &name);
68 static QString desktopFileName();
70 static QWindowList allWindows();
71 static QWindowList topLevelWindows();
72 static QWindow *topLevelAt(
const QPoint &pos);
74 static void setWindowIcon(
const QIcon &icon);
75 static QIcon windowIcon();
77 static QString platformName();
79 static QWindow *modalWindow();
81 static QWindow *focusWindow();
82 static QObject *focusObject();
84 static QScreen *primaryScreen();
85 static QList<QScreen *> screens();
86 static QScreen *screenAt(
const QPoint &point);
88 qreal devicePixelRatio()
const;
91 static QCursor *overrideCursor();
92 static void setOverrideCursor(
const QCursor &);
93 static void changeOverrideCursor(
const QCursor &);
94 static void restoreOverrideCursor();
98 static void setFont(
const QFont &);
100#ifndef QT_NO_CLIPBOARD
101 static QClipboard *clipboard();
104 static QPalette palette();
105 static void setPalette(
const QPalette &pal);
107 static Qt::KeyboardModifiers keyboardModifiers();
108 static Qt::KeyboardModifiers queryKeyboardModifiers();
109 static Qt::MouseButtons mouseButtons();
111 static void setLayoutDirection(Qt::LayoutDirection direction);
112 static Qt::LayoutDirection layoutDirection();
114 static inline bool isRightToLeft() {
return layoutDirection() == Qt::RightToLeft; }
115 static inline bool isLeftToRight() {
return layoutDirection() == Qt::LeftToRight; }
117 static QStyleHints *styleHints();
118 static void setDesktopSettingsAware(
bool on);
119 static bool desktopSettingsAware();
121 static QInputMethod *inputMethod();
123 static QPlatformNativeInterface *platformNativeInterface();
125 static QFunctionPointer platformFunction(
const QByteArray &function);
127 static void setQuitOnLastWindowClosed(
bool quit);
128 static bool quitOnLastWindowClosed();
130 static Qt::ApplicationState applicationState();
132 static void setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy policy);
133 static Qt::HighDpiScaleFactorRoundingPolicy highDpiScaleFactorRoundingPolicy();
136 bool notify(QObject *, QEvent *) override;
138#ifndef QT_NO_SESSIONMANAGER
140 bool isSessionRestored()
const;
141 QString sessionId()
const;
142 QString sessionKey()
const;
143 bool isSavingSession()
const;
146 QT_DECLARE_NATIVE_INTERFACE_ACCESSOR(QGuiApplication)
150 void fontDatabaseChanged();
151 void screenAdded(QScreen *screen);
152 void screenRemoved(QScreen *screen);
153 void primaryScreenChanged(QScreen *screen);
154 void lastWindowClosed();
155 void focusObjectChanged(QObject *focusObject);
156 void focusWindowChanged(QWindow *focusWindow);
157 void applicationStateChanged(Qt::ApplicationState state);
158 void layoutDirectionChanged(Qt::LayoutDirection direction);
159#ifndef QT_NO_SESSIONMANAGER
160 void commitDataRequest(QSessionManager &sessionManager);
161 void saveStateRequest(QSessionManager &sessionManager);
163 void applicationDisplayNameChanged();
164 void badgeNumberChanged(qint64 number);
165#if QT_DEPRECATED_SINCE(6
, 0
)
166 QT_DEPRECATED_VERSION_X_6_0(
"Handle QEvent::ApplicationPaletteChange instead")
void paletteChanged(
const QPalette &pal);
167 QT_DEPRECATED_VERSION_X_6_0(
"Handle QEvent::ApplicationFontChange instead")
void fontChanged(
const QFont &font);
170 bool event(QEvent *) override;
171# if QT_VERSION < QT_VERSION_CHECK(7
, 0
, 0
)
172 QT_DEPRECATED_VERSION_X_6_10(
"This feature will be removed in Qt 7")
173 bool compressEvent(QEvent *, QObject *receiver, QPostEventList *) override;
176 QGuiApplication(QGuiApplicationPrivate &p);
179 Q_DISABLE_COPY(QGuiApplication)
180 Q_DECLARE_PRIVATE(QGuiApplication)
182 Q_PRIVATE_SLOT(d_func(),
void _q_updateFocusObject(QObject *object))
183 Q_PRIVATE_SLOT(d_func(),
void _q_updatePrimaryScreenDpis())
185#ifndef QT_NO_GESTURES
186 friend class QGestureManager;
188 friend class QFontDatabasePrivate;
189 friend class QPlatformIntegration;
190#ifndef QT_NO_SESSIONMANAGER
191 friend class QPlatformSessionManager;