Warning, file /include/QtGui/qguiapplication.h was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004 #ifndef QGUIAPPLICATION_H
0005 #define QGUIAPPLICATION_H
0006
0007 #include <QtGui/qtguiglobal.h>
0008 #include <QtCore/qcoreapplication.h>
0009 #include <QtGui/qwindowdefs.h>
0010 #include <QtGui/qinputmethod.h>
0011 #include <QtCore/qlocale.h>
0012 #include <QtCore/qpoint.h>
0013 #include <QtCore/qsize.h>
0014
0015 QT_BEGIN_NAMESPACE
0016
0017
0018 class QSessionManager;
0019 class QGuiApplicationPrivate;
0020 class QPlatformNativeInterface;
0021 class QPlatformIntegration;
0022 class QPalette;
0023 class QScreen;
0024 class QStyleHints;
0025
0026 #if defined(qApp)
0027 #undef qApp
0028 #endif
0029 #define qApp (static_cast<QGuiApplication *>(QCoreApplication::instance()))
0030
0031 #if defined(qGuiApp)
0032 #undef qGuiApp
0033 #endif
0034 #define qGuiApp (static_cast<QGuiApplication *>(QCoreApplication::instance()))
0035
0036 class Q_GUI_EXPORT QGuiApplication : public QCoreApplication
0037 {
0038 Q_OBJECT
0039 Q_PROPERTY(QIcon windowIcon READ windowIcon WRITE setWindowIcon)
0040 Q_PROPERTY(QString applicationDisplayName READ applicationDisplayName
0041 WRITE setApplicationDisplayName NOTIFY applicationDisplayNameChanged)
0042 Q_PROPERTY(QString desktopFileName READ desktopFileName WRITE setDesktopFileName)
0043 Q_PROPERTY(Qt::LayoutDirection layoutDirection READ layoutDirection WRITE setLayoutDirection
0044 NOTIFY layoutDirectionChanged)
0045 Q_PROPERTY(QString platformName READ platformName STORED false CONSTANT)
0046 Q_PROPERTY(bool quitOnLastWindowClosed READ quitOnLastWindowClosed
0047 WRITE setQuitOnLastWindowClosed)
0048 Q_PROPERTY(QScreen *primaryScreen READ primaryScreen NOTIFY primaryScreenChanged STORED false)
0049
0050 public:
0051 #ifdef Q_QDOC
0052 QGuiApplication(int &argc, char **argv);
0053 #else
0054 QGuiApplication(int &argc, char **argv, int = ApplicationFlags);
0055 #endif
0056 ~QGuiApplication();
0057
0058 static void setApplicationDisplayName(const QString &name);
0059 static QString applicationDisplayName();
0060
0061 Q_SLOT void setBadgeNumber(qint64 number);
0062
0063 static void setDesktopFileName(const QString &name);
0064 static QString desktopFileName();
0065
0066 static QWindowList allWindows();
0067 static QWindowList topLevelWindows();
0068 static QWindow *topLevelAt(const QPoint &pos);
0069
0070 static void setWindowIcon(const QIcon &icon);
0071 static QIcon windowIcon();
0072
0073 static QString platformName();
0074
0075 static QWindow *modalWindow();
0076
0077 static QWindow *focusWindow();
0078 static QObject *focusObject();
0079
0080 static QScreen *primaryScreen();
0081 static QList<QScreen *> screens();
0082 static QScreen *screenAt(const QPoint &point);
0083
0084 qreal devicePixelRatio() const;
0085
0086 #ifndef QT_NO_CURSOR
0087 static QCursor *overrideCursor();
0088 static void setOverrideCursor(const QCursor &);
0089 static void changeOverrideCursor(const QCursor &);
0090 static void restoreOverrideCursor();
0091 #endif
0092
0093 static QFont font();
0094 static void setFont(const QFont &);
0095
0096 #ifndef QT_NO_CLIPBOARD
0097 static QClipboard *clipboard();
0098 #endif
0099
0100 static QPalette palette();
0101 static void setPalette(const QPalette &pal);
0102
0103 static Qt::KeyboardModifiers keyboardModifiers();
0104 static Qt::KeyboardModifiers queryKeyboardModifiers();
0105 static Qt::MouseButtons mouseButtons();
0106
0107 static void setLayoutDirection(Qt::LayoutDirection direction);
0108 static Qt::LayoutDirection layoutDirection();
0109
0110 static inline bool isRightToLeft() { return layoutDirection() == Qt::RightToLeft; }
0111 static inline bool isLeftToRight() { return layoutDirection() == Qt::LeftToRight; }
0112
0113 static QStyleHints *styleHints();
0114 static void setDesktopSettingsAware(bool on);
0115 static bool desktopSettingsAware();
0116
0117 static QInputMethod *inputMethod();
0118
0119 static QPlatformNativeInterface *platformNativeInterface();
0120
0121 static QFunctionPointer platformFunction(const QByteArray &function);
0122
0123 static void setQuitOnLastWindowClosed(bool quit);
0124 static bool quitOnLastWindowClosed();
0125
0126 static Qt::ApplicationState applicationState();
0127
0128 static void setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy policy);
0129 static Qt::HighDpiScaleFactorRoundingPolicy highDpiScaleFactorRoundingPolicy();
0130
0131 static int exec();
0132 bool notify(QObject *, QEvent *) override;
0133
0134 #ifndef QT_NO_SESSIONMANAGER
0135
0136 bool isSessionRestored() const;
0137 QString sessionId() const;
0138 QString sessionKey() const;
0139 bool isSavingSession() const;
0140 #endif
0141
0142 QT_DECLARE_NATIVE_INTERFACE_ACCESSOR(QGuiApplication)
0143
0144 static void sync();
0145 Q_SIGNALS:
0146 void fontDatabaseChanged();
0147 void screenAdded(QScreen *screen);
0148 void screenRemoved(QScreen *screen);
0149 void primaryScreenChanged(QScreen *screen);
0150 void lastWindowClosed();
0151 void focusObjectChanged(QObject *focusObject);
0152 void focusWindowChanged(QWindow *focusWindow);
0153 void applicationStateChanged(Qt::ApplicationState state);
0154 void layoutDirectionChanged(Qt::LayoutDirection direction);
0155 #ifndef QT_NO_SESSIONMANAGER
0156 void commitDataRequest(QSessionManager &sessionManager);
0157 void saveStateRequest(QSessionManager &sessionManager);
0158 #endif
0159 void applicationDisplayNameChanged();
0160 #if QT_DEPRECATED_SINCE(6, 0)
0161 QT_DEPRECATED_VERSION_X_6_0("Handle QEvent::ApplicationPaletteChange instead") void paletteChanged(const QPalette &pal);
0162 QT_DEPRECATED_VERSION_X_6_0("Handle QEvent::ApplicationFontChange instead") void fontChanged(const QFont &font);
0163 #endif
0164 protected:
0165 bool event(QEvent *) override;
0166 bool compressEvent(QEvent *, QObject *receiver, QPostEventList *) override;
0167
0168 QGuiApplication(QGuiApplicationPrivate &p);
0169
0170 private:
0171 Q_DISABLE_COPY(QGuiApplication)
0172 Q_DECLARE_PRIVATE(QGuiApplication)
0173
0174 Q_PRIVATE_SLOT(d_func(), void _q_updateFocusObject(QObject *object))
0175
0176 #ifndef QT_NO_GESTURES
0177 friend class QGestureManager;
0178 #endif
0179 friend class QFontDatabasePrivate;
0180 friend class QPlatformIntegration;
0181 #ifndef QT_NO_SESSIONMANAGER
0182 friend class QPlatformSessionManager;
0183 #endif
0184 };
0185
0186 QT_END_NAMESPACE
0187
0188 #include <QtGui/qguiapplication_platform.h>
0189
0190 #endif