Qt 4.8
|
The QCoreApplication class provides an event loop for console Qt applications. More...
#include <qcoreapplication.h>
Public Types | |
enum | { ApplicationFlags } |
enum | Encoding { CodecForTr, UnicodeUTF8, DefaultCodec = CodecForTr } |
This enum type defines the 8-bit encoding of character string arguments to translate(): More... | |
typedef bool(* | EventFilter) (void *message, long *result) |
A function with the following signature that can be used as an event filter: More... | |
Public Slots | |
static void | quit () |
Tells the application to exit with return code 0 (success). More... | |
Public Slots inherited from QObject | |
void | deleteLater () |
Schedules this object for deletion. More... | |
Signals | |
void | aboutToQuit () |
This signal is emitted when the application is about to quit the main event loop, e. More... | |
void | unixSignal (int) |
This signal is emitted whenever a Unix signal is received by the application. More... | |
Signals inherited from QObject | |
void | destroyed (QObject *=0) |
This signal is emitted immediately before the object obj is destroyed, and can not be blocked. More... | |
Public Functions | |
bool | filterEvent (void *message, long *result) |
Sends message through the event filter that was set by setEventFilter(). More... | |
virtual bool | notify (QObject *, QEvent *) |
Sends event to receiver: {receiver}->event(event). More... | |
QCoreApplication (int &argc, char **argv) | |
Constructs a Qt kernel application. More... | |
EventFilter | setEventFilter (EventFilter filter) |
Replaces the event filter function for the QCoreApplication with filter and returns the pointer to the replaced event filter function. More... | |
virtual bool | winEventFilter (MSG *message, long *result) |
The message procedure calls this function for every message received. More... | |
~QCoreApplication () | |
Destroys the QCoreApplication object. More... | |
Public Functions inherited from QObject | |
bool | blockSignals (bool b) |
If block is true, signals emitted by this object are blocked (i.e., emitting a signal will not invoke anything connected to it). More... | |
const QObjectList & | children () const |
Returns a list of child objects. More... | |
bool | connect (const QObject *sender, const char *signal, const char *member, Qt::ConnectionType type=Qt::AutoConnection) const |
bool | disconnect (const char *signal=0, const QObject *receiver=0, const char *member=0) |
bool | disconnect (const QObject *receiver, const char *member=0) |
void | dumpObjectInfo () |
Dumps information about signal connections, etc. More... | |
void | dumpObjectTree () |
Dumps a tree of children to the debug output. More... | |
QList< QByteArray > | dynamicPropertyNames () const |
Returns the names of all properties that were dynamically added to the object using setProperty(). More... | |
virtual bool | eventFilter (QObject *, QEvent *) |
Filters events if this object has been installed as an event filter for the watched object. More... | |
template<typename T > | |
T | findChild (const QString &aName=QString()) const |
Returns the child of this object that can be cast into type T and that is called name, or 0 if there is no such object. More... | |
template<typename T > | |
QList< T > | findChildren (const QString &aName=QString()) const |
Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects. More... | |
template<typename T > | |
QList< T > | findChildren (const QRegExp &re) const |
bool | inherits (const char *classname) const |
Returns true if this object is an instance of a class that inherits className or a QObject subclass that inherits className; otherwise returns false. More... | |
void | installEventFilter (QObject *) |
Installs an event filter filterObj on this object. More... | |
bool | isWidgetType () const |
Returns true if the object is a widget; otherwise returns false. More... | |
void | killTimer (int id) |
Kills the timer with timer identifier, id. More... | |
virtual const QMetaObject * | metaObject () const |
Returns a pointer to the meta-object of this object. More... | |
void | moveToThread (QThread *thread) |
Changes the thread affinity for this object and its children. More... | |
QString | objectName () const |
QObject * | parent () const |
Returns a pointer to the parent object. More... | |
QVariant | property (const char *name) const |
Returns the value of the object's name property. More... | |
Q_INVOKABLE | QObject (QObject *parent=0) |
Constructs an object with parent object parent. More... | |
void | removeEventFilter (QObject *) |
Removes an event filter object obj from this object. More... | |
void | setObjectName (const QString &name) |
void | setParent (QObject *) |
Makes the object a child of parent. More... | |
bool | setProperty (const char *name, const QVariant &value) |
Sets the value of the object's name property to value. More... | |
void | setUserData (uint id, QObjectUserData *data) |
bool | signalsBlocked () const |
Returns true if signals are blocked; otherwise returns false. More... | |
int | startTimer (int interval) |
Starts a timer and returns a timer identifier, or returns zero if it could not start a timer. More... | |
QThread * | thread () const |
Returns the thread in which the object lives. More... | |
QObjectUserData * | userData (uint id) const |
virtual | ~QObject () |
Destroys the object, deleting all its child objects. More... | |
Static Public Functions | |
static void | addLibraryPath (const QString &) |
Prepends path to the beginning of the library path list, ensuring that it is searched for libraries first. More... | |
static QString | applicationDirPath () |
Returns the directory that contains the application executable. More... | |
static QString | applicationFilePath () |
Returns the file path of the application executable. More... | |
static QString | applicationName () |
static qint64 | applicationPid () |
Returns the current process ID for the application. More... | |
static QString | applicationVersion () |
static QT_DEPRECATED int | argc () |
Use arguments(). More... | |
static QStringList | arguments () |
Returns the list of command-line arguments. More... | |
static QT_DEPRECATED char ** | argv () |
Use arguments() instead. More... | |
static bool | closingDown () |
Returns true if the application objects are being destroyed; otherwise returns false. More... | |
static int | exec () |
Enters the main event loop and waits until exit() is called. More... | |
static void | exit (int retcode=0) |
Tells the application to exit with a return code. More... | |
static void | flush () |
Flushes the platform specific event queues. More... | |
static bool | hasPendingEvents () |
This function returns true if there are pending events; otherwise returns false. More... | |
static void | installTranslator (QTranslator *messageFile) |
Adds the translation file translationFile to the list of translation files to be used for translations. More... | |
static QCoreApplication * | instance () |
Returns a pointer to the application's QCoreApplication (or QApplication) instance. More... | |
static QStringList | libraryPaths () |
Returns a list of paths that the application will search when dynamically loading libraries. More... | |
static QString | organizationDomain () |
static QString | organizationName () |
static void | postEvent (QObject *receiver, QEvent *event) |
Adds the event event, with the object receiver as the receiver of the event, to an event queue and returns immediately. More... | |
static void | postEvent (QObject *receiver, QEvent *event, int priority) |
static void | processEvents (QEventLoop::ProcessEventsFlags flags=QEventLoop::AllEvents) |
Processes all pending events for the calling thread according to the specified flags until there are no more events to process. More... | |
static void | processEvents (QEventLoop::ProcessEventsFlags flags, int maxtime) |
static void | removeLibraryPath (const QString &) |
Removes path from the library path list. More... | |
static void | removePostedEvents (QObject *receiver) |
Removes all events posted using postEvent() for receiver. More... | |
static void | removePostedEvents (QObject *receiver, int eventType) |
static void | removeTranslator (QTranslator *messageFile) |
Removes the translation file translationFile from the list of translation files used by this application. More... | |
static bool | sendEvent (QObject *receiver, QEvent *event) |
Sends event event directly to receiver receiver, using the notify() function. More... | |
static void | sendPostedEvents (QObject *receiver, int event_type) |
Immediately dispatches all events which have been previously queued with QCoreApplication::postEvent() and which are for the object receiver and have the event type event_type. More... | |
static void | sendPostedEvents () |
static void | setApplicationName (const QString &application) |
static void | setApplicationVersion (const QString &version) |
static void | setAttribute (Qt::ApplicationAttribute attribute, bool on=true) |
Sets the attribute attribute if on is true; otherwise clears the attribute. More... | |
static void | setLibraryPaths (const QStringList &) |
Sets the list of directories to search when loading libraries to paths. More... | |
static void | setOrganizationDomain (const QString &orgDomain) |
static void | setOrganizationName (const QString &orgName) |
static bool | startingUp () |
Returns true if an application object has not been created yet; otherwise returns false. More... | |
static bool | testAttribute (Qt::ApplicationAttribute attribute) |
Returns true if attribute attribute is set; otherwise returns false. More... | |
static QString | translate (const char *context, const char *key, const char *disambiguation=0, Encoding encoding=CodecForTr) |
static QString | translate (const char *context, const char *key, const char *disambiguation, Encoding encoding, int n) |
Returns the translation text for sourceText, by querying the installed translation files. More... | |
static void | watchUnixSignal (int signal, bool watch) |
Static Public Functions inherited from QObject | |
static bool | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection) |
Creates a connection of the given type from the signal in the sender object to the method in the receiver object. More... | |
static bool | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type=Qt::AutoConnection) |
static bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *member) |
Disconnects signal in object sender from method in object receiver. More... | |
static bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &member) |
static uint | registerUserData () |
static QString | tr (const char *sourceText, const char *comment=0, int n=-1) |
static QString | trUtf8 (const char *sourceText, const char *comment=0, int n=-1) |
Protected Functions | |
virtual bool | compressEvent (QEvent *, QObject *receiver, QPostEventList *) |
Returns true if event was compressed away (possibly deleted) and should not be added to the list. More... | |
bool | event (QEvent *) |
This virtual function receives events to an object and should return true if the event e was recognized and processed. More... | |
QCoreApplication (QCoreApplicationPrivate &p) | |
Protected Functions inherited from QObject | |
virtual void | childEvent (QChildEvent *) |
This event handler can be reimplemented in a subclass to receive child events. More... | |
virtual void | connectNotify (const char *signal) |
This virtual function is called when something has been connected to signal in this object. More... | |
virtual void | customEvent (QEvent *) |
This event handler can be reimplemented in a subclass to receive custom events. More... | |
virtual void | disconnectNotify (const char *signal) |
This virtual function is called when something has been disconnected from signal in this object. More... | |
QObject (QObjectPrivate &dd, QObject *parent=0) | |
int | receivers (const char *signal) const |
Returns the number of receivers connected to the signal. More... | |
QObject * | sender () const |
Returns a pointer to the object that sent the signal, if called in a slot activated by a signal; otherwise it returns 0. More... | |
int | senderSignalIndex () const |
virtual void | timerEvent (QTimerEvent *) |
This event handler can be reimplemented in a subclass to receive timer events for the object. More... | |
Private Functions | |
void | init () |
bool | notifyInternal (QObject *receiver, QEvent *event) |
Static Private Functions | |
static bool | sendSpontaneousEvent (QObject *receiver, QEvent *event) |
Properties | |
QString | applicationName |
the name of this application More... | |
QString | applicationVersion |
the version of this application More... | |
QString | organizationDomain |
the Internet domain of the organization that wrote this application More... | |
QString | organizationName |
the name of the organization that wrote this application More... | |
Static Private Attributes | |
static QCoreApplication * | self = 0 |
Related Functions | |
(Note that these are not member functions.) | |
void | qAddPostRoutine (QtCleanUpFunction ptr) |
Adds a global routine that will be called from the QApplication destructor. More... | |
removePostedEvents | |
Removes all events of the given eventType that were posted using postEvent() for receiver. More... | |
Related Functions inherited from QObject | |
T | qFindChildqFindChildren (const QObject *obj, const QString &name)() |
QList< T > | qFindChildrenqFindChildren (const QObject *obj, const QString &name)() |
QList< T > | qFindChildrenqFindChildren (const QObject *obj, const QRegExp ®Exp)() |
T * | qobject_cast (QObject *object) |
QObjectList | |
void * | qt_find_obj_child (QObject *parent, const char *type, const QString &name) |
Returns a pointer to the object named name that inherits type and with a given parent. More... | |
Additional Inherited Members | |
Static Public Variables inherited from QObject | |
static const QMetaObject | staticMetaObject |
This variable stores the meta-object for the class. More... | |
Protected Variables inherited from QObject | |
QScopedPointer< QObjectData > | d_ptr |
Static Protected Variables inherited from QObject | |
static const QMetaObject | staticQtMetaObject |
The QCoreApplication class provides an event loop for console Qt applications.
This class is used by non-GUI applications to provide their event loop. For non-GUI application that uses Qt, there should be exactly one QCoreApplication object. For GUI applications, see QApplication.
QCoreApplication contains the main event loop, where all events from the operating system (e.g., timer and network events) and other sources are processed and dispatched. It also handles the application's initialization and finalization, as well as system-wide and application-wide settings.
The event loop is started with a call to exec(). Long running operations can call processEvents() to keep the application responsive.
In general, we recommend that you create a QCoreApplication or a QApplication object in your main()
function as early as possible. exec() will not return until the event loop exits; e.g., when quit() is called.
Several static convenience functions are also provided. The QCoreApplication object is available from instance(). Events can be sent or posted using sendEvent(), postEvent(), and sendPostedEvents(). Pending events can be removed with removePostedEvents() or flushed with flush().
The class provides a quit() slot and an aboutToQuit() signal.
An application has an applicationDirPath() and an applicationFilePath(). Library paths (see QLibrary) can be retrieved with libraryPaths() and manipulated by setLibraryPaths(), addLibraryPath(), and removeLibraryPath().
Translation files can be added or removed using installTranslator() and removeTranslator(). Application strings can be translated using translate(). The QObject::tr() and QObject::trUtf8() functions are implemented in terms of translate().
The command line arguments which are passed to QCoreApplication's constructor should be accessed using the arguments() function. Note that some arguments supplied by the user may have been processed and removed by QCoreApplication.
In cases where command line arguments need to be obtained using the argv() function, you must convert them from the local string encoding using QString::fromLocal8Bit().
On Unix/Linux Qt is configured to use the system locale settings by default. This can cause a conflict when using POSIX functions, for instance, when converting between data types such as floats and strings, since the notation may differ between locales. To get around this problem, call the POSIX function setlocale(LC_NUMERIC,"C")
right after initializing QApplication or QCoreApplication to reset the locale that is used for number formatting to "C"-locale.
Definition at line 71 of file qcoreapplication.h.
QCoreApplication::EventFilter |
A function with the following signature that can be used as an event filter:
Definition at line 188 of file qcoreapplication.h.
anonymous enum |
Enumerator | |
---|---|
ApplicationFlags |
Definition at line 81 of file qcoreapplication.h.
This enum type defines the 8-bit encoding of character string arguments to translate():
Enumerator | |
---|---|
CodecForTr | |
UnicodeUTF8 | |
DefaultCodec |
Definition at line 154 of file qcoreapplication.h.
QCoreApplication::QCoreApplication | ( | int & | argc, |
char ** | argv | ||
) |
Constructs a Qt kernel application.
Kernel applications are applications without a graphical user interface. These type of applications are used at the console or as server processes.
The argc and argv arguments are processed by the application, and made available in a more convenient form by the arguments() function.
Definition at line 710 of file qcoreapplication.cpp.
Referenced by QApplication::QApplication().
QCoreApplication::~QCoreApplication | ( | ) |
Destroys the QCoreApplication object.
Definition at line 840 of file qcoreapplication.cpp.
|
protected |
Definition at line 671 of file qcoreapplication.cpp.
|
signal |
This signal is emitted when the application is about to quit the main event loop, e.
g. when the event loop level drops to zero. This may happen either after a call to quit() from inside the application or when the users shuts down the entire desktop session.
The signal is particularly useful if your application has to do some last-second cleanup. Note that no user interaction is possible in this state.
Referenced by exec().
|
static |
Prepends path to the beginning of the library path list, ensuring that it is searched for libraries first.
If path is empty or already in the path list, the path list is not changed.
The default path list consists of a single entry, the installation directory for plugins. The default installation directory for plugins is INSTALL/plugins
, where INSTALL
is the directory where Qt was installed.
In Symbian this function is only useful for adding paths for finding Qt extension plugin stubs, since the OS can only load libraries from the /sys/bin
directory.
Definition at line 2649 of file qcoreapplication.cpp.
Referenced by QPlatformIntegrationFactory::create(), QPlatformIntegrationFactory::keys(), QApplicationPrivate::qt_mac_apply_settings(), and QApplicationPrivate::x11_apply_settings().
|
static |
Returns the directory that contains the application executable.
For example, if you have installed Qt in the C:/Trolltech/Qt
directory, and you run the regexp
example, this function will return "C:/Trolltech/Qt/examples/tools/regexp".
On Mac OS X this will point to the directory actually containing the executable, which may be inside of an application bundle (if the application is bundled).
{/proc}
file system. If that fails, it assumes that {argv
[0]} contains the absolute file name of the executable. The function also assumes that the current directory has not been changed by the application.In Symbian this function will return the application private directory, not the path to executable itself, as those are always in {/sys/bin}
. If the application is in a read only drive, i.e. ROM, then the private path on the system drive will be returned.
Definition at line 2060 of file qcoreapplication.cpp.
Referenced by QmlApplicationViewerPrivate::adjustPath(), QCoreApplicationPrivate::appendApplicationPathToLibraryPaths(), QLibraryInfoPrivate::findConfiguration(), isDirPath(), QTranslator::load(), QLibraryInfo::location(), QDeclarativeImportDatabase::QDeclarativeImportDatabase(), and QDeclarativeImportDatabase::resolvePlugin().
|
static |
Returns the file path of the application executable.
For example, if you have installed Qt in the /usr/local/qt
directory, and you run the regexp
example, this function will return "/usr/local/qt/examples/tools/regexp/regexp".
{/proc}
file system. If that fails, it assumes that {argv
[0]} contains the absolute file name of the executable. The function also assumes that the current directory has not been changed by the application.Definition at line 2121 of file qcoreapplication.cpp.
Referenced by QCoreApplicationPrivate::appendApplicationPathToLibraryPaths(), applicationDirPath(), QPatternist::XPathHelper::normalizeQueryURI(), and QAccessibleApplication::text().
|
static |
|
static |
Returns the current process ID for the application.
Definition at line 2248 of file qcoreapplication.cpp.
Referenced by createFileFromTemplate(), QBBBpsEventFilter::handleNavigatorEvent(), and QBenchmarkValgrindUtils::outFileBase().
|
static |
Referenced by setApplicationVersion().
|
static |
Use arguments().
size() instead.
Definition at line 2267 of file qcoreapplication.cpp.
Referenced by QApplication::QApplication().
|
static |
Returns the list of command-line arguments.
Usually arguments().at(0) is the program name, arguments().at(1) is the first argument, and arguments().last() is the last argument. See the note below about Windows.
Calling this function is slow - you should store the result in a variable when parsing the command line.
On NT-based Windows, this limitation does not apply either. On Windows, the arguments() are not built from the contents of argv/argc, as the content does not support Unicode. Instead, the arguments() are constructed from the return value of GetCommandLine(). As a result of this, the string given by arguments().at(0) might not be the program name on Windows, depending on how the application was started.
For Symbian applications started with RApaLsSession::StartApp
one can specify arguments using CApaCommandLine::SetTailEndL
function. Such arguments are only available via this method; they will not be passed to main
function. Also note that only 8-bit string data set with CApaCommandLine::SetTailEndL
is supported by this function.
Definition at line 2333 of file qcoreapplication.cpp.
Referenced by applicationFilePath(), QDirectFBScreen::connect(), QDirectFbIntegration::initializeDirectFB(), and QTest::qExec().
|
static |
Use arguments() instead.
Definition at line 2285 of file qcoreapplication.cpp.
Referenced by applicationFilePath(), and QApplication::QApplication().
|
static |
Returns true if the application objects are being destroyed; otherwise returns false.
Definition at line 1108 of file qcoreapplication.cpp.
Referenced by QWindowsXPStylePrivate::cleanup(), discardInvalidateBufferRequest(), QtWndProc(), QEventDispatcherWin32::registerSocketNotifier(), QDragManager::self(), QSizeGripPrivate::updateMacSizer(), and QMacPasteboardMime::~QMacPasteboardMime().
|
protectedvirtual |
Returns true if event was compressed away (possibly deleted) and should not be added to the list.
Reimplemented in QApplication.
Definition at line 1418 of file qcoreapplication.cpp.
Referenced by QApplication::compressEvent(), and QApplication::isLeftToRight().
|
protectedvirtual |
This virtual function receives events to an object and should return true if the event e was recognized and processed.
The event() function can be reimplemented to customize the behavior of an object.
Reimplemented from QObject.
Reimplemented in QApplication.
Definition at line 1777 of file qcoreapplication.cpp.
Referenced by compressEvent(), QApplication::event(), QApplication::isLeftToRight(), notifyInternal(), postEvent(), removePostedEvents(), and QCoreApplicationPrivate::sendPostedEvents().
|
static |
Enters the main event loop and waits until exit() is called.
Returns the value that was set to exit() (which is 0 if exit() is called via quit()).
It is necessary to call this function to start event handling. The main event loop receives events from the window system and dispatches these to the application widgets.
To make your application perform idle processing (i.e. executing a special function whenever there are no pending events), use a QTimer with 0 timeout. More advanced idle processing schemes can be achieved using processEvents().
We recommend that you connect clean-up code to the QCoreApplication::aboutToQuit() signal, instead of putting it in your application's main()
function because on some platforms the QCoreApplication::exec() call may not return. For example, on Windows when the user logs off, the system terminates the process after Qt closes all top-level windows. Hence, there is no guarantee that the application will have time to exit its event loop and execute code at the end of the main()
function after the QCoreApplication::exec() call.
Definition at line 1212 of file qcoreapplication.cpp.
Referenced by QApplication::exec(), and QApplication::isLeftToRight().
|
static |
Tells the application to exit with a return code.
After this function has been called, the application leaves the main event loop and returns from the call to exec(). The exec() function returns returnCode. If the event loop is not running, this function does nothing.
By convention, a returnCode of 0 means success, and any non-zero value indicates an error.
Note that unlike the C library function of the same name, this function does return to the caller – it is event processing that stops.
Definition at line 1262 of file qcoreapplication.cpp.
Referenced by quit().
bool QCoreApplication::filterEvent | ( | void * | message, |
long * | result | ||
) |
Sends message through the event filter that was set by setEventFilter().
If no event filter has been set, this function returns false; otherwise, this function returns the result of the event filter function in the result parameter.
Definition at line 2788 of file qcoreapplication.cpp.
Referenced by QApplicationPrivate::globalEventProcessor(), and qt_internal_proc().
|
static |
Flushes the platform specific event queues.
If you are doing graphical changes inside a loop that does not return to the event loop on asynchronous window systems like X11 or double buffered window systems like Mac OS X, and you want to visualize these changes immediately (e.g. Splash Screens), call this function.
Definition at line 690 of file qcoreapplication.cpp.
Referenced by QAbstractButton::animateClick(), QAbstractButtonPrivate::click(), QX11Data::dndEnable(), QWindowsStyle::drawComplexControl(), flush(), QApplication::isLeftToRight(), QAbstractButton::keyPressEvent(), QAbstractButton::mouseMoveEvent(), QAbstractButton::mousePressEvent(), qt_mac_mouse_inside_answer_rect(), qt_x11_wait_for_window_manager(), QSplashScreen::repaint(), and QProgressDialog::setValue().
|
static |
This function returns true if there are pending events; otherwise returns false.
Pending events can be either from the window system or posted events using postEvent().
Definition at line 2809 of file qcoreapplication.cpp.
|
private |
Definition at line 747 of file qcoreapplication.cpp.
Referenced by QCoreApplication().
|
static |
Adds the translation file translationFile to the list of translation files to be used for translations.
Multiple translation files can be installed. Translations are searched for in the reverse order in which they were installed, so the most recently installed translation file is searched first and the first translation file installed is searched last. The search stops as soon as a translation containing a matching string is found.
Installing or removing a QTranslator, or changing an installed QTranslator generates a LanguageChange event for the QCoreApplication instance. A QApplication instance will propagate the event to all toplevel windows, where a reimplementation of changeEvent can re-translate the user interface by passing user-visible strings via the tr() function to the respective property setters. User-interface classes generated by Qt Designer provide a retranslateUi()
function that can be called.
Definition at line 1865 of file qcoreapplication.cpp.
|
inlinestatic |
Returns a pointer to the application's QCoreApplication (or QApplication) instance.
If no instance has been allocated, null
is returned.
Definition at line 118 of file qcoreapplication.h.
Referenced by QScriptEngine::availableExtensions(), QDBusConnectionPrivate::checkThread(), QTranslatorPrivate::clear(), QClassFactory::CreateInstanceHelper(), QApplicationPrivate::dispatchEnterLeave(), QEventDispatcherUNIXPrivate::doSelect(), QScrollArea::event(), QEventLoop::exec(), QLibraryInfoPrivate::findConfiguration(), QApplicationPrivate::graphicsSystem(), QScriptEngine::importExtension(), QSqlDatabasePrivate::init(), QDeclarativeEnginePrivate::init(), QBBSystemLocaleData::installSocketNotifiers(), QTestEventLoop::instance(), QFontDatabasePrivate::invalidate(), QAction::isIconVisibleInMenu(), QMenuBar::isNativeMenuBar(), QLibraryInfo::location(), QMenuBarPrivate::macCreateMenuBar(), qAppInstance(), qAppName(), QBBInputContext::QBBInputContext(), qDBusAddTimeout(), qDBusAddWatch(), QDBusDefaultConnection::QDBusDefaultConnection(), qDBusGenerateMetaObjectXml(), qDBusInterfaceFromMetaObject(), qDBusRealAddWatch(), qDBusRemoveTimeout(), qDBusRemoveWatch(), qDBusToggleWatch(), QEventDispatcherGlibPrivate::QEventDispatcherGlibPrivate(), QEventLoop::QEventLoop(), QHostInfoLookupManager::QHostInfoLookupManager(), QMdiArea::QMdiArea(), QNativeWifiEngine::QNativeWifiEngine(), QScriptEnginePrivate::QScriptEnginePrivate(), QSocks5BindStore::QSocks5BindStore(), qt_internal_proc(), qt_mac_set_menubar_icons(), qt_mac_set_native_menubar(), QTest::qWait(), QWSTtyKbPrivate::QWSTtyKbPrivate(), QX11EmbedContainer::QX11EmbedContainer(), QX11EmbedWidget::QX11EmbedWidget(), QDnotifySignalThread::run(), QDBusConnectionPrivate::sendWithReply(), QColor::setColorFromString(), QApplication::setFont(), QAction::setIconVisibleInMenu(), QApplicationPrivate::setPalette_helper(), QScriptEngineDebugger::standardWindow(), QMeeGoGraphicsSystem::switchToMeeGo(), QMeeGoGraphicsSystem::switchToRaster(), QCoreFuriCuri::timerEvent(), QWindowsXPStylePrivate::useXP(), QBBInputContext::~QBBInputContext(), QEvent::~QEvent(), and QTranslator::~QTranslator().
|
static |
Returns a list of paths that the application will search when dynamically loading libraries.
Qt provides default library paths, but they can also be set using a Using qt.conf{qt.conf} file. Paths specified in this file will override default values.
This list will include the installation directory for plugins if it exists (the default installation directory for plugins is INSTALL/plugins
, where INSTALL
is the directory where Qt was installed). The directory of the application executable (NOT the working directory) is always added, as well as the colon separated entries of the QT_PLUGIN_PATH environment variable.
If you want to iterate over the list, you can use the foreach pseudo-keyword:
Definition at line 2566 of file qcoreapplication.cpp.
Referenced by addLibraryPath(), QScriptEngine::availableExtensions(), getTransformationFunction(), QScriptEngine::importExtension(), init(), QDeclarativeDebugServerPrivate::loadConnectionPlugin(), QDeclarativeInspectorService::loadInspectorPlugin(), removeLibraryPath(), and QFactoryLoader::update().
Sends event to receiver: {receiver}->event(event).
Returns the value that is returned from the receiver's event handler. Note that this function is called for all events sent to any object in any thread.
For certain types of events (e.g. mouse and key events), the event will be propagated to the receiver's parent and so on up to the top-level object if the receiver is not interested in the event (i.e., it returns false).
There are five different ways that events can be processed; reimplementing this virtual function is just one of them. All five approaches are listed below:
Reimplementing paintEvent(), mousePressEvent() and so on. This is the commonest, easiest and least powerful way.
Reimplementing this function. This is very powerful, providing complete control; but only one subclass can be active at a time.
Installing an event filter on QCoreApplication::instance(). Such an event filter is able to process all events for all widgets, so it's just as powerful as reimplementing notify(); furthermore, it's possible to have more than one application-global event filter. Global event filters even see mouse events for disabled widgets. Note that application event filters are only called for objects that live in the main thread.
Reimplementing QObject::event() (as QWidget does). If you do this you get Tab key presses, and you get to see the events before any widget-specific event filters.
Reimplemented in QApplication.
Definition at line 1016 of file qcoreapplication.cpp.
Referenced by QApplication::isLeftToRight(), and notifyInternal().
This function is here to make it possible for Qt extensions to hook into event notification without subclassing QApplication
Definition at line 928 of file qcoreapplication.cpp.
Referenced by sendEvent().
|
static |
Referenced by setOrganizationDomain().
|
static |
Referenced by getFullPath(), launchWebBrowser(), openDocument(), and setOrganizationName().
Adds the event event, with the object receiver as the receiver of the event, to an event queue and returns immediately.
The event must be allocated on the heap since the post event queue will take ownership of the event and delete it once it has been posted. It is {not safe} to access the event after it has been posted.
When control returns to the main event loop, all events that are stored in the queue will be sent using the notify() function.
Events are processed in the order posted. For more control over the processing order, use the postEvent() overload below, which takes a priority argument. This function posts all event with a Qt::NormalEventPriority.
Definition at line 1315 of file qcoreapplication.cpp.
Referenced by QMetaObject::activate(), QEventDispatcherMacPrivate::activateTimer(), QNetworkReplyImplPrivate::backendNotify(), QTranslatorPrivate::clear(), QAxWidget::createHostWindow(), QObject::deleteLater(), QApplicationPrivate::emitLastWindowClosed(), QEventDispatcherWin32::event(), QApplication::event(), QDeclarativeSystemPalette::eventFilter(), QGraphicsScene::eventFilter(), QDeclarativeWorkerScriptEngine::executeUrl(), QWidgetPrivate::init(), QGraphicsLayout::invalidate(), QMetaMethod::invoke(), QWidgetPrivate::isBackgroundInherited(), QFutureWatcherBasePrivate::postCallOutEvent(), QScriptDebuggerFrontendPrivate::postEvent(), QScriptDebuggerBackendPrivate::postEvent(), QDBusConnectionPrivate::postEventToThread(), QDeclarativePixmapReply::postReply(), QDeclarativePixmapReaderThreadObject::processJobs(), QDeclarativeXmlQueryThreadObject::processJobs(), qt_fast_timer_proc(), qt_mac_display_change_callbk(), qt_post_window_change_event(), QtWndProc(), queued_activate(), QEventDispatcherWin32Private::registerTimer(), QDeclarativeWorkerScriptEngine::removeWorkerScript(), QDeclarativeWorkerScriptEnginePrivate::reportScriptException(), QSettingsPrivate::requestUpdate(), QDialogPrivate::resetModalitySetByOpen(), QNetworkReplyImplPrivate::resumeNotificationHandling(), QDnotifySignalThread::run(), QDeclarativePathViewPrivate::scheduleLayout(), QDeclarativeGridViewPrivate::scheduleLayout(), QDeclarativeListViewPrivate::scheduleLayout(), QSoftKeyManager::sendKeyEvent(), QDeclarativeWorkerScriptEngine::sendMessage(), QDeclarativeWorkerScriptEnginePrivate::sendMessage(), sendUpdateRequest(), QWidget::setParent(), QObjectPrivate::setParent_helper(), QWidget::setVisible(), QDeclarativeListModelWorkerAgent::sync(), QDeclarativeFlickable::timerEvent(), QETWidget::translateConfigEvent(), QLayout::update(), QWidget::update(), QGraphicsWidget::updateGeometry(), QWidgetPrivate::updateGeometry_helper(), QSoftKeyManager::updateSoftKeys(), QX11Data::xdndHandleBadwindow(), and QDeclarativeWorkerScriptEngine::~QDeclarativeWorkerScriptEngine().
Definition at line 1350 of file qcoreapplication.cpp.
|
static |
Processes all pending events for the calling thread according to the specified flags until there are no more events to process.
You can call this function occasionally when your program is busy performing a long operation (e.g. copying a file).
In event you are running a local loop which calls this function continuously, without an event loop, the DeferredDelete events will not be processed. This can affect the behaviour of widgets, e.g. QToolTip, that rely on DeferredDelete events to function properly. An alternative would be to call sendPostedEvents() from within that local loop.
Calling this function processes events only for the calling thread.
Definition at line 1136 of file qcoreapplication.cpp.
Referenced by Maemo::IcdPrivate::addrinfo(), QIBaseDriver::close(), QScript::TimeoutCheckerProxy::didTimeOut(), QScriptDebuggerPrivate::executeConsoleCommand(), QScriptDebuggerAgent::positionChange(), QPlatformEventLoopIntegration::processEvents(), QOleDropSource::QueryContinueDrag(), QTest::qWait(), QTest::qWaitForWindowShown(), Maemo::IcdPrivate::scan(), QProgressDialog::setValue(), QWidgetPrivate::show_helper(), Maemo::IcdPrivate::state(), Maemo::IcdPrivate::statistics(), QAudioInputPrivate::~QAudioInputPrivate(), and QAudioOutputPrivate::~QAudioOutputPrivate().
|
static |
Definition at line 1165 of file qcoreapplication.cpp.
|
staticslot |
Tells the application to exit with return code 0 (success).
Equivalent to calling QCoreApplication::exit(0).
It's common to connect the QApplication::lastWindowClosed() signal to quit(), and you also often connect e.g. QAbstractButton::clicked() or signals in QAction, QMenu, or QMenuBar to it.
Example:
Definition at line 1818 of file qcoreapplication.cpp.
Referenced by QWidgetPrivate::close_helper(), event(), QApplicationPrivate::globalAppleEventProcessor(), QApplicationPrivate::globalEventProcessor(), QBBNavigatorEventHandler::handleExit(), QtWndProc(), QCoreFuriCuri::timerEvent(), and QWidget::~QWidget().
|
static |
Removes path from the library path list.
If path is empty or not in the path list, the list is not changed.
Definition at line 2674 of file qcoreapplication.cpp.
|
static |
Removes all events posted using postEvent() for receiver.
The events are not dispatched, instead they are removed from the queue. You should never need to call this function. If you do call it, be aware that killing events may cause receiver to break one or more invariants.
Definition at line 1642 of file qcoreapplication.cpp.
|
static |
Definition at line 1669 of file qcoreapplication.cpp.
|
static |
Removes the translation file translationFile from the list of translation files used by this application.
(It does not delete the translation file from the file system.)
Definition at line 1892 of file qcoreapplication.cpp.
Referenced by QTranslator::~QTranslator().
Sends event event directly to receiver receiver, using the notify() function.
Returns the value that was returned from the event handler.
The event is not deleted when the event has been sent. The normal approach is to create the event on the stack, for example:
Definition at line 230 of file qcoreapplication.h.
Referenced by QGraphicsScenePrivate::_q_polishItems(), QEventDispatcherWin32Private::activateEventNotifier(), QEventDispatcherUNIX::activateSocketNotifiers(), QTimerInfoList::activateTimers(), axc_FilterProc(), QAbstractItemViewPrivate::checkMouseMove(), QGraphicsWidget::close(), QWidgetPrivate::close_helper(), QMdiSubWindow::closeEvent(), QDeclarativeTextEdit::closeSoftwareInputPanel(), QDeclarativeTextInput::closeSoftwareInputPanel(), QGraphicsProxyWidget::contextMenuEvent(), QDialog::contextMenuEvent(), QGraphicsView::contextMenuEvent(), QGestureManager::deliverEvents(), QApplicationPrivate::dispatchEnterLeave(), QShortcutMap::dispatchEvent(), do_size_hints(), QGraphicsProxyWidget::dragEnterEvent(), QGraphicsView::dragEnterEvent(), QOleDropTarget::DragLeave(), QGraphicsProxyWidget::dragLeaveEvent(), QGraphicsView::dragLeaveEvent(), QGraphicsProxyWidget::dragMoveEvent(), QGraphicsView::dragMoveEvent(), QOleDropTarget::DragOver(), QOleDropTarget::Drop(), QGraphicsProxyWidget::dropEvent(), QGraphicsView::dropEvent(), effectiveState(), QWidget::ensurePolished(), QWorkspaceTitleBar::enterEvent(), QApplicationPrivate::enterModal(), QGraphicsProxyWidget::event(), QEventDispatcherWin32::event(), QMenuBar::event(), QMdiArea::event(), QSystemTrayIconSys::event(), QGraphicsView::event(), QApplication::event(), QWidget::event(), QCompleter::eventFilter(), QWhatsThisPrivate::eventFilter(), QGraphicsView::focusInEvent(), QGraphicsView::focusOutEvent(), QApplicationPrivate::globalEventProcessor(), handle_xdnd_position(), QWidgetPrivate::handleSoftwareInputPanel(), QWidgetPrivate::hide_helper(), QWidgetPrivate::hideChildren(), QWidgetPrivate::init(), QGraphicsView::inputMethodEvent(), QGraphicsWidget::insertAction(), QWidget::insertAction(), installTranslator(), QAxServerBase::internalCreate(), QGraphicsWidget::itemChange(), QMenu::keyPressEvent(), QGraphicsView::keyPressEvent(), QGraphicsView::keyReleaseEvent(), QApplicationPrivate::leaveModal(), QWidget::lower(), QX11Data::motifdndHandle(), QGraphicsView::mouseDoubleClickEvent(), QMenuPrivate::mouseEventTaken(), QGraphicsViewPrivate::mouseMoveEventHandler(), QGraphicsView::mousePressEvent(), QWhatsThat::mouseReleaseEvent(), QGraphicsView::mouseReleaseEvent(), QObjectPrivate::moveToThread_helper(), QApplication::notify(), QWhatsThisPrivate::notifyToplevels(), QAbstractItemViewPrivate::openEditor(), QDeclarativeTextEdit::openSoftwareInputPanel(), QDeclarativeTextInput::openSoftwareInputPanel(), QWidget::overrideWindowState(), QWidgetPrivate::propagatePaletteChange(), qstring_to_xtp(), qt_grab_cursor(), qt_internal_proc(), qt_mac_mouse_inside_answer_rect(), qt_mac_send_posted_gl_updates(), qt_mac_socket_callback(), QAxClientSite::qt_metacall(), qt_tablet_cleanup_wce(), qt_try_modal(), qt_x11_recreateWidget(), QtWndProc(), QWhatsThisPrivate::QWhatsThisPrivate(), QApplication::qwsProcessEvent(), QWidget::raise(), QGraphicsWidget::removeAction(), QWidget::removeAction(), QGraphicsProxyWidgetPrivate::removeSubFocusHelper(), removeTranslator(), QETWidget::repolishStyle(), QWidget::resetInputContext(), QWidgetPrivate::scroll_sys(), QWidgetPrivate::scrollChildren(), QActionPrivate::sendDataChanged(), QOleDropTarget::sendDragEnterEvent(), QInputContext::sendEvent(), QGraphicsScenePrivate::sendEvent(), QDeclarativeFlickable::sendMouseEvent(), QApplicationPrivate::sendMouseEvent(), QWidgetPrivate::sendPendingMoveAndResizeEvents(), QCoreApplicationPrivate::sendPostedEvents(), sendResizeEvents(), QEventDispatcherWin32Private::sendTimerEvent(), sendUpdateRequest(), QGraphicsProxyWidgetPrivate::sendWidgetKeyEvent(), QGraphicsScenePrivate::setActivePanelHelper(), QWidget::setAttribute(), QGraphicsWidget::setContentsMargins(), QWidget::setContentsMargins(), QMenuBarPrivate::setCurrentAction(), QWidget::setCursor(), QWidgetPrivate::setEnabled_helper(), QGraphicsScene::setFocus(), QWidget::setFocus(), QApplicationPrivate::setFocusWidget(), QApplication::setFont(), QGraphicsWidget::setGeometry(), QWidgetPrivate::setGeometry_sys(), QApplication::setLayoutDirection(), QGraphicsWidgetPrivate::setLayoutDirection_helper(), QWidgetPrivate::setLayoutDirection_helper(), QWidgetPrivate::setLocale_helper(), QWidgetPrivate::setModal_sys(), QApplicationPrivate::setPalette_helper(), QWidget::setParent(), QObjectPrivate::setParent_helper(), QObject::setProperty(), QGraphicsView::setScene(), QGraphicsWidget::setStyle(), QApplication::setStyle(), QGraphicsScene::setStyle(), QWidgetPrivate::setStyle_helper(), QWidget::setToolTip(), QDialog::setVisible(), QWidget::setVisible(), QApplication::setWindowIcon(), QWidgetPrivate::setWindowIcon_helper(), QWidget::setWindowIconText(), QWidget::setWindowModified(), QWidget::setWindowState(), QWidget::setWindowTitle(), QWidgetPrivate::setWinId(), QWidgetPrivate::show_helper(), QMdiSubWindowPrivate::showButtonsInMenuBar(), QActionPrivate::showStatusText(), sm_dieCallback(), socketNotifierSourceDispatch(), QWidget::stackUnder(), QAccessibleHeader::text(), QAxServerBase::TranslateAcceleratorW(), QETWidget::translateConfigEvent(), QShortcutMap::tryShortcutEvent(), QWidget::unsetCursor(), update_toolbar_style(), QGraphicsWidgetPrivate::updateFont(), QGraphicsScenePrivate::updateFont(), QWidgetPrivate::updateFont(), QMenuBarPrivate::updateGeometries(), QGraphicsWidgetPrivate::updatePalette(), QGraphicsScenePrivate::updatePalette(), QStyleSheetStyle::updateStyleSheetFont(), QGtkStyleUpdateScheduler::updateTheme(), updateWidgets(), QHeaderView::viewportEvent(), QGraphicsView::viewportEvent(), QAbstractItemView::viewportEvent(), QAbstractScrollArea::wheelEvent(), QSystemTrayIconSys::wheelEvent(), QGraphicsView::wheelEvent(), QX11EmbedWidget::x11Event(), QApplication::x11ProcessEvent(), QX11Data::xdndHandleDrop(), QX11Data::xdndHandleLeave(), QApplication::~QApplication(), QObjectPrivate::~QObjectPrivate(), and QWidget::~QWidget().
|
static |
Immediately dispatches all events which have been previously queued with QCoreApplication::postEvent() and which are for the object receiver and have the event type event_type.
Events from the window system are not dispatched by this function, but by processEvents().
If receiver is null, the events of event_type are sent for all objects. If event_type is 0, all the events are sent for receiver.
Definition at line 1481 of file qcoreapplication.cpp.
|
inlinestatic |
Definition at line 236 of file qcoreapplication.h.
Referenced by Maemo::IcdPrivate::addrinfo(), QAbstractItemView::closeEditor(), QAxWidget::createHostWindow(), QGraphicsViewPrivate::dispatchPendingUpdateRequests(), QWidget::event(), exec(), QThreadPrivate::finish(), postEventSourceDispatch(), QEventDispatcherQPA::processEvents(), QEventDispatcherQWS::processEvents(), QEventDispatcherX11::processEvents(), QEventLoop::processEvents(), processEvents(), qFadeEffect(), qScrollEffect(), qt_mac_mouse_inside_answer_rect(), qt_x11_wait_for_window_manager(), sendWindowSystemEvents(), QWidget::setVisible(), QWidgetPrivate::show_helper(), QWidgetPrivate::show_recursive(), QWidget::showFullScreen(), QWidget::showMaximized(), QWidget::showMinimized(), QWidget::showNormal(), Maemo::IcdPrivate::state(), and QDBusPendingCallWatcher::waitForFinished().
|
inlinestaticprivate |
Definition at line 233 of file qcoreapplication.h.
Referenced by QApplicationPrivate::canQuit(), QWidgetPrivate::close_helper(), QWidgetPrivate::drawWidget(), QApplicationPrivate::globalAppleEventProcessor(), QApplicationPrivate::globalEventProcessor(), QWidgetPrivate::hideChildren(), make_widget_eventUPP(), make_win_eventUPP(), qt_cleanup(), qt_sendSpontaneousEvent(), QApplication::qwsProcessEvent(), QApplicationPrivate::sendMouseEvent(), QETWidget::sendSpontaneousEvent(), QApplication::setActiveWindow(), QAxServerBase::SetColorScheme(), QWidgetPrivate::showChildren(), QETWidget::translateConfigEvent(), QETWidget::translateKeyEvent(), QETWidget::translateMouseEvent(), QETWidget::translatePropertyEvent(), QETWidget::translateTabletEvent(), QETWidget::translateWheelEvent(), QETWidget::translateXinputEvent(), and QApplication::x11ProcessEvent().
|
static |
Definition at line 2468 of file qcoreapplication.cpp.
|
static |
Definition at line 2499 of file qcoreapplication.cpp.
|
static |
Sets the attribute attribute if on is true; otherwise clears the attribute.
One of the attributes that can be set with this method is Qt::AA_ImmediateWidgetCreation. It tells Qt to create toplevel windows immediately. Normally, resources for widgets are allocated on demand to improve efficiency and minimize resource usage. Therefore, if it is important to minimize resource consumption, do not set this attribute.
Definition at line 888 of file qcoreapplication.cpp.
Referenced by QMenuBarPrivate::init(), QMenuBarPrivate::macCreateMenuBar(), qt_mac_set_menubar_icons(), and qt_mac_set_native_menubar().
QCoreApplication::EventFilter QCoreApplication::setEventFilter | ( | QCoreApplication::EventFilter | filter | ) |
Replaces the event filter function for the QCoreApplication with filter and returns the pointer to the replaced event filter function.
Only the current event filter function is called. If you want to use both filter functions, save the replaced EventFilter in a place where yours can call it.
The event filter function set here is called for all messages received by all threads meant for all Qt objects. It is not called for messages that are not meant for Qt objects.
The event filter function should return true if the message should be filtered, (i.e. stopped). It should return false to allow processing the message to continue.
By default, no event filter function is set (i.e., this function returns a null EventFilter the first time it is called).
Definition at line 2772 of file qcoreapplication.cpp.
Referenced by QX11EmbedContainer::QX11EmbedContainer().
|
static |
Sets the list of directories to search when loading libraries to paths.
All existing paths will be deleted and the path list will consist of the paths given in paths.
In Symbian this function is only useful for setting paths for finding Qt extension plugin stubs, since the OS can only load libraries from the /sys/bin
directory.
Definition at line 2623 of file qcoreapplication.cpp.
|
static |
Definition at line 2442 of file qcoreapplication.cpp.
|
static |
Definition at line 2411 of file qcoreapplication.cpp.
|
static |
Returns true if an application object has not been created yet; otherwise returns false.
Definition at line 1096 of file qcoreapplication.cpp.
Referenced by QCursor::QCursor(), qt_cleanup(), qt_mac_update_os_settings(), QtWndProc(), and QApplicationPrivate::x11_apply_settings().
|
static |
Returns true if attribute attribute is set; otherwise returns false.
Definition at line 916 of file qcoreapplication.cpp.
Referenced by QApplicationPrivate::globalEventProcessor(), QAction::isIconVisibleInMenu(), QMenuBar::isNativeMenuBar(), QMenuBarPrivate::macCreateMenuBar(), QWidget::previousInFocusChain(), QFontEngineX11FT::QFontEngineX11FT(), qt_init(), qt_mac_clear_menubar(), qt_painter_thread_test(), qt_pixmap_thread_test(), and setAttribute().
|
static |
Definition at line 1908 of file qcoreapplication.cpp.
Referenced by QNetworkReplyImplPrivate::_q_networkSessionFailed(), QPrintPreviewDialogPrivate::_q_print(), QNetworkReplyImplPrivate::_q_startOperation(), QOCIDriver::beginTransaction(), QOCIDriver::commitTransaction(), QAxServerBase::createMenu(), QHttpNetworkConnectionPrivate::errorDetail(), QMessageBox::event(), QDB2Result::exec(), QOCIResult::exec(), QSQLiteResult::exec(), QSymSQLResult::exec(), QODBCResult::exec(), QOCICols::execBatch(), QDB2Result::fetch(), QMYSQLResult::fetch(), QODBCResult::fetch(), QDB2Result::fetchFirst(), QODBCResult::fetchFirst(), QODBCResult::fetchLast(), QDB2Result::fetchNext(), QMYSQLResult::fetchNext(), QODBCResult::fetchNext(), QSQLiteResultPrivate::fetchNext(), QSymSQLResultPrivate::fetchNext(), QODBCResult::fetchPrevious(), QSQLite2ResultPrivate::finalize(), QHostInfoAgent::fromName(), fromScriptValue(), QScript::functionQsTr(), QScript::functionQsTranslate(), getFontWeight(), QOCIResult::gotoNext(), QScriptDebuggerStackModel::headerData(), QScriptDebuggerLocalsModel::headerData(), QScriptBreakpointsModel::headerData(), QPPDOptionsModel::headerData(), QMessageBoxPrivate::hideSpecial(), QDirModel::index(), QPrintPreviewDialogPrivate::init(), QSymSQLResultPrivate::initColumns(), QIBaseDriverPrivate::isError(), QIBaseResultPrivate::isError(), QtFontStyle::Key::Key(), QDeclarativeJS::Lexer::lex(), QNetworkAccessFileBackend::loadFileInfo(), QHostInfo::lookupHost(), QDB2Result::nextResult(), QMYSQLResult::nextResult(), QODBCResult::nextResult(), QNetworkAccessCacheBackend::open(), QNetworkAccessFileBackend::open(), QDB2Result::prepare(), QOCIResult::prepare(), QSQLiteResult::prepare(), QSymSQLResult::prepare(), QPSQLResult::prepare(), QODBCResult::prepare(), QPSQLResultPrivate::processResults(), QAbstractPageSetupDialog::QAbstractPageSetupDialog(), QAbstractPrintDialog::QAbstractPrintDialog(), QDisabledNetworkReply::QDisabledNetworkReply(), QNetworkReplyDataImpl::QNetworkReplyDataImpl(), QNetworkReplyFileImpl::QNetworkReplyFileImpl(), qtTrId(), QNetworkAccessFileBackend::readMoreFromFile(), QDB2Result::reset(), QSQLite2Result::reset(), QMYSQLResult::reset(), QODBCResult::reset(), QOCIDriver::rollbackTransaction(), QDeclarativeVME::run(), QDeclarativeCompiledBindingsPrivate::run(), QDeclarativeJS::Lexer::scanRegExp(), sendPostedEvents(), QSystemSemaphorePrivate::setErrorString(), QDeclarativeXmlListModel::setQuery(), QPrintPreviewDialogPrivate::setupActions(), styleStringHelper(), QMetaObject::tr(), QMetaObject::trUtf8(), QFileIconProvider::type(), QMenuBarPrivate::updateCornerWidgetToolBar(), QNetworkAccessFileBackend::uploadReadyReadSlot(), QMYSQLResult::virtual_hook(), and QFontDatabase::writingSystemName().
|
static |
Returns the translation text for sourceText, by querying the installed translation files.
The translation files are searched from the most recently installed file back to the first installed file.
QObject::tr() and QObject::trUtf8() provide this functionality more conveniently.
context is typically a class name (e.g., "MyDialog") and sourceText is either English text or a short identifying text.
disambiguation is an identifying string, for when the same sourceText is used in different roles within the same context. By default, it is null.
See the QTranslator and QObject::tr() documentation for more information about contexts, disambiguations and comments.
encoding indicates the 8-bit encoding of character strings.
n is used in conjunction with n
to support plural forms. See QObject::tr() for details.
If none of the translation files contain a translation for sourceText in context, this function returns a QString equivalent of sourceText. The encoding of sourceText is specified by encoding; it defaults to CodecForTr.
This function is not virtual. You can use alternative translation techniques by subclassing QTranslator .
Definition at line 1986 of file qcoreapplication.cpp.
|
signal |
This signal is emitted whenever a Unix signal is received by the application.
The Unix signal received is specified by its number.
Referenced by QEventDispatcherUNIXPrivate::doSelect().
|
static |
Definition at line 975 of file qeventdispatcher_unix.cpp.
Referenced by QWSTtyKbPrivate::QWSTtyKbPrivate().
|
virtual |
The message procedure calls this function for every message received.
Reimplement this function if you want to process window messages msg that are not processed by Qt. If you don't want the event to be processed by Qt, then return true and set result to the value that the window procedure should return. Otherwise return false.
It is only directly addressed messages that are filtered. To handle system wide messages, such as messages from a registered hot key, you need to install an event filter on the event dispatcher, which is returned from QAbstractEventDispatcher::instance().
Definition at line 214 of file qcoreapplication_win.cpp.
Referenced by filterEvent().
|
friend |
Definition at line 221 of file qcoreapplication.h.
|
related |
Adds a global routine that will be called from the QApplication destructor.
This function is normally used to add cleanup routines for program-wide functionality.
The function specified by ptr should take no arguments and should return nothing. For example:
Note that for an application- or module-wide cleanup, qAddPostRoutine() is often not suitable. For example, if the program is split into dynamically loaded modules, the relevant module may be unloaded long before the QApplication destructor is called.
For modules and libraries, using a reference-counted initialization manager or Qt's parent-child deletion mechanism may be better. Here is an example of a private class that uses the parent-child mechanism to call a cleanup function at the right time:
By selecting the right parent object, this can often be made to clean up the module's data at the right moment.
Definition at line 273 of file qcoreapplication.cpp.
Referenced by qt_mac_create_menu_event_handler(), qt_mac_updateScrap(), qt_tablet_init(), qt_tablet_init_wce(), and setupOwner().
|
friend |
Definition at line 218 of file qcoreapplication.h.
Referenced by QApplication::isLeftToRight().
|
friend |
Definition at line 219 of file qcoreapplication.h.
Referenced by QApplication::QApplication().
|
friend |
Definition at line 575 of file qcoreapplication.cpp.
|
friend |
Definition at line 227 of file qcoreapplication.h.
Definition at line 220 of file qcoreapplication.h.
|
friend |
Definition at line 217 of file qcoreapplication.h.
|
friend |
Definition at line 222 of file qcoreapplication.h.
Definition at line 5779 of file qapplication.cpp.
Definition at line 223 of file qcoreapplication.h.
|
friend |
Definition at line 224 of file qcoreapplication.h.
|
related |
Removes all events of the given eventType that were posted using postEvent() for receiver.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
The events are not dispatched, instead they are removed from the queue. You should never need to call this function. If you do call it, be aware that killing events may cause receiver to break one or more invariants.
If receiver is null, the events of eventType are removed for all objects. If eventType is 0, all the events are removed for receiver.
Referenced by QFutureWatcherBasePrivate::callOutInterfaceDisconnected(), QEventLoop::exec(), removePostedEvents(), QWidget::setVisible(), QDeclarativeTimer::update(), QMessageBoxPrivate::updateSize(), QObjectPrivate::~QObjectPrivate(), and QWidget::~QWidget().
|
private |
the name of this application
The value is used by the QSettings class when it is constructed using the empty constructor. This saves having to repeat this information each time a QSettings object is created.
On BlackBerry this property is read-only. It is obtained from the BAR application descriptor file.
Definition at line 74 of file qcoreapplication.h.
|
private |
the version of this application
On BlackBerry this property is read-only. It is obtained from the BAR application descriptor file.
Definition at line 75 of file qcoreapplication.h.
|
private |
the Internet domain of the organization that wrote this application
The value is used by the QSettings class when it is constructed using the empty constructor. This saves having to repeat this information each time a QSettings object is created.
On Mac, QSettings uses organizationDomain() as the organization if it's not an empty string; otherwise it uses organizationName(). On all other platforms, QSettings uses organizationName() as the organization.
Definition at line 77 of file qcoreapplication.h.
Referenced by qDBusGenerateMetaObjectXml(), and qDBusInterfaceFromMetaObject().
|
private |
the name of the organization that wrote this application
The value is used by the QSettings class when it is constructed using the empty constructor. This saves having to repeat this information each time a QSettings object is created.
On Mac, QSettings uses organizationDomain() as the organization if it's not an empty string; otherwise it uses organizationName(). On all other platforms, QSettings uses organizationName() as the organization.
On BlackBerry this property is read-only. It is obtained from the BAR application descriptor file.
Definition at line 76 of file qcoreapplication.h.
|
staticprivate |
Definition at line 213 of file qcoreapplication.h.
Referenced by arguments(), QCoreApplicationPrivate::checkInstance(), exec(), flush(), hasPendingEvents(), qt_set_current_thread_to_main_thread(), QApplicationPrivate::reset_instance_pointer(), setApplicationName(), and translate().