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)
53 QGuiApplication(
int &argc,
char **argv);
55 QGuiApplication(
int &argc,
char **argv,
int = ApplicationFlags);
59 static void setApplicationDisplayName(
const QString &name);
60 static QString applicationDisplayName();
62 Q_SLOT
void setBadgeNumber(qint64 number);
64 static void setDesktopFileName(
const QString &name);
65 static QString desktopFileName();
67 static QWindowList allWindows();
68 static QWindowList topLevelWindows();
69 static QWindow *topLevelAt(
const QPoint &pos);
71 static void setWindowIcon(
const QIcon &icon);
72 static QIcon windowIcon();
74 static QString platformName();
76 static QWindow *modalWindow();
78 static QWindow *focusWindow();
79 static QObject *focusObject();
81 static QScreen *primaryScreen();
82 static QList<QScreen *> screens();
83 static QScreen *screenAt(
const QPoint &point);
85 qreal devicePixelRatio()
const;
88 static QCursor *overrideCursor();
89 static void setOverrideCursor(
const QCursor &);
90 static void changeOverrideCursor(
const QCursor &);
91 static void restoreOverrideCursor();
95 static void setFont(
const QFont &);
97#ifndef QT_NO_CLIPBOARD
98 static QClipboard *clipboard();
101 static QPalette palette();
102 static void setPalette(
const QPalette &pal);
104 static Qt::KeyboardModifiers keyboardModifiers();
105 static Qt::KeyboardModifiers queryKeyboardModifiers();
106 static Qt::MouseButtons mouseButtons();
108 static void setLayoutDirection(Qt::LayoutDirection direction);
109 static Qt::LayoutDirection layoutDirection();
111 static inline bool isRightToLeft() {
return layoutDirection() == Qt::RightToLeft; }
112 static inline bool isLeftToRight() {
return layoutDirection() == Qt::LeftToRight; }
114 static QStyleHints *styleHints();
115 static void setDesktopSettingsAware(
bool on);
116 static bool desktopSettingsAware();
118 static QInputMethod *inputMethod();
120 static QPlatformNativeInterface *platformNativeInterface();
122 static QFunctionPointer platformFunction(
const QByteArray &function);
124 static void setQuitOnLastWindowClosed(
bool quit);
125 static bool quitOnLastWindowClosed();
127 static Qt::ApplicationState applicationState();
129 static void setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy policy);
130 static Qt::HighDpiScaleFactorRoundingPolicy highDpiScaleFactorRoundingPolicy();
133 bool notify(QObject *, QEvent *) override;
135#ifndef QT_NO_SESSIONMANAGER
137 bool isSessionRestored()
const;
138 QString sessionId()
const;
139 QString sessionKey()
const;
140 bool isSavingSession()
const;
143 QT_DECLARE_NATIVE_INTERFACE_ACCESSOR(QGuiApplication)
147 void fontDatabaseChanged();
148 void screenAdded(QScreen *screen);
149 void screenRemoved(QScreen *screen);
150 void primaryScreenChanged(QScreen *screen);
151 void lastWindowClosed();
152 void focusObjectChanged(QObject *focusObject);
153 void focusWindowChanged(QWindow *focusWindow);
154 void applicationStateChanged(Qt::ApplicationState state);
155 void layoutDirectionChanged(Qt::LayoutDirection direction);
156#ifndef QT_NO_SESSIONMANAGER
157 void commitDataRequest(QSessionManager &sessionManager);
158 void saveStateRequest(QSessionManager &sessionManager);
160 void applicationDisplayNameChanged();
161#if QT_DEPRECATED_SINCE(6
, 0
)
162 QT_DEPRECATED_VERSION_X_6_0(
"Handle QEvent::ApplicationPaletteChange instead")
void paletteChanged(
const QPalette &pal);
163 QT_DEPRECATED_VERSION_X_6_0(
"Handle QEvent::ApplicationFontChange instead")
void fontChanged(
const QFont &font);
166 bool event(QEvent *) override;
167# if QT_VERSION < QT_VERSION_CHECK(7
, 0
, 0
)
168 QT_DEPRECATED_VERSION_X_6_10(
"This feature will be removed in Qt 7")
169 bool compressEvent(QEvent *, QObject *receiver, QPostEventList *) override;
172 QGuiApplication(QGuiApplicationPrivate &p);
175 Q_DISABLE_COPY(QGuiApplication)
176 Q_DECLARE_PRIVATE(QGuiApplication)
178 Q_PRIVATE_SLOT(d_func(),
void _q_updateFocusObject(QObject *object))
179 Q_PRIVATE_SLOT(d_func(),
void _q_updatePrimaryScreenDpis())
181#ifndef QT_NO_GESTURES
182 friend class QGestureManager;
184 friend class QFontDatabasePrivate;
185 friend class QPlatformIntegration;
186#ifndef QT_NO_SESSIONMANAGER
187 friend class QPlatformSessionManager;