1
<?xml version="1.0" encoding="iso-8859-1"?>
3
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
4
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
<!-- /tmp/qt-4.0.0-espenr-1119621036935/qt-x11-opensource-desktop-4.0.0/doc/src/exportedfunctions.qdoc -->
7
<title>Qt 4.0: Special-Purpose Global Functions Exported by Qt</title>
8
<style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }
9
a:link { color: #004faf; text-decoration: none }
10
a:visited { color: #672967; text-decoration: none }
11
td.postheader { font-family: sans-serif }
12
tr.address { font-family: sans-serif }
13
body { background: #ffffff; color: black; }</style>
16
<table border="0" cellpadding="0" cellspacing="0" width="100%">
18
<td align="left" valign="top" width="32"><img src="images/qt-logo.png" align="left" width="32" height="32" border="0" /></td>
19
<td width="1"> </td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a> · <a href="classes.html"><font color="#004faf">All Classes</font></a> · <a href="mainclasses.html"><font color="#004faf">Main Classes</font></a> · <a href="annotated.html"><font color="#004faf">Annotated</font></a> · <a href="groups.html"><font color="#004faf">Grouped Classes</font></a> · <a href="functions.html"><font color="#004faf">Functions</font></a></td>
20
<td align="right" valign="top" width="230"><img src="images/trolltech-logo.png" align="right" width="203" height="32" border="0" /></td></tr></table><h1 align="center">Special-Purpose Global Functions Exported by Qt</h1>
21
<p>Qt provides a few low-level global functions for fine-tuning applications. Most of these perform very specific tasks and are platform-specific. In general, we recommend that you try using Qt's public API before resorting to using any functions mentioned here.</p>
22
<p>These functions are exported by <a href="qtcore.html#qtcore">QtCore</a> and <a href="qtgui.html#qtgui">QtGui</a>, but most of them aren't declared in Qt's header files. To use them in your application, you must declare them before calling them. For example:</p>
23
<pre> #ifdef Q_WS_X11
24
void qt_x11_wait_for_window_manager(QWidget *widget);
27
int main(int argc, char *argv[])
29
QApplication app(argc, argv);
33
qt_x11_wait_for_window_manager(&window);
38
<p>These functions will remain as part of Qt for the lifetime of Qt 4.</p>
40
<ul><li><a href="#void-qt-set-library-config-file-const-qstring-filename">void qt_set_library_config_file(const QString &<i>fileName</i>)</a></li>
41
<li><a href="#void-qt-set-sequence-auto-mnemonic-bool-enable">void qt_set_sequence_auto_mnemonic(bool <i>enable</i>)</a></li>
42
<li><a href="#hdc-qt-win-display-dc">HDC qt_win_display_dc()</a></li>
43
<li><a href="#void-qt-x11-set-fallback-font-family-int-script-const-qstring-family">void qt_x11_set_fallback_font_family(int <i>script</i>, const QString &<i>family</i>)</a></li>
44
<li><a href="#void-qt-x11-wait-for-window-manager-qwidget-widget">void qt_x11_wait_for_window_manager(QWidget *<i>widget</i>)</a></li>
45
<li><a href="#void-qt-mac-secure-keyboard-bool-enable">void qt_mac_secure_keyboard(bool <i>enable</i>)</a></li>
46
<li><a href="#void-qt-mac-set-dock-menu-qmenu-menu">void qt_mac_set_dock_menu(QMenu *<i>menu</i>)</a></li>
47
<li><a href="#void-qt-mac-set-menubar-icons-bool-enable">void qt_mac_set_menubar_icons(bool <i>enable</i>)</a></li>
48
<li><a href="#void-qt-mac-set-menubar-merge-bool-enable">void qt_mac_set_menubar_merge(bool <i>enable</i>)</a></li>
49
<li><a href="#void-qt-mac-set-native-menubar-bool-enable">void qt_mac_set_native_menubar(bool <i>enable</i>)</a></li>
50
<li><a href="#void-qt-mac-set-press-and-hold-context-bool-enable">void qt_mac_set_press_and_hold_context(bool <i>enable</i>)</a></li>
52
<a name="void-qt-set-library-config-file-const-qstring-filename"></a>
53
<h2>void qt_set_library_config_file(const QString &<i>fileName</i>)</h2>
54
<p>Specifies the location of the Qt configuration file. You must call this function before constructing a <a href="qapplication.html">QApplication</a> or <a href="qcoreapplication.html">QCoreApplication</a> object. If no location is specified, Qt automatically finds an appropriate location.</p>
55
<a name="void-qt-set-sequence-auto-mnemonic-bool-enable"></a>
56
<h2>void qt_set_sequence_auto_mnemonic(bool <i>enable</i>)</h2>
57
<p>Specifies whether mnemonics for menu items, labels, etc., should be honored or not. On Windows and <a href="winsystem.html#x11">X11</a>, this feature is on by default; on Mac OS X, it is off. When this feature is off, the <a href="qkeysequence.html#mnemonic">QKeySequence::mnemonic</a>() function always returns an empty string.</p>
58
<a name="hdc-qt-win-display-dc"></a>
59
<h2>HDC qt_win_display_dc()</h2>
60
<p>Returns the Windows device context for the display. Use this at your own risks and perils.</p>
61
<a name="void-qt-x11-set-fallback-font-family-int-script-const-qstring-family"></a>
62
<h2>void qt_x11_set_fallback_font_family(int <i>script</i>, const QString &<i>family</i>)</h2>
63
<p>Sets the font family to be used for a given script as the fallback when the current font doesn't contain a character. The values for the <i>script</i> parameter are defined by the <tt>Script</tt> enum, located in <tt><private/qunicodetable_p.h></tt>.</p>
64
<a name="void-qt-x11-wait-for-window-manager-qwidget-widget"></a>
65
<h2>void qt_x11_wait_for_window_manager(QWidget *<i>widget</i>)</h2>
66
<p>Blocks until the <a href="winsystem.html#x11">X11</a> window manager has shown the widget after a call to <a href="qwidget.html#show">QWidget::show</a>().</p>
67
<a name="void-qt-mac-secure-keyboard-bool-enable"></a>
68
<h2>void qt_mac_secure_keyboard(bool <i>enable</i>)</h2>
69
<p>Turns the Mac OS X secure keyboard feature on or off. <a href="qlineedit.html">QLineEdit</a> uses this when the echo mode is <a href="qlineedit.html#EchoMode-enum">QLineEdit::Password</a> or <a href="qlineedit.html#EchoMode-enum">QLineEdit::NoEcho</a> to guard the editor against keyboard sniffing. If you implement your own password editor, you might want to turn on this feature in your editor's <a href="qwidget.html#focusInEvent">focusInEvent()</a> and turn it off in <a href="qwidget.html#focusOutEvent">focusOutEvent()</a>.</p>
70
<a name="void-qt-mac-set-dock-menu-qmenu-menu"></a>
71
<h2>void qt_mac_set_dock_menu(QMenu *<i>menu</i>)</h2>
72
<p>Sets the menu to display in the Mac OS X Dock for the application. This menu is shown when the user <b>Ctrl</b>-clicks on the application's icon while it is running.</p>
73
<a name="void-qt-mac-set-menubar-icons-bool-enable"></a>
74
<h2>void qt_mac_set_menubar_icons(bool <i>enable</i>)</h2>
75
<p>Specifies whether icons associated to menu items for the application's menu bar should be shown on Mac OS X. By default, icons are shown on Mac OS X just like on the other platforms.</p>
76
<a name="void-qt-mac-set-menubar-merge-bool-enable"></a>
77
<h2>void qt_mac_set_menubar_merge(bool <i>enable</i>)</h2>
78
<p>Specifies whether Qt should attempt to relocate standard menu items (such as <b>Quit</b>, <b>Preferences</b>, and <b>About</b>) to the application menu on Mac OS X. This feature is on by default. See <a href="mac-differences.html">Qt/Mac-Specific Issues</a> for the list of menu items for which this applies.</p>
79
<a name="void-qt-mac-set-native-menubar-bool-enable"></a>
80
<h2>void qt_mac_set_native_menubar(bool <i>enable</i>)</h2>
81
<p>Specifies whether the application should use the native menu bar on Mac OS X or be part of the main window. This feature is on by default.</p>
82
<a name="void-qt-mac-set-press-and-hold-context-bool-enable"></a>
83
<h2>void qt_mac_set_press_and_hold_context(bool <i>enable</i>)</h2>
84
<p>Turns emulation of the right mouse button by clicking and holding the left mouse button on or off. This feature is off by default.</p>
85
<p /><address><hr /><div align="center">
86
<table width="100%" cellspacing="0" border="0"><tr class="address">
87
<td width="30%">Copyright © 2005 <a href="trolltech.html">Trolltech</a></td>
88
<td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td>
89
<td width="30%" align="right"><div align="right">Qt 4.0.0</div></td>
90
</tr></table></div></address></body>