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  ·  Tous les espaces de nom  ·  Toutes les classes  ·  Classes principales  ·  Annotées  ·  Classes groupées  ·  Modules  ·  Fonctions  · 

Qt/Mac is Mac OS X Native

This document explains what makes an application native on Mac OS X. It shows the areas where Qt/Mac is compliant, and the grey areas where compliance is more questionable. (See also the document Qt/Mac-Specific Issues.)

Normally when referring to a native Mac application, one really means an application that talks directly to the underlying window system, rather than one that uses some intermediary (for example Apple's X11 server, or a web browser). Qt/Mac applications run as first class citizens, just like Cocoa, and Carbon applications. In fact, we use Carbon and HIView internally to communicate with OS X.

When an application is running as a first class citizen, it means that it can interact with specific components of the Mac OS X experience:

The Global Menu Bar

Qt/Mac does this via the QMenuBar abstraction. Mac users expect to have a menu bar at the top of the screen and Qt/Mac honors this.

Additionally, users expect certain conventions to be respected, for example the application menu should contain About, Preferences, Quit, etc. Qt/Mac handles this automatically, although it does not provide a means of interacting directly with the application menu. (By doing this automatically, Qt/Mac makes it easier to port Qt/Mac applications to other platforms.)

Aqua

This is a critical piece of Mac OS X (documentation can be found at http://developer.apple.com/documentation/UserExperience/Conceptual/OSXHIGuidelines/index.html). It is a huge topic, but the most important guidelines for GUI design are probably these:

  • Aqua look

    As with Cocoa/Carbon, Qt/Mac provides widgets that look like those described in the Human Interface Descriptions. Qt/Mac's widgets use Appearance Manager on Mac OS X 10.2 and the new HIThemes on Mac OS X 10.3 and higher to implement the look, in other words we use Apple's own API's for doing the rendering.

  • Aqua feel

    This is a bit more subjective, but certainly Qt/Mac strives to provide the same feel as any Mac OS X application (and we consider situations where it doesn't achieve this to be bugs). Of course Qt has other concerns to bear in mind, especially remaining cross-platform. Some "baggage" that Qt carries is in an effort to provide a widget on a platform for which an equivelant doesn't exist, or so that a single API can be used to do something, even if the API doesn't make entire sense for a specific widget.

  • Aqua guides

    This is the most subjective, but there are many suggestions and guidelines in the Aqua style guidelines. This is the area where Qt/Mac is of least assistance. The decisions that must be made to conform (widget sizes, widget layouts with respect to other widgets, window margins, placement of OK and Cancel, etc) must be made based on the user experience demanded by your application. If your user base is small or mostly comes from the Windows or Unix worlds, these are minor issues much less important than trying to make a mass market product. Qt/Mac is fully API compatible with Qt/Windows and Qt/X11, but Mac OS X is a significantly different platform to Windows and some special considerations must be made based on your audience.

Dock

Interaction with the dock is possible. The icon can be set by calling QWidget::setWindowIcon() on the main window in your application. The setWindowIcon() call can be made as often as necessary, providing an icon that can be easily updated.

Accessiblity

Although many users never use this, some users will only interact with your applications via assistive devices. With Qt the aim is to make this automatic in your application so that it conforms to accepted practice on its platform. Qt/Mac uses Apple's accessibility framework to provide access to users with diabilities.

Development Tools

Mac OS X developers expect a certain level of interopability between their development toolkit and the platform's developer tools (for example Visual Studio, gmake, etc). Qt/Mac supports both Unix style Makefiles, and ProjectBuilder/Xcode project files by using the qmake tool. For example:

 qmake -spec macx-xcode project.pro

will generate an Xcode project file from project.pro. With qmake you do not have to worry about rules for Qt's preprocessors (moc and uic) since qmake automatically handles them and ensures that everything necessary is linked into your application.

Qt does not entirely interact with the development environment (for example plugins to set a file to "mocable" from within the Xcode user interface). Trolltech is actively working on improving Qt's interoperability with various IDEs.

Publicité

Best Of

Actualités les plus lues

Semaine
Mois
Année
  1. « Quelque chose ne va vraiment pas avec les développeurs "modernes" », un développeur à "l'ancienne" critique la multiplication des bibliothèques 94
  2. Apercevoir la troisième dimension ou l'utilisation multithreadée d'OpenGL dans Qt, un article des Qt Quarterly traduit par Guillaume Belz 0
  3. Les développeurs ignorent-ils trop les failles découvertes dans leur code ? Prenez-vous en compte les remarques des autres ? 17
  4. Pourquoi les programmeurs sont-ils moins payés que les gestionnaires de programmes ? Manquent-ils de pouvoir de négociation ? 42
  5. Quelles nouveautés de C++11 Visual C++ doit-il rapidement intégrer ? Donnez-nous votre avis 10
  6. Adieu qmake, bienvenue qbs : Qt Building Suite, un outil déclaratif et extensible pour la compilation de projets Qt 17
  7. 2017 : un quinquennat pour une nouvelle version du C++ ? Possible, selon Herb Sutter 6
Page suivante

Le Qt Labs au hasard

Logo

Le moteur de rendu OpenGL

Les Qt Labs sont les laboratoires des développeurs de Qt, où ils peuvent partager des impressions sur le framework, son utilisation, ce que pourrait être son futur. 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.3
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