<tdalign="right"valign="center"><imgsrc="logo32.png"align="right"width="64"height="32"border="0"></td></tr></table><h1align=center>TQApplication Class Reference</h1>
<p>The TQApplication class manages the GUI application's control
The TQApplication class manages the GUI application's control
flow and main settings.
<p>
<p> It contains the main event loop, where all events from the window
system and other sources are processed and dispatched. It also
handles the application's initialization and finalization, and
provides session management. It also handles most system-wide and
application-wide settings.
<p> For any GUI application that uses TQt, there is precisely one
TQApplication object, no matter whether the application has 0, 1, 2
or more windows at any time.
<p> The TQApplication object is accessible through the global pointer <tt>qApp</tt>. Its main areas of responsibility are:
<ul>
<p><li> It initializes the application with the user's desktop settings
such as <ahref="#palette">palette</a>(), <ahref="#font">font</a>() and <ahref="#doubleClickInterval">doubleClickInterval</a>(). It keeps track
of these properties in case the user changes the desktop globally, for
example through some kind of control panel.
<p><li> It performs event handling, meaning that it receives events
from the underlying window system and dispatches them to the relevant
widgets. By using <ahref="#sendEvent">sendEvent</a>() and <ahref="#postEvent">postEvent</a>() you can send your own
events to widgets.
<p><li> It parses common command line arguments and sets its internal
state accordingly. See the <ahref="#TQApplication">constructor documentation</a> below for more details about this.
<p><li> It defines the application's look and feel, which is
encapsulated in a <ahref="qstyle.html">TQStyle</a> object. This can be changed at runtime
with <ahref="#setStyle">setStyle</a>().
<p><li> It specifies how the application is to allocate colors.
See <ahref="#setColorSpec">setColorSpec</a>() for details.
<p><li> It provides <ahref="i18n.html#localization">localization</a> of strings that are visible to the user
via <ahref="#translate">translate</a>().
<p><li> It provides some magical objects like the <ahref="#desktop">desktop</a>() and the
<ahref="#clipboard">clipboard</a>().
<p><li> It knows about the application's windows. You can ask which
widget is at a certain position using <ahref="#widgetAt">widgetAt</a>(), get a list of
<ahref="#topLevelWidgets">topLevelWidgets</a>() and <ahref="#closeAllWindows">closeAllWindows</a>(), etc.
<p><li> It manages the application's mouse cursor handling,
see <ahref="#setOverrideCursor">setOverrideCursor</a>() and <ahref="#setGlobalMouseTracking">setGlobalMouseTracking</a>().
<p><li> On the X window system, it provides functions to flush and sync
the communication stream, see <ahref="#flushX">flushX</a>() and <ahref="#syncX">syncX</a>().
<p><li> It provides support for sophisticated <ahref="session.html">session management</a>. This makes it possible
for applications to terminate gracefully when the user logs out, to
cancel a shutdown process if termination isn't possible and even to
preserve the entire application's state for a future session. See
<ahref="#isSessionRestored">isSessionRestored</a>(), <ahref="#sessionId">sessionId</a>() and <ahref="#commitData">commitData</a>() and <ahref="#saveState">saveState</a>()
for details.
<p></ul>
<p> The <ahref="simple-application.html">Application walk-through
example</a> contains a typical complete main() that does the usual
things with TQApplication.
<p> Since the TQApplication object does so much initialization, it
<b>must</b> be created before any other objects related to the user
interface are created.
<p> Since it also deals with common command line arguments, it is
usually a good idea to create it <em>before</em> any interpretation or
modification of <tt>argv</tt> is done in the application itself. (Note
also that for X11, <ahref="#setMainWidget">setMainWidget</a>() may change the main widget
according to the <tt>-geometry</tt> option. To preserve this
functionality, you must set your defaults before setMainWidget() and
<p> This enum type defines the 8-bit encoding of character string
arguments to <ahref="#translate">translate</a>():
<ul>
<li><tt>TQApplication::DefaultCodec</tt> - the encoding specified by
<ahref="qtextcodec.html#codecForTr">TQTextCodec::codecForTr</a>() (Latin-1 if none has been set)
<li><tt>TQApplication::UnicodeUTF8</tt> - UTF-8
</ul><p><p>See also <ahref="qobject.html#tr">TQObject::tr</a>(), <ahref="qobject.html#trUtf8">TQObject::trUtf8</a>(), and <ahref="qstring.html#fromUtf8">TQString::fromUtf8</a>().
Create an application, given an already open display <em>dpy</em>. If <em>visual</em> and <em>colormap</em> are non-zero, the application will use those as
the default Visual and Colormap contexts.
<p><b>Warning:</b> TQt only supports TrueColor visuals at depths higher than 8
<p> A popup widget is a special top level widget that sets the <ahref="qt.html#WidgetFlags-enum">WType_Popup</a> widget flag, e.g. the <ahref="qpopupmenu.html">TQPopupMenu</a> widget. When the
application opens a popup widget, all events are sent to the popup.
Normal widgets and modal widgets cannot be accessed before the popup
widget is closed.
<p> Only other popup widgets may be opened when a popup widget is shown.
The popup widgets are organized in a stack. This function returns
the active popup widget at the top of the stack.
<p><p>See also <ahref="#activeModalWidget">activeModalWidget</a>() and <ahref="#topLevelWidgets">topLevelWidgets</a>().
<p> Returns the application top-level window that has the keyboard input
focus, or 0 if no application window has the focus. Note that
there might be an <ahref="#activeWindow">activeWindow</a>() even if there is no <ahref="#focusWidget">focusWidget</a>(),
for example if no widget in that window accepts key events.
<p><p>See also <ahref="qwidget.html#setFocus">TQWidget::setFocus</a>(), <ahref="qwidget.html#focus-prop">TQWidget::focus</a>, and <ahref="#focusWidget">focusWidget</a>().
Append <em>path</em> to the end of the library path list. If <em>path</em> is
empty or already in the path list, the path list is not changed.
<p> The default path list consists of a single entry, the installation
directory for plugins. The default installation directory for plugins
is <tt>INSTALL/plugins</tt>, where <tt>INSTALL</tt> is the directory where TQt was
installed.
<p><p>See also <ahref="#removeLibraryPath">removeLibraryPath</a>(), <ahref="#libraryPaths">libraryPaths</a>(), and <ahref="#setLibraryPaths">setLibraryPaths</a>().
TQWidgetListIt it( *list ); // iterate over the widgets
<ahref="qwidget.html">TQWidget</a> * w;
while ( (w=it.current()) != 0 ) { // for each widget...
++it;
w-><ahref="qwidget.html#update">update</a>();
}
delete list; // delete the list, not the widgets
</pre>
<p> The TQWidgetList class is defined in the <tt>qwidgetlist.h</tt> header
file.
<p><b>Warning:</b> Delete the list as soon as you have finished using it.
The widgets in the list may be deleted by someone else at any time.
<p><p>See also <ahref="#topLevelWidgets">topLevelWidgets</a>(), <ahref="qwidget.html#visible-prop">TQWidget::visible</a>, and <ahref="qptrlist.html#isEmpty">TQPtrList::isEmpty</a>().
Returns a pointer to the application global clipboard.
<p>Examples: <ahref="regexptester-example.html#x2468">regexptester/regexptester.cpp</a> and <ahref="showimg-example.html#x1308">showimg/showimg.cpp</a>.
<p><p>See also <ahref="qwidget.html#close">TQWidget::close</a>(), <ahref="qwidget.html#closeEvent">TQWidget::closeEvent</a>(), <ahref="#lastWindowClosed">lastWindowClosed</a>(), <ahref="#quit">quit</a>(), <ahref="#topLevelWidgets">topLevelWidgets</a>(), and <ahref="qwidget.html#isTopLevel-prop">TQWidget::isTopLevel</a>.
<p> This function deals with <ahref="session.html">session
management</a>. It is invoked when the <ahref="qsessionmanager.html">TQSessionManager</a> wants the
application to commit all its data.
<p> Usually this means saving all open files, after getting
permission from the user. Furthermore you may want to provide a means
by which the user can cancel the shutdown.
<p> Note that you should not exit the application within this function.
Instead, the session manager may or may not do this afterwards,
depending on the context.
<p><b>Warning:</b> Within this function, no user interaction is possible, <em>unless</em> you ask the session manager <em>sm</em> for explicit permission.
See <ahref="qsessionmanager.html#allowsInteraction">TQSessionManager::allowsInteraction</a>() and
<ahref="qsessionmanager.html#allowsErrorInteraction">TQSessionManager::allowsErrorInteraction</a>() for details and example
usage.
<p> The default implementation requests interaction and sends a close
event to all visible top level widgets. If any event was
rejected, the shutdown is canceled.
<p><p>See also <ahref="#isSessionRestored">isSessionRestored</a>(), <ahref="#sessionId">sessionId</a>(), <ahref="#saveState">saveState</a>(), and <ahref="session.html">the Session Management overview</a>.
<p><p>See also <ahref="#quit">quit</a>(), <ahref="#exit">exit</a>(), <ahref="#processEvents">processEvents</a>(), and <ahref="#setMainWidget">setMainWidget</a>().
<p>Examples: <ahref="canvas-chart-example.html#x2875">chart/chartform.cpp</a>, <ahref="extension-dialog-example.html#x2865">extension/mainform.ui.h</a>, and <ahref="picture-example.html#x106">picture/picture.cpp</a>.
<p> 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 MacOS X, and you want to
visualize these changes immediately (e.g. Splash Screens), call
this function.
<p><p>See also <ahref="#flushX">flushX</a>(), <ahref="#sendPostedEvents">sendPostedEvents</a>(), and <ahref="qpainter.html#flush">TQPainter::flush</a>().
<p> Returns the application widget that has the keyboard input focus, or
0 if no widget in this application has the focus.
<p><p>See also <ahref="qwidget.html#setFocus">TQWidget::setFocus</a>(), <ahref="qwidget.html#focus-prop">TQWidget::focus</a>, and <ahref="#activeWindow">activeWindow</a>().
Returns the default font for the widget <em>w</em>, or the default
application font if <em>w</em> is 0.
<p><p>See also <ahref="#setFont">setFont</a>(), <ahref="#fontMetrics">fontMetrics</a>(), and <ahref="qwidget.html#font-prop">TQWidget::font</a>.
<p>Examples: <ahref="qfd-example.html#x1979">qfd/fontdisplayer.cpp</a>, <ahref="themes-example.html#x264">themes/metal.cpp</a>, and <ahref="themes-example.html#x321">themes/themes.cpp</a>.
Returns display (screen) font metrics for the application font.
<p><p>See also <ahref="#font">font</a>(), <ahref="#setFont">setFont</a>(), <ahref="qwidget.html#fontMetrics">TQWidget::fontMetrics</a>(), and <ahref="qpainter.html#fontMetrics">TQPainter::fontMetrics</a>().
Adds the message file <em>mf</em> to the list of message files to be used
for translations.
<p> Multiple message files can be installed. Translations are searched
for in the last installed message file, then the one from last, and
so on, back to the first installed message file. The search stops as
soon as a matching translation is found.
<p><p>See also <ahref="#removeTranslator">removeTranslator</a>(), <ahref="#translate">translate</a>(), and <ahref="qtranslator.html#load">TQTranslator::load</a>().
<p> For convenience, this signal is <em>not</em> emitted for transient top level
widgets such as popup menus and dialogs.
<p><p>See also <ahref="#mainWidget">mainWidget</a>(), <ahref="#topLevelWidgets">topLevelWidgets</a>(), <ahref="qwidget.html#isTopLevel-prop">TQWidget::isTopLevel</a>, and <ahref="qwidget.html#close">TQWidget::close</a>().
<p>Examples: <ahref="addressbook-example.html#x608">addressbook/main.cpp</a>, <ahref="extension-dialog-example.html#x2867">extension/main.cpp</a>, <ahref="helpviewer-example.html#x1039">helpviewer/main.cpp</a>, <ahref="mdi-example.html#x2096">mdi/main.cpp</a>, <ahref="archivesearch-example.html#x487">network/archivesearch/main.cpp</a>, <ahref="qwerty-example.html#x416">qwerty/main.cpp</a>, and <ahref="regexptester-example.html#x2509">regexptester/main.cpp</a>.
Returns a list of paths that the application will search when
dynamically loading libraries.
The installation directory for plugins is the only entry if no
paths have been set. The default installation directory for plugins
is <tt>INSTALL/plugins</tt>, where <tt>INSTALL</tt> is the directory where TQt was
installed. The directory of the application executable (NOT the
working directory) is also added to the plugin paths.
<p> If you want to iterate over the list, you should iterate over a
copy, e.g.
<pre>
<ahref="qstringlist.html">TQStringList</a> list = app.libraryPaths();
TQStringList::Iterator it = list.<ahref="qvaluelist.html#begin">begin</a>();
while( it != list.<ahref="qvaluelist.html#end">end</a>() ) {
myProcessing( *it );
++it;
}
</pre>
<p> See the <ahref="plugins-howto.html">plugins documentation</a> for a
description of how the library paths are used.
<p><p>See also <ahref="#setLibraryPaths">setLibraryPaths</a>(), <ahref="#addLibraryPath">addLibraryPath</a>(), <ahref="#removeLibraryPath">removeLibraryPath</a>(), and <ahref="qlibrary.html">TQLibrary</a>.
<p> If a widget is passed in <em>w</em>, the default palette for the
widget's class is returned. This may or may not be the application
palette. In most cases there isn't a special palette for certain
types of widgets, but one notable exception is the popup menu under
Windows, if the user has defined a special background color for
menus in the display settings.
<p><p>See also <ahref="#setPalette">setPalette</a>() and <ahref="qwidget.html#palette-prop">TQWidget::palette</a>.
<p>Examples: <ahref="desktop-example.html#x1723">desktop/desktop.cpp</a>, <ahref="themes-example.html#x265">themes/metal.cpp</a>, and <ahref="themes-example.html#x186">themes/wood.cpp</a>.
Initialization of the appearance of the widget <em>w</em><em>before</em> it is first
shown.
<p> Usually widgets call this automatically when they are polished. It
may be used to do some style-based central customization of widgets.
<p> Note that you are not limited to the public functions of <ahref="qwidget.html">TQWidget</a>.
Instead, based on meta information like <ahref="qobject.html#className">TQObject::className</a>() you are
able to customize any kind of widget.
<p><p>See also <ahref="qstyle.html#polish">TQStyle::polish</a>(), <ahref="qwidget.html#polish">TQWidget::polish</a>(), <ahref="#setPalette">setPalette</a>(), and <ahref="#setFont">setFont</a>().
Processes pending events, for 3 seconds or until there are no more
events to process, whichever is shorter.
<p> You can call this function occasionally when your program is busy
performing a long operation (e.g. copying a file).
<p><p>See also <ahref="#exec">exec</a>(), <ahref="qtimer.html">TQTimer</a>, and <ahref="qeventloop.html#processEvents">TQEventLoop::processEvents</a>().
<p>Examples: <ahref="fileiconview-example.html#x808">fileiconview/qfileiconview.cpp</a> and <ahref="ftpclient-example.html#x778">network/ftpclient/main.cpp</a>.
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
<p> Processes pending events for <em>maxtime</em> milliseconds or until
there are no more events to process, whichever is shorter.
<p> You can call this function occasionally when you program is busy
doing a long operation (e.g. copying a file).
<p><p>See also <ahref="#exec">exec</a>(), <ahref="qtimer.html">TQTimer</a>, and <ahref="qeventloop.html#processEvents">TQEventLoop::processEvents</a>().
<p><p>See also <ahref="#exit">exit</a>(), <ahref="#aboutToQuit">aboutToQuit</a>(), <ahref="#lastWindowClosed">lastWindowClosed</a>(), and <ahref="qaction.html">TQAction</a>.
<p>Examples: <ahref="addressbook-example.html#x609">addressbook/main.cpp</a>, <ahref="mdi-example.html#x2097">mdi/main.cpp</a>, <ahref="archivesearch-example.html#x488">network/archivesearch/main.cpp</a>, <ahref="regexptester-example.html#x2510">regexptester/main.cpp</a>, <ahref="tutorial1-02.html#x2288">t2/main.cpp</a>, <ahref="tutorial1-04.html#x2304">t4/main.cpp</a>, and <ahref="tutorial1-06.html#x2321">t6/main.cpp</a>.
Removes <em>path</em> from the library path list. If <em>path</em> is empty or not
in the path list, the list is not changed.
<p><p>See also <ahref="#addLibraryPath">addLibraryPath</a>(), <ahref="#libraryPaths">libraryPaths</a>(), and <ahref="#setLibraryPaths">setLibraryPaths</a>().
Removes the message file <em>mf</em> from the list of message files used by
this application. (It does not delete the message file from the file
system.)
<p><p>See also <ahref="#installTranslator">installTranslator</a>(), <ahref="#translate">translate</a>(), and <ahref="qobject.html#tr">TQObject::tr</a>().
<p> This function deals with <ahref="session.html">session
management</a>. It is invoked when the
<ahref="qsessionmanager.html">session manager</a> wants the application
to preserve its state for a future session.
<p> For example, a text editor would create a temporary file that
includes the current contents of its edit buffers, the location of
the cursor and other aspects of the current editing session.
<p> Note that you should never exit the application within this
function. Instead, the session manager may or may not do this
afterwards, depending on the context. Futhermore, most session
managers will very likely request a saved state immediately after
the application has been started. This permits the session manager
to learn about the application's restart policy.
<p><b>Warning:</b> Within this function, no user interaction is possible, <em>unless</em> you ask the session manager <em>sm</em> for explicit permission.
See <ahref="qsessionmanager.html#allowsInteraction">TQSessionManager::allowsInteraction</a>() and
<ahref="qsessionmanager.html#allowsErrorInteraction">TQSessionManager::allowsErrorInteraction</a>() for details.
<p><p>See also <ahref="#isSessionRestored">isSessionRestored</a>(), <ahref="#sessionId">sessionId</a>(), <ahref="#commitData">commitData</a>(), and <ahref="session.html">the Session Management overview</a>.
<p> Returns the current <ahref="session.html">session's</a> identifier.
<p> If the application has been restored from an earlier session, this
identifier is the same as it was in that previous session.
<p> The session identifier is guaranteed to be unique both for different
applications and for different instances of the same application.
<p><p>See also <ahref="#isSessionRestored">isSessionRestored</a>(), <ahref="#sessionKey">sessionKey</a>(), <ahref="#commitData">commitData</a>(), and <ahref="#saveState">saveState</a>().
<p> Returns the session key in the current <ahref="session.html">session</a>.
<p> If the application has been restored from an earlier session, this
key is the same as it was when the previous session ended.
<p> The session key changes with every call of <ahref="#commitData">commitData</a>() or
<ahref="#saveState">saveState</a>().
<p><p>See also <ahref="#isSessionRestored">isSessionRestored</a>(), <ahref="#sessionId">sessionId</a>(), <ahref="#commitData">commitData</a>(), and <ahref="#saveState">saveState</a>().
<p><ahref="qcolor.html">TQColor</a> provides more functionality for controlling color allocation and
freeing up certain colors. See <ahref="qcolor.html#enterAllocContext">TQColor::enterAllocContext</a>() for more
information.
<p> To check what mode you end up with, call <ahref="qcolor.html#numBitPlanes">TQColor::numBitPlanes</a>() once
the TQApplication object exists. A value greater than 8 (typically
16, 24 or 32) means true color.
<p><sup>*</sup> The color cube used by TQt has 216 colors whose red,
green, and blue components always have one of the following values:
0x00, 0x33, 0x66, 0x99, 0xCC, or 0xFF.
<p><p>See also <ahref="#colorSpec">colorSpec</a>(), <ahref="qcolor.html#numBitPlanes">TQColor::numBitPlanes</a>(), and <ahref="qcolor.html#enterAllocContext">TQColor::enterAllocContext</a>().
<p>Examples: <ahref="helpviewer-example.html#x1041">helpviewer/main.cpp</a>, <ahref="qaxserver-example-opengl.html#x2732">opengl/main.cpp</a>, <ahref="showimg-example.html#x1361">showimg/main.cpp</a>, <ahref="tutorial1-09.html#x2347">t9/main.cpp</a>, <ahref="qaxserver-example-tetrax.html#x2716">tetrax/tetrax.cpp</a>, <ahref="tetrix-example.html#x354">tetrix/tetrix.cpp</a>, and <ahref="themes-example.html#x348">themes/main.cpp</a>.
Enables the UI effect <em>effect</em> if <em>enable</em> is TRUE, otherwise
the effect will not be used.
<p> Note: All effects are disabled on screens running at less than
16-bit color depth.
<p><p>See also <ahref="#isEffectEnabled">isEffectEnabled</a>(), <ahref="qt.html#UIEffect-enum">TQt::UIEffect</a>, and <ahref="#setDesktopSettingsAware">setDesktopSettingsAware</a>().
<p> On application start-up, the default font depends on the window
system. It can vary depending on both the window system version and
the locale. This function lets you override the default font; but
overriding may be a bad idea because, for example, some locales need
extra-large fonts to support their special characters.
<p><p>See also <ahref="#font">font</a>(), <ahref="#fontMetrics">fontMetrics</a>(), and <ahref="qwidget.html#font-prop">TQWidget::font</a>.
<p>Examples: <ahref="desktop-example.html#x1724">desktop/desktop.cpp</a>, <ahref="themes-example.html#x266">themes/metal.cpp</a>, and <ahref="themes-example.html#x323">themes/themes.cpp</a>.
Sets the list of directories to search when loading libraries to <em>paths</em>.
All existing paths will be deleted and the path list will consist of the
paths given in <em>paths</em>.
<p><p>See also <ahref="#libraryPaths">libraryPaths</a>(), <ahref="#addLibraryPath">addLibraryPath</a>(), <ahref="#removeLibraryPath">removeLibraryPath</a>(), and <ahref="qlibrary.html">TQLibrary</a>.
<p><p>See also <ahref="#overrideCursor">overrideCursor</a>(), <ahref="#restoreOverrideCursor">restoreOverrideCursor</a>(), and <ahref="qwidget.html#cursor-prop">TQWidget::cursor</a>.
<p>Examples: <ahref="distributor-example.html#x2653">distributor/distributor.ui.h</a>, <ahref="archivesearch-example.html#x474">network/archivesearch/archivedialog.ui.h</a>, <ahref="ftpclient-example.html#x738">network/ftpclient/ftpmainwindow.ui.h</a>, and <ahref="showimg-example.html#x1312">showimg/showimg.cpp</a>.
<p><p>See also <ahref="qwidget.html#palette-prop">TQWidget::palette</a>, <ahref="#palette">palette</a>(), and <ahref="qstyle.html#polish">TQStyle::polish</a>().
<p>Examples: <ahref="i18n-example.html#x1934">i18n/main.cpp</a>, <ahref="themes-example.html#x267">themes/metal.cpp</a>, <ahref="themes-example.html#x324">themes/themes.cpp</a>, and <ahref="themes-example.html#x187">themes/wood.cpp</a>.
Sets the application's GUI style to <em>style</em>. Ownership of the style
object is transferred to TQApplication, so TQApplication will delete
the style object on application exit or when a new style is set.
<p> Example usage:
<pre>
TQApplication::<ahref="#setStyle">setStyle</a>( new <ahref="qwindowsstyle.html">TQWindowsStyle</a> );
</pre>
<p> When switching application styles, the color palette is set back to
the initial colors or the system defaults. This is necessary since
certain styles have to adapt the color palette to be fully
style-guide compliant.
<p><p>See also <ahref="#style">style</a>(), <ahref="qstyle.html">TQStyle</a>, <ahref="#setPalette">setPalette</a>(), and <ahref="#desktopSettingsAware">desktopSettingsAware</a>().
<p> TQt uses this value internally, e.g. in <ahref="qfiledialog.html">TQFileDialog</a>.
<p> The default value is 4 pixels.
<p><p>See also <ahref="#setStartDragDistance">setStartDragDistance</a>(), <ahref="#startDragTime">startDragTime</a>(), and <ahref="qpoint.html#manhattanLength">TQPoint::manhattanLength</a>().
TQWidgetListIt it( *list ); // iterate over the widgets
<ahref="qwidget.html">TQWidget</a> * w;
while ( (w=it.current()) != 0 ) { // for each top level widget...
++it;
if ( !w-><ahref="qwidget.html#isVisible">isVisible</a>() )
w-><ahref="qwidget.html#show">show</a>();
}
delete list; // delete the list, not the widgets
</pre>
<p><b>Warning:</b> Delete the list as soon you have finished using it.
The widgets in the list may be deleted by someone else at any time.
<p><p>See also <ahref="#allWidgets">allWidgets</a>(), <ahref="qwidget.html#isTopLevel-prop">TQWidget::isTopLevel</a>, <ahref="qwidget.html#visible-prop">TQWidget::visible</a>, and <ahref="qptrlist.html#isEmpty">TQPtrList::isEmpty</a>().
</h3><p><b>Note:</b> This function is <ahref="threads.html#reentrant">reentrant</a> when TQt is built with thread support.</p>
Returns the translation text for <em>sourceText</em>, by querying the
installed messages files. The message files are searched from the most
recently installed message file back to the first installed message
file.
<p><ahref="qobject.html#tr">TQObject::tr</a>() and <ahref="qobject.html#trUtf8">TQObject::trUtf8</a>() provide this functionality more
conveniently.
<p><em>context</em> is typically a class name (e.g., "MyDialog") and
<em>sourceText</em> is either English text or a short identifying text, if
the output text will be very long (as for help texts).
<p><em>comment</em> is a disambiguating comment, for when the same <em>sourceText</em> is used in different roles within the same context. By
default, it is null. <em>encoding</em> indicates the 8-bit encoding of
character stings
<p> See the <ahref="qtranslator.html">TQTranslator</a> documentation for more information about
contexts and comments.
<p> If none of the message files contain a translation for <em>sourceText</em> in <em>context</em>, this function returns a <ahref="qstring.html">TQString</a>
equivalent of <em>sourceText</em>. The encoding of <em>sourceText</em> is
specified by <em>encoding</em>; it defaults to <ahref="#Encoding-enum">DefaultCodec</a>.
<p> This function is not virtual. You can use alternative translation
techniques by subclassing <ahref="qtranslator.html">TQTranslator</a>.
<p><b>Warning:</b> This method is reentrant only if all translators are
installed <em>before</em> calling this method. Installing or removing
translators while performing translations is not supported. Doing
so will most likely result in crashes or other undesirable behavior.
<p><p>See also <ahref="qobject.html#tr">TQObject::tr</a>(), <ahref="#installTranslator">installTranslator</a>(), and <ahref="#defaultCodec">defaultCodec</a>().
Returns a pointer to the widget at global screen position <em>(x, y)</em>, or 0 if there is no TQt widget there.
<p> If <em>child</em> is FALSE and there is a child widget at position <em>(x, y)</em>, the top-level widget containing it is returned. If <em>child</em>
is TRUE the child widget at position <em>(x, y)</em> is returned.
<p> This function is normally rather slow.
<p><p>See also <ahref="qcursor.html#pos">TQCursor::pos</a>(), <ahref="qwidget.html#grabMouse">TQWidget::grabMouse</a>(), and <ahref="qwidget.html#grabKeyboard">TQWidget::grabKeyboard</a>().
<p> Prints a debug message <em>msg</em>, or calls the message handler (if it
has been installed).
<p> This function takes a format string and a list of arguments,
similar to the C printf() function.
<p> Example:
<pre>
<ahref="#qDebug">qDebug</a>( "my window handle = %x", myWidget->id() );
</pre>
<p> Under X11, the text is printed to stderr. Under Windows, the text
is sent to the debugger.
<p><b>Warning:</b> The internal buffer is limited to 8196 bytes (including
the '\0'-terminator).
<p><b>Warning:</b> Passing (const char *)0 as argument to qDebug might lead
to crashes on certain platforms due to the platforms printf implementation.
<p><p>See also <ahref="#qWarning">qWarning</a>(), <ahref="#qFatal">qFatal</a>(), <ahref="#qInstallMsgHandler">qInstallMsgHandler</a>(), and <ahref="debug.html">Debugging</a>.
<p> Prints a fatal error message <em>msg</em> and exits, or calls the
message handler (if it has been installed).
<p> This function takes a format string and a list of arguments,
similar to the C printf() function.
<p> Example:
<pre>
int divide( int a, int b )
{
if ( b == 0 ) // program error
<ahref="#qFatal">qFatal</a>( "divide: cannot divide by zero" );
return a/b;
}
</pre>
<p> Under X11, the text is printed to stderr. Under Windows, the text
is sent to the debugger.
<p><b>Warning:</b> The internal buffer is limited to 8196 bytes (including
the '\0'-terminator).
<p><b>Warning:</b> Passing (const char *)0 as argument to qFatal might lead
to crashes on certain platforms due to the platforms printf implementation.
<p><p>See also <ahref="#qDebug">qDebug</a>(), <ahref="#qWarning">qWarning</a>(), <ahref="#qInstallMsgHandler">qInstallMsgHandler</a>(), and <ahref="debug.html">Debugging</a>.
<p> Prints a warning message <em>msg</em>, or calls the message handler (if
it has been installed).
<p> This function takes a format string and a list of arguments,
similar to the C printf() function.
<p> Example:
<pre>
void f( int c )
{
if ( c > 200 )
<ahref="#qWarning">qWarning</a>( "f: bad argument, c == %d", c );
}
</pre>
<p> Under X11, the text is printed to stderr. Under Windows, the text
is sent to the debugger.
<p><b>Warning:</b> The internal buffer is limited to 8196 bytes (including
the '\0'-terminator).
<p><b>Warning:</b> Passing (const char *)0 as argument to qWarning might lead
to crashes on certain platforms due to the platforms printf implementation.
<p><p>See also <ahref="#qDebug">qDebug</a>(), <ahref="#qFatal">qFatal</a>(), <ahref="#qInstallMsgHandler">qInstallMsgHandler</a>(), and <ahref="debug.html">Debugging</a>.
<!-- eof -->
<hr><p>
This file is part of the <ahref="index.html">TQt toolkit</a>.