42 #ifndef QAPPLICATION_H 43 #define QAPPLICATION_H 45 #include <QtCore/qcoreapplication.h> 46 #include <QtGui/qwindowdefs.h> 47 #include <QtCore/qpoint.h> 48 #include <QtCore/qsize.h> 49 #include <QtGui/qcursor.h> 50 #ifdef QT_INCLUDE_COMPAT 51 # include <QtGui/qdesktopwidget.h> 54 # include <QtGui/qwidget.h> 55 # include <QtGui/qpalette.h> 58 # include <QtGui/qrgb.h> 59 # include <QtGui/qtransportauth_qws.h> 64 #if defined(Q_OS_SYMBIAN) 65 class CApaApplication;
80 template <
typename T>
class QList;
84 #elif defined(Q_WS_QPA) 87 #if defined(Q_OS_SYMBIAN) 96 #define qApp (static_cast<QApplication *>(QCoreApplication::instance())) 107 #ifndef QT_NO_WHEELEVENT 114 #ifndef QT_NO_STYLE_STYLESHEET 123 enum Type { Tty, GuiClient, GuiServer };
126 typedef CApaApplication * (*QS60MainApplicationFactory)();
130 QApplication(
int &argc,
char **argv,
int = ApplicationFlags);
131 QApplication(
int &argc,
char **argv,
bool GUIenabled,
int = ApplicationFlags);
133 #if defined(Q_WS_X11) 137 #if defined(Q_OS_SYMBIAN) 138 QApplication(QApplication::QS60MainApplicationFactory factory,
int &argc,
char **argv,
int = ApplicationFlags);
141 virtual ~QApplication();
146 static void setStyle(
QStyle*);
148 enum ColorSpec { NormalColor=0, CustomColor=1, ManyColor=2 };
149 static int colorSpec();
150 static void setColorSpec(
int);
151 static void setGraphicsSystem(
const QString &);
154 static QCursor *overrideCursor();
155 static void setOverrideCursor(
const QCursor &);
156 static void changeOverrideCursor(
const QCursor &);
157 static void restoreOverrideCursor();
162 static void setPalette(
const QPalette &,
const char* className = 0);
165 static QFont font(
const char *className);
166 static void setFont(
const QFont &,
const char* className = 0);
169 static void setWindowIcon(
const QIcon &icon);
170 static QIcon windowIcon();
174 static QT3_SUPPORT
QWidget *mainWidget();
175 static QT3_SUPPORT
void setMainWidget(
QWidget *);
183 static QWidget *activePopupWidget();
184 static QWidget *activeModalWidget();
185 #ifndef QT_NO_CLIPBOARD 190 static QWidget *activeWindow();
191 static void setActiveWindow(
QWidget* act);
202 static Qt::KeyboardModifiers keyboardModifiers();
203 static Qt::KeyboardModifiers queryKeyboardModifiers();
204 static Qt::MouseButtons mouseButtons();
206 static void setDesktopSettingsAware(
bool);
207 static bool desktopSettingsAware();
209 static void setCursorFlashTime(
int);
210 static int cursorFlashTime();
212 static void setDoubleClickInterval(
int);
213 static int doubleClickInterval();
215 static void setKeyboardInputInterval(
int);
216 static int keyboardInputInterval();
218 #ifndef QT_NO_WHEELEVENT 219 static void setWheelScrollLines(
int);
220 static int wheelScrollLines();
222 static void setGlobalStrut(
const QSize &);
223 static QSize globalStrut();
225 static void setStartDragTime(
int ms);
226 static int startDragTime();
227 static void setStartDragDistance(
int l);
228 static int startDragDistance();
237 static void setEffectEnabled(
Qt::UIEffect,
bool enable =
true);
239 #if defined(Q_WS_MAC) 242 #if defined(Q_WS_X11) 244 virtual int x11ClientMessage(
QWidget*,
XEvent*,
bool passive_only);
245 int x11ProcessEvent(
XEvent*);
247 #if defined(Q_OS_SYMBIAN) 248 int symbianProcessEvent(
const QSymbianEvent *
event);
249 virtual bool symbianEventFilter(
const QSymbianEvent *event);
251 #if defined(Q_WS_QWS) 252 virtual bool qwsEventFilter(
QWSEvent *);
254 void qwsSetCustomColors(
QRgb *colortable,
int start,
int numColors);
255 #ifndef QT_NO_QWS_MANAGER 262 #if defined(Q_WS_QPA) 267 #if defined(Q_WS_WIN) 268 void winFocus(
QWidget *,
bool);
269 static void winMouseButtonUp();
271 #ifndef QT_NO_SESSIONMANAGER 273 bool isSessionRestored()
const;
285 static QLocale keyboardInputLocale();
292 static void setQuitOnLastWindowClosed(
bool quit);
293 static bool quitOnLastWindowClosed();
295 #ifdef QT_KEYPAD_NAVIGATION 297 static bool keypadNavigationEnabled();
303 void lastWindowClosed();
305 void fontDatabaseChanged();
306 #ifndef QT_NO_SESSIONMANAGER 311 void aboutToReleaseGpuResources();
312 void aboutToUseGpuResources();
318 #ifndef QT_NO_STYLE_STYLESHEET 319 void setStyleSheet(
const QString& sheet);
322 void setAutoMaximizeThreshold(
const int threshold);
323 int autoMaximizeThreshold()
const;
325 void setAutoSipEnabled(
const bool enabled);
326 bool autoSipEnabled()
const;
327 static void closeAllWindows();
328 static void aboutQt();
331 #if defined(Q_WS_QWS) 332 void setArgs(
int,
char **);
340 static inline bool QT3_SUPPORT reverseLayout() {
return layoutDirection() ==
Qt::RightToLeft; }
341 static QT3_SUPPORT Qt::Alignment horizontalAlignment(Qt::Alignment align);
342 typedef int ColorMode;
343 enum { NormalColors = NormalColor, CustomColors = CustomColor };
344 static inline QT3_SUPPORT ColorMode colorMode() {
return static_cast<ColorMode
>(colorSpec()); }
345 static inline QT3_SUPPORT
void setColorMode(ColorMode mode) { setColorSpec(
int(mode)); }
346 #if defined(Q_OS_WIN32) || defined(Q_OS_CYGWIN) 349 #if defined(Q_OS_MAC) 352 # ifndef QT_NO_CURSOR 353 inline static QT3_SUPPORT
void setOverrideCursor(
const QCursor &cursor,
bool replace)
354 {
if (replace) changeOverrideCursor(cursor);
else setOverrideCursor(cursor); }
356 inline static QT3_SUPPORT
bool hasGlobalMouseTracking() {
return true;}
357 inline static QT3_SUPPORT
void setGlobalMouseTracking(
bool) {}
358 inline static QT3_SUPPORT
void flushX() {
flush(); }
359 static inline QT3_SUPPORT
void setWinStyleHighlightColor(
const QColor &
c) {
364 static inline QT3_SUPPORT
const QColor &winStyleHighlightColor()
366 static inline QT3_SUPPORT
void setPalette(
const QPalette &pal,
bool,
const char* className = 0)
367 { setPalette(pal, className); }
368 static inline QT3_SUPPORT
void setFont(
const QFont &font,
bool,
const char* className = 0)
369 { setFont(font, className); }
371 static inline QT3_SUPPORT
QWidget *widgetAt(
int x,
int y,
bool child)
372 {
QWidget *w = widgetAt(x, y);
return child ? w : (w ? w->
window() : 0); }
373 static inline QT3_SUPPORT
QWidget *widgetAt(
const QPoint &p,
bool child)
374 {
QWidget *w = widgetAt(p);
return child ? w : (w ? w->
window() : 0); }
375 #endif // QT3_SUPPORT 377 #if defined(Q_INTERNAL_QAPP_SRC) || defined(qdoc) 381 #if defined(Q_WS_X11) 385 #if defined(Q_OS_SYMBIAN) || defined(qdoc) 386 QApplication(QApplication::QS60MainApplicationFactory factory,
int &argc,
char **argv);
404 #ifndef QT_NO_SHORTCUT 412 #if defined(Q_WS_QWS) 418 #ifndef QT_NO_GESTURES 422 #if defined(Q_WS_MAC) || defined(Q_WS_X11) 425 #if defined(QT_RX71_MULTITOUCH) 428 #if defined(Q_OS_SYMBIAN) 437 #endif // QAPPLICATION_H The QColor class provides colors based on RGB, HSV or CMYK values.
static QWaylandClipboard * clipboard
The QApplication class manages the GUI application's control flow and main settings.
The QGraphicsScene class provides a surface for managing a large number of 2D graphical items...
static QWidgetList topLevelWidgets()
The QCursor class provides a mouse cursor with an arbitrary shape.
The QFontMetrics class provides font metrics information.
#define QT_END_NAMESPACE
This macro expands to.
QPointer< QWidget > widget
bool autoSipEnabled
toggles automatic SIP (software input panel) visibility
The QGraphicsItem class is the base class for all graphical items in a QGraphicsScene.
static int exec()
Enters the main event loop and waits until exit() is called.
friend class QApplication
ColorSpec
See setColorSpec() for full details.
QIcon windowIcon
the default window icon
#define Q_DISABLE_COPY(Class)
Disables the use of copy constructors and assignment operators for the given Class.
#define Q_PRIVATE_SLOT(d, signature)
static QWidget * topLevelAt(int x, int y)
This is an overloaded member function, provided for convenience. It differs from the above function o...
static const WinVersion WindowsVersion
the version of the Windows operating system on which the application is run (Windows only) ...
bool event(QEvent *)
This virtual function receives events to an object and should return true if the event e was recogniz...
The QDirectPainter class provides direct access to the underlying hardware in Qt for Embedded Linux...
The QString class provides a Unicode character string.
static QSysInfo::MacVersion macVersion()
Use QSysInfo::MacintoshVersion instead.
virtual bool compressEvent(QEvent *, QObject *receiver, QPostEventList *)
Returns true if event was compressed away (possibly deleted) and should not be added to the list...
The QObject class is the base class of all Qt objects.
const QColor & color(ColorGroup cg, ColorRole cr) const
Returns the color in the specified color group, used for the given color role.
The QShortcut class is used to create keyboard shortcuts.
The QDecoration class is a base class for window decorations in Qt for Embedded Linux.
The QWSEvent class encapsulates an event in Qt for Embedded Linux.
virtual bool notify(QObject *, QEvent *)
Sends event to receiver: {receiver}->event(event).
The QSessionManager class provides access to the session manager.
#define QT_BEGIN_NAMESPACE
This macro expands to.
The QEventLoop class provides a means of entering and leaving an event loop.
static bool isLeftToRight()
Returns true if the application's layout direction is Qt::LeftToRight; otherwise returns false...
Qt::LayoutDirection layoutDirection
the default layout direction for this application
QString styleSheet
the application style sheet
The QClipboard class provides access to the window system clipboard.
static QWidget * widgetAt(int x, int y)
This is an overloaded member function, provided for convenience. It differs from the above function o...
QSize globalStrut
the minimum size that any GUI element that the user can interact with should have ...
struct OpaqueEventRef * EventRef
The QTranslator class provides internationalization support for text output.
The QCoreApplication class provides an event loop for console Qt applications.
int startDragTime
the time in milliseconds that a mouse button must be held down before a drag and drop operation will ...
int keyboardInputInterval
the time limit in milliseconds that distinguishes a key press from two consecutive key presses ...
The QFont class specifies a font used for drawing text.
static bool x11EventFilter(void *message, long *result)
The QPoint class defines a point in the plane using integer precision.
void setColor(ColorGroup cg, ColorRole cr, const QColor &color)
Sets the color in the specified color group, used for the given color role, to the specified solid co...
The QStyle class is an abstract base class that encapsulates the look and feel of a GUI...
int cursorFlashTime
the text cursor's flash (blink) time in milliseconds
The QLineEdit widget is a one-line text editor.
int wheelScrollLines
the number of lines to scroll a widget, when the mouse wheel is rotated.
static const MacVersion MacintoshVersion
the version of the Macintosh operating system on which the application is run (Mac only)...
The QSize class defines the size of a two-dimensional object using integer point precision.
struct OpaqueEventHandlerCallRef * EventHandlerCallRef
#define Q_DECLARE_PRIVATE(Class)
int startDragDistance
If you support drag and drop in your application, and want to start a drag and drop operation after t...
bool quitOnLastWindowClosed
whether the application implicitly quits when the last window is closed.
The QInputContext class abstracts the input method dependent data and composing state.
int doubleClickInterval
the time limit in milliseconds that distinguishes a double click from two consecutive mouse clicks ...
The QEvent class is the base class of all event classes.
static bool isRightToLeft()
Returns true if the application's layout direction is Qt::RightToLeft; otherwise returns false...
int autoMaximizeThreshold
defines a threshold for auto maximizing widgets
#define Q_DECL_DEPRECATED
The QAction class provides an abstract user interface action that can be inserted into widgets...
static void flush()
Flushes the platform specific event queues.
The QList class is a template class that provides lists.
Qt::LayoutDirection direction
The QPalette class contains color groups for each widget state.
The QIcon class provides scalable icons in different modes and states.