Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Classes principales  ·  Annotées  ·  Classes groupées  ·  Modules  ·  Fonctions  · 

Special-Purpose Global Functions Exported by Qt

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.

These functions are exported by QtCore and QtGui, 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:

 #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();
 }

These functions will remain as part of Qt for the lifetime of Qt 4.

Functions:

void qt_set_library_config_file(const QString &fileName)

Specifies the location of the Qt configuration file. You must call this function before constructing a QApplication or QCoreApplication object. If no location is specified, Qt automatically finds an appropriate location.

void qt_set_sequence_auto_mnemonic(bool enable)

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 QKeySequence::mnemonic() function always returns an empty string. This feature is also enabled on embedded Linux.

void qt_x11_wait_for_window_manager(QWidget *widget)

Blocks until the X11 window manager has shown the widget after a call to QWidget::show().

void qt_mac_secure_keyboard(bool enable)

Turns the Mac OS X secure keyboard feature on or off. QLineEdit uses this when the echo mode is QLineEdit::Password or QLineEdit::NoEcho 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 focusInEvent() and turn it off in focusOutEvent().

void qt_mac_set_dock_menu(QMenu *menu)

Sets the menu to display in the Mac OS X Dock for the application. This menu is shown when the user Ctrl-clicks on the application's icon while it is running.

void qt_mac_set_menubar_icons(bool enable)

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.

void qt_mac_set_menubar_merge(bool enable)

Specifies whether Qt should attempt to relocate standard menu items (such as Quit, Preferences, and About) to the application menu on Mac OS X. This feature is on by default. See Qt/Mac-Specific Issues for the list of menu items for which this applies.

void qt_mac_set_native_menubar(bool enable)

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.

void qt_mac_set_dock_menu(QMenu *menu)

Sets this menu as the menu to be shown when a press and hold is attempted on your application's dock icon. The menu will be turned into a Mac menu which will be merged with Mac OS X builtin commands.

void qt_mac_set_press_and_hold_context(bool enable)

Turns emulation of the right mouse button by clicking and holding the left mouse button on or off. This feature is off by default.

Publicité

Best Of

Actualités les plus lues

Semaine
Mois
Année

Le blog Digia au hasard

Logo

Créer des applications avec un style Metro avec Qt, exemples en QML et C++, un article de Digia Qt traduit par Thibaut Cuvelier

Le blog Digia est l'endroit privilégié pour la communication sur l'édition commerciale de Qt, où des réponses publiques sont apportées aux questions les plus posées au support. Lire l'article.

Communauté

Ressources

Liens utiles

Contact

  • Vous souhaitez rejoindre la rédaction ou proposer un tutoriel, une traduction, une question... ? Postez dans le forum Contribuez ou contactez-nous par MP ou par email (voir en bas de page).

Qt dans le magazine

Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt 4.2
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web