42 #ifndef QAPPLICATION_H
43 #define QAPPLICATION_H
50 #ifdef QT_INCLUDE_COMPAT
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)
92 class QApplicationPrivate;
96 #define qApp (static_cast<QApplication *>(QCoreApplication::instance()))
103 Q_PROPERTY(QIcon windowIcon READ windowIcon WRITE setWindowIcon)
104 Q_PROPERTY(
int cursorFlashTime READ cursorFlashTime WRITE setCursorFlashTime)
105 Q_PROPERTY(
int doubleClickInterval READ doubleClickInterval WRITE setDoubleClickInterval)
106 Q_PROPERTY(
int keyboardInputInterval READ keyboardInputInterval WRITE setKeyboardInputInterval)
107 #ifndef QT_NO_WHEELEVENT
108 Q_PROPERTY(
int wheelScrollLines READ wheelScrollLines WRITE setWheelScrollLines)
111 Q_PROPERTY(
int startDragTime READ startDragTime WRITE setStartDragTime)
112 Q_PROPERTY(
int startDragDistance READ startDragDistance WRITE setStartDragDistance)
113 Q_PROPERTY(
bool quitOnLastWindowClosed READ quitOnLastWindowClosed WRITE setQuitOnLastWindowClosed)
114 #ifndef QT_NO_STYLE_STYLESHEET
118 Q_PROPERTY(
int autoMaximizeThreshold READ autoMaximizeThreshold WRITE setAutoMaximizeThreshold)
120 Q_PROPERTY(
bool autoSipEnabled READ autoSipEnabled WRITE setAutoSipEnabled)
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);
132 QApplication(
int &argc,
char **argv, Type,
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);
145 static QStyle *style();
146 static void setStyle(QStyle*);
147 static QStyle *setStyle(
const QString&);
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();
161 static QPalette palette(
const char *className);
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 *);
181 static QDesktopWidget *desktop();
183 static QWidget *activePopupWidget();
184 static QWidget *activeModalWidget();
185 #ifndef QT_NO_CLIPBOARD
190 static QWidget *activeWindow();
191 static void setActiveWindow(
QWidget* act);
200 static void alert(
QWidget *widget,
int duration = 0);
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)
243 virtual bool x11EventFilter(
XEvent *);
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;
276 virtual void commitData(QSessionManager& sm);
277 virtual void saveState(QSessionManager& sm);
285 static QLocale keyboardInputLocale();
292 static void setQuitOnLastWindowClosed(
bool quit);
293 static bool quitOnLastWindowClosed();
295 #ifdef QT_KEYPAD_NAVIGATION
296 static Q_DECL_DEPRECATED
void setKeypadNavigationEnabled(
bool);
297 static bool keypadNavigationEnabled();
303 void lastWindowClosed();
305 void fontDatabaseChanged();
306 #ifndef QT_NO_SESSIONMANAGER
307 void commitDataRequest(QSessionManager &sessionManager);
308 void saveStateRequest(QSessionManager &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)
347 static QT3_SUPPORT Qt::WindowsVersion winVersion() {
return (Qt::WindowsVersion)QSysInfo::WindowsVersion; }
349 #if defined(Q_OS_MAC)
350 static QT3_SUPPORT Qt::MacintoshVersion macVersion() {
return (Qt::MacintoshVersion)QSysInfo::MacintoshVersion; }
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);
397 friend class QGraphicsScenePrivate;
399 friend class QWidgetPrivate;
400 friend class QETWidget;
401 friend class Q3AccelManager;
403 friend class QWidgetAnimator;
404 #ifndef QT_NO_SHORTCUT
407 friend class QTextControl;
410 friend class QFontDatabasePrivate;
412 #if defined(Q_WS_QWS)
414 friend class QWSDirectPainterSurface;
416 friend class QDirectPainterPrivate;
418 #ifndef QT_NO_GESTURES
419 friend class QGestureManager;
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
GLuint GLuint GLsizei GLenum type
typedefQT_END_NAMESPACE QT_END_HEADER struct _XDisplay Display
#define Q_PRIVATE_SLOT(d, signature)
friend class QApplication
QT_BEGIN_HEADER QT_BEGIN_NAMESPACE typedef unsigned int QRgb
virtual bool compressEvent(QEvent *, QObject *receiver, QPostEventList *)
#define QT_BEGIN_NAMESPACE
XVisualInfo Pixmap Colormap cmap
virtual bool notify(QObject *, QEvent *)
struct OpaqueEventRef * EventRef
static bool isRightToLeft()
static bool isLeftToRight()
struct OpaqueEventHandlerCallRef * EventHandlerCallRef
GLubyte GLubyte GLubyte GLubyte w
static QWidget * widgetAt(int x, int y)
static QWidget * topLevelAt(int x, int y)