1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118
|
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- exportedfunctions.qdoc -->
<title>Qt 4.8: Platform-Specific Functions</title>
<link rel="stylesheet" type="text/css" href="style/offline.css" />
</head>
<body>
<div class="header" id="qtdocheader">
<div class="content">
<a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a>
</div>
<div class="breadcrumb toolblock">
<ul>
<li class="first"><a href="index.html">Home</a></li>
<!-- Breadcrumbs go here -->
<li>Platform-Specific Functions</li>
</ul>
</div>
</div>
<div class="content mainContent">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#void-qt-set-library-config-file-const-qstring-filename">void qt_set_library_config_file(const QString &<i>fileName</i>)</a></li>
<li class="level1"><a href="#void-qt-set-sequence-auto-mnemonic-bool-enable">void qt_set_sequence_auto_mnemonic(bool <i>enable</i>)</a></li>
<li class="level1"><a href="#void-qt-x11-wait-for-window-manager-qwidget-widget">void qt_x11_wait_for_window_manager(QWidget *<i>widget</i>)</a></li>
<li class="level1"><a href="#void-qt-mac-secure-keyboard-bool-enable">void qt_mac_secure_keyboard(bool <i>enable</i>)</a></li>
<li class="level1"><a href="#void-qt-mac-set-dock-menu-qmenu-menu">void qt_mac_set_dock_menu(QMenu *<i>menu</i>)</a></li>
<li class="level1"><a href="#void-qt-mac-set-menubar-icons-bool-enable">void qt_mac_set_menubar_icons(bool <i>enable</i>)</a></li>
<li class="level1"><a href="#void-qt-mac-set-menubar-merge-bool-enable">void qt_mac_set_menubar_merge(bool <i>enable</i>)</a></li>
<li class="level1"><a href="#void-qt-mac-set-native-menubar-bool-enable">void qt_mac_set_native_menubar(bool <i>enable</i>)</a></li>
<li class="level1"><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>
</ul>
</div>
<h1 class="title">Platform-Specific Functions</h1>
<span class="subtitle"></span>
<!-- $$$exportedfunctions.html-description -->
<div class="descr"> <a name="details"></a>
<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>
<p>These functions are exported by <a href="qtcore.html">QtCore</a> and <a href="qtgui.html">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>
<pre class="cpp"> #ifdef Q_WS_X11
void qt_x11_wait_for_window_manager(QWidget *widget);
#endif
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
...
window.show();
#ifdef Q_WS_X11
qt_x11_wait_for_window_manager(&window);
#endif
...
return app.exec();
}</pre>
<p>These functions will remain as part of Qt for the lifetime of Qt 4.</p>
<p>Functions:</p>
<a name="void-qt-set-library-config-file-const-qstring-filename"></a>
<h2>void qt_set_library_config_file(const QString &<i>fileName</i>)</h2>
<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>
<a name="void-qt-set-sequence-auto-mnemonic-bool-enable"></a>
<h2>void qt_set_sequence_auto_mnemonic(bool <i>enable</i>)</h2>
<p>Specifies whether mnemonics for menu items, labels, etc., should be honored or not. On Windows and X11, 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. This feature is also enabled on embedded Linux.</p>
<a name="void-qt-x11-wait-for-window-manager-qwidget-widget"></a>
<h2>void qt_x11_wait_for_window_manager(QWidget *<i>widget</i>)</h2>
<p>Blocks until the X11 window manager has shown the widget after a call to <a href="qwidget.html#show">QWidget::show</a>().</p>
<a name="void-qt-mac-secure-keyboard-bool-enable"></a>
<h2>void qt_mac_secure_keyboard(bool <i>enable</i>)</h2>
<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>
<a name="void-qt-mac-set-dock-menu-qmenu-menu"></a>
<h2>void qt_mac_set_dock_menu(QMenu *<i>menu</i>)</h2>
<p>Sets the menu to display in the Mac OS X Dock for the application. This menu is shown when the user attempts a press-and-hold operation on the application's dock icon or <b>Ctrl</b>-clicks on it while the application is running.</p>
<p>The menu will be turned into a Mac menu and the items added to the default Dock menu. There is no merging of the Qt menu items with the items that are in the Dock menu (i.e., it is not recommended to include actions that duplicate functionality of items already in the Dock menu).</p>
<a name="void-qt-mac-set-menubar-icons-bool-enable"></a>
<h2>void qt_mac_set_menubar_icons(bool <i>enable</i>)</h2>
<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>
<p>In Qt 4.4, this is equivalent to <tt>QApplication::instance()->setAttribute(Qt::AA_DontShowIconsInMenus);</tt>.</p>
<a name="void-qt-mac-set-menubar-merge-bool-enable"></a>
<h2>void qt_mac_set_menubar_merge(bool <i>enable</i>)</h2>
<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 for Mac OS X - Specific Issues</a> for the list of menu items for which this applies.</p>
<a name="void-qt-mac-set-native-menubar-bool-enable"></a>
<h2>void qt_mac_set_native_menubar(bool <i>enable</i>)</h2>
<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>
<p>In Qt 4.6, this is equivalent to <tt>QApplication::instance()->setAttribute(Qt::AA_DontUseNativeMenuBar);</tt>.</p>
<a name="void-qt-mac-set-press-and-hold-context-bool-enable"></a>
<h2>void qt_mac_set_press_and_hold_context(bool <i>enable</i>)</h2>
<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>
</div>
<!-- @@@exportedfunctions.html -->
<div class="ft">
<span></span>
</div>
</div>
<div class="footer">
<p>
<acronym title="Copyright">©</acronym> 2012 Nokia Corporation and/or its
subsidiaries. Documentation contributions included herein are the copyrights of
their respective owners.</p>
<br />
<p>
The documentation provided herein is licensed under the terms of the
<a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation
License version 1.3</a> as published by the Free Software Foundation.</p>
<p>
Documentation sources may be obtained from <a href="http://www.qt-project.org">
www.qt-project.org</a>.</p>
<br />
<p>
Nokia, Qt and their respective logos are trademarks of Nokia Corporation
in Finland and/or other countries worldwide. All other trademarks are property
of their respective owners. <a title="Privacy Policy"
href="http://en.gitorious.org/privacy_policy/">Privacy Policy</a></p>
</div>
</body>
</html>
|