1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>
Qt Toolkit - qapplication.h include file
</title><style type="text/css"><!--
h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }body { background: white; color: black; }
--></style>
</head><body bgcolor="#ffffff">
<table width="100%">
<tr><td><a href="index.html">
<img width="100" height="100" src="qtlogo.png"
alt="Home" border="0"><img width="100"
height="100" src="face.png" alt="Home" border="0">
</a><td valign=top><div align=right><img src="dochead.png" width="472" height="27"><br>
<a href="classes.html"><b>Classes</b></a>
-<a href="annotated.html">Annotated</a>
- <a href="hierarchy.html">Tree</a>
-<a href="functions.html">Functions</a>
-<a href="index.html">Home</a>
-<a href="topicals.html"><b>Structure</b></a>
</div>
</table>
<h1 align=center>qapplication.h</h1><br clear="all">
This is the verbatim text of the qapplication.h include file. It is
provided only for illustration; the copyright
remains with Trolltech.
<hr>
<pre>
/****************************************************************************
** $Id: qt/src/kernel/qapplication.h 2.3.2 edited 2001-10-05 $
**
** Definition of QApplication class
**
** Created : 931107
**
** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
**
** This file is part of the kernel module of the Qt GUI Toolkit.
**
** This file may be distributed under the terms of the Q Public License
** as defined by Trolltech AS of Norway and appearing in the file
** LICENSE.QPL included in the packaging of this file.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
** licenses may use this file in accordance with the Qt Commercial License
** Agreement provided with the Software.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
** information about Qt Commercial License Agreements.
** See http://www.trolltech.com/qpl/ for QPL licensing information.
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
#ifndef QAPPLICATION_H
#define QAPPLICATION_H
#ifndef QT_H
#include "qwidget.h"
#include "qasciidict.h"
#include "qpalette.h"
#include "qtranslator.h"
#endif // QT_H
class <a href="qsessionmanager.html">QSessionManager</a>;
class <a href="qstyle.html">QStyle</a>;
class <a href="qtranslator.html">QTranslator</a>;
#if defined(_WS_QWS_)
class <a href="qwsdecoration.html">QWSDecoration</a>;
#endif
template <class type> class QList;
class <a href="qapplication.html">QApplication</a>;
extern Q_EXPORT QApplication *qApp; // global application object
#if defined(QT_THREAD_SUPPORT)
class <a href="qmutex.html">QMutex</a>;
class <a href="qsemaphore.html">QSemaphore</a>;
#endif
// REMOVE IN 3.0 (just here for moc source compatibility)
#define QNonBaseApplication QApplication
class Q_EXPORT <a href="qapplication.html">QApplication</a> : public <a href="qobject.html">QObject</a>
{
Q_OBJECT
public:
QApplication( int &argc, char **argv);
QApplication( int &argc, char **argv, bool GUIenabled );
enum Type { Tty, GuiClient, GuiServer };
QApplication( int &argc, char **argv, Type );
#if defined(_WS_X11_)
QApplication( Display* dpy );
QApplication( Display *dpy, int argc, char **argv);
#endif
virtual ~QApplication();
int argc() const;
char **argv() const;
Type type() const;
#ifndef QT_NO_STYLE
static QStyle &style();
static void setStyle( QStyle* );
#endif
#if 1 /* OBSOLETE */
enum ColorMode { NormalColors, CustomColors };
static ColorMode colorMode();
static void setColorMode( QApplication::ColorMode );
#endif
enum ColorSpec { NormalColor=0, CustomColor=1, ManyColor=2 };
static int colorSpec();
static void setColorSpec( int );
#ifndef QT_NO_CURSOR
static QCursor *overrideCursor();
static void setOverrideCursor( const QCursor &, bool replace=FALSE );
static void restoreOverrideCursor();
#endif
static bool hasGlobalMouseTracking();
static void setGlobalMouseTracking( bool enable );
#ifndef QT_NO_PALETTE
static QPalette palette( const QWidget* = 0 );
static void setPalette( const QPalette &, bool informWidgets=FALSE,
const char* className = 0 );
#endif
static QFont font( const QWidget* = 0 );
static void setFont( const QFont &, bool informWidgets=FALSE,
const char* className = 0 );
static QFontMetrics fontMetrics();
QWidget *mainWidget() const;
virtual void setMainWidget( QWidget * );
virtual void polish( QWidget * );
static QWidgetList *allWidgets();
static QWidgetList *topLevelWidgets();
static QWidget *desktop();
static QWidget *activePopupWidget();
static QWidget *activeModalWidget();
static QClipboard *clipboard();
QWidget *focusWidget() const;
QWidget *activeWindow() const;
static QWidget *widgetAt( int x, int y, bool child=FALSE );
static QWidget *widgetAt( const QPoint &, bool child=FALSE );
int exec();
void processEvents();
void processEvents( int maxtime );
void processOneEvent();
int enter_loop();
void exit_loop();
int loopLevel() const;
static void exit( int retcode=0 );
static bool sendEvent( QObject *receiver, QEvent *event );
static void postEvent( QObject *receiver, QEvent *event );
static void sendPostedEvents( QObject *receiver, int event_type );
static void sendPostedEvents();
static void removePostedEvents( QObject *receiver );
virtual bool notify( QObject *, QEvent * );
static bool startingUp();
static bool closingDown();
static void flushX();
static void syncX();
static void beep();
#ifndef QT_NO_TRANSLATION
void setDefaultCodec( QTextCodec* );
QTextCodec* defaultCodec() const;
void installTranslator( QTranslator * );
void removeTranslator( QTranslator * );
#endif
QString translate( const char *, const char * ) const;
QString translate( const char *, const char *,
const char * ) const;
#ifndef QT_NO_PALETTE
static void setWinStyleHighlightColor( const QColor & );
static const QColor &winStyleHighlightColor();
#endif
static void setDesktopSettingsAware( bool );
static bool desktopSettingsAware();
static void setCursorFlashTime( int );
static int cursorFlashTime();
static void setDoubleClickInterval( int );
static int doubleClickInterval();
static void setWheelScrollLines( int );
static int wheelScrollLines();
static void setGlobalStrut( const QSize & );
static QSize globalStrut();
static void setStartDragTime( int ms );
static int startDragTime();
static void setStartDragDistance( int l );
static int startDragDistance();
static bool isEffectEnabled( Qt::UIEffect );
static void setEffectEnabled( Qt::UIEffect, bool enable = TRUE );
#if defined(_WS_MAC_)
void do_mouse_down(void *);
virtual bool macEventFilter( MSG * );
int macProcessEvent( MSG * );
#elif defined(_WS_WIN_)
virtual bool winEventFilter( MSG * );
#elif defined(_WS_X11_)
virtual bool x11EventFilter( XEvent * );
virtual int x11ClientMessage( QWidget*, XEvent*, bool passive_only);
int x11ProcessEvent( XEvent* );
#elif defined(_WS_QWS_)
virtual bool qwsEventFilter( QWSEvent * );
int qwsProcessEvent( QWSEvent* );
void qwsSetCustomColors( QRgb *colortable, int start, int numColors );
#ifndef QT_NO_QWS_MANAGER
static QWSDecoration &qwsDecoration();
static void qwsSetDecoration( QWSDecoration *);
#endif
#endif
#if defined(_WS_WIN_)
static WindowsVersion winVersion();
void winFocus( QWidget *, bool );
static void winMouseButtonUp();
#endif
#ifndef QT_NO_SESSIONMANAGER
// session management
bool isSessionRestored() const;
QString sessionId() const;
virtual void commitData( QSessionManager& sm );
virtual void saveState( QSessionManager& sm );
#endif
#if defined(_WS_X11_)
static void create_xim();
static void close_xim();
#endif
void wakeUpGuiThread();
#if defined(QT_THREAD_SUPPORT)
void lock();
void unlock(bool wakeUpGui = TRUE);
bool locked();
#endif
signals:
void lastWindowClosed();
void aboutToQuit();
void guiThreadAwake();
public slots:
void quit();
void closeAllWindows();
#if defined(_WS_QWS_)
protected:
void setArgs(int, char **);
#endif
private:
void construct( int &argc, char **argv, Type );
bool processNextEvent( bool );
void initialize( int, char ** );
void init_precmdline();
void process_cmdline( int* argcptr, char ** argv );
#if defined(_WS_QWS_)
static QWidget *findChildWidget( const QWidget *p, const QPoint &pos );
static QWidget *findWidget( const QObjectList&, const QPoint &, bool rec );
#endif
#if defined(QT_THREAD_SUPPORT)
static QMutex * qt_mutex;
#endif
int app_argc;
char **app_argv;
bool quit_now;
int quit_code;
static QStyle *app_style;
static int app_cspec;
#ifndef QT_NO_PALETTE
static QPalette *app_pal;
#endif
static QFont *app_font;
#ifndef QT_NO_CURSOR
static QCursor *app_cursor;
#endif
static int app_tracking;
static bool is_app_running;
static bool is_app_closing;
static bool app_exit_loop;
static int loop_level;
static QWidget *main_widget;
static QWidget *focus_widget;
static QWidget *active_window;
static bool obey_desktop_settings;
static int cursor_flash_time;
static int mouse_double_click_time;
static int wheel_scroll_lines;
static bool animate_ui;
static bool animate_menu;
static bool animate_tooltip;
static bool animate_combo;
static bool fade_menu;
static bool fade_tooltip;
QList<QTranslator> *translators;
#ifndef QT_NO_SESSIONMANAGER
QSessionManager *session_manager;
QString session_id;
bool is_session_restored;
#endif
#if defined(_WS_X11_) && !defined (QT_NO_STYLE )
static void x11_initialize_style();
#endif
static QSize app_strut;
static QAsciiDict<QPalette> *app_palettes;
static QAsciiDict<QFont> *app_fonts;
static QWidgetList *popupWidgets;
bool inPopupMode() const;
void closePopup( QWidget *popup );
void openPopup( QWidget *popup );
void setActiveWindow( QWidget* act );
static void removePostedEvent( QEvent * );
friend class QWidget;
friend class QETWidget;
friend class QEvent;
private: // Disabled copy constructor and operator=
#if defined(Q_DISABLE_COPY)
QApplication( const QApplication & );
QApplication &operator=( const QApplication & );
#endif
};
inline int QApplication::argc() const
{
return app_argc;
}
inline char **QApplication::argv() const
{
return app_argv;
}
#if defined(_WS_QWS_)
inline void QApplication::setArgs(int c, char **v)
{
app_argc = c;
app_argv = v;
}
#endif
#ifndef QT_NO_STYLE
inline QStyle& QApplication::style()
{
return *app_style;
}
#endif
#ifndef QT_NO_CURSOR
inline QCursor *QApplication::overrideCursor()
{
return app_cursor;
}
#endif
inline bool QApplication::hasGlobalMouseTracking()
{
return app_tracking > 0;
}
inline QWidget *QApplication::mainWidget() const
{
return main_widget;
}
inline QWidget *QApplication::focusWidget() const
{
return focus_widget;
}
inline QWidget *QApplication::activeWindow() const
{
return active_window;
}
inline QWidget *QApplication::widgetAt( const QPoint &p, bool child )
{
return widgetAt( p.x(), p.y(), child );
}
inline bool QApplication::inPopupMode() const
{
return popupWidgets != 0;
}
#ifndef QT_NO_SESSIONMANAGER
inline bool QApplication::isSessionRestored() const
{
return is_session_restored;
}
inline QString QApplication::sessionId() const
{
return session_id;
}
#endif
inline QSize QApplication::globalStrut()
{
return app_strut;
}
inline bool QApplication::sendEvent( QObject *receiver, QEvent *event )
{ return qApp->notify( receiver, event ); }
#ifdef QT_NO_TRANSLATION
// Simple versions
inline QString QApplication::translate( const char *, const char *key ) const
{
return QString::fromLatin1( key );
}
inline QString QApplication::translate( const char *, const char *key,
const char * ) const
{
return QString::fromLatin1( key );
}
#endif
#endif // QAPPLICATION_H
</pre>
<p><address><hr><div align="center">
<table width="100%" cellspacing="0" border="0"><tr>
<td>Copyright 2001 Trolltech<td><a href="http://www.trolltech.com/trademarks.html">Trademarks</a>
<td align="right"><div align="right">Qt version 2.3.2</div>
</table></div></address></body></html>
|