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  ·  Fonctions  · 

Installing Qt/Mac

You may need to be logged in as root, depending on the permissions of the directories where you choose to install Qt.

  1. Unpack the archive if you have not done so already:

        cd /Developer
        gnutar xzf qt-mac-version.tar.gz
    

    This creates the directory /Developer/qt-version containing the files from the main archive.

    Rename qt-version to qt (or make a symlink):

        mv qt-version qt
    

    The rest of this file assumes that Qt is unpacked in /Developer/qt.

  2. Set some environment variables in the file .profile (or .login, depending on your shell) in your home directory. Create the file if it is not there already.

    • QTDIR -- the directory in which you're building Qt
    • PATH -- to locate the moc program and other Qt tools
    • MANPATH -- to access the Qt man pages
    • LD_LIBRARY_PATH -- for the shared Qt library

    This is done like this:

    In .profile (if your shell is bash, ksh, zsh or sh), add the following lines:

        QTDIR=/Developer/qt
        PATH=$QTDIR/bin:$PATH
        MANPATH=$QTDIR/man:$MANPATH
        DYLD_LIBRARY_PATH=$QTDIR/lib:$DYLD_LIBRARY_PATH
    
        export QTDIR PATH MANPATH DYLD_LIBRARY_PATH
    

    In .login (in case your shell is csh or tcsh), add the following lines:

        setenv QTDIR /Developer/qt
        setenv PATH $QTDIR/bin:$PATH
        setenv MANPATH $QTDIR/man:$MANPATH
        setenv DYLD_LIBRARY_PATH $QTDIR/lib:$DYLD_LIBRARY_PATH
    

    After you have done this, you will need to login again, or re-source the profile before continuing.

  3. If you have the commercial edition of Qt, install your license file as $HOME/.qt-license.

  4. Compile the Qt library, and build the example programs, the tutorial and the tools (e.g. Qt Designer) as follows.

    Type:

        cd $QTDIR
        ./configure
    

    This will configure the Qt library for your machine. Note that GIF support is turned off by default. Run ./configure -help to get a list of configuration options.

    To create the library and compile all examples and the tutorial:

        make
    
    If you have problems, see http://www.trolltech.com/platforms/.

  5. Once you have built Qt, it is ready to use. If Qt has not been configured with the -static option, then in order to be able to launch Qt applications from the Finder you must place the relevant libraries in a directory where they can be found. We recommend making these symbolic links (if you have configured Qt with -thread please change the libqt below with libqt-mt):

        ln -sf $QTDIR/lib/libqt.3.dylib /usr/lib
        ln -sf $QTDIR/lib/libqui.1.dylib /usr/lib
    

    You may need to have 'administrator' access to do this, (in which case, precede each command with sudo', e.g. sudo ln -s ...). If you use sudo you'll be prompted for the administrator password.

    If you do not have administrator access, or you would prefer to do a user install (rather than system install) of the libraries you can do (if you have configured Qt with -thread please change the libqt below with libqt-mt):

        ln -sf $QTDIR/lib/libqt.3.dylib $HOME/lib
        ln -sf $QTDIR/lib/libqui.1.dylib $HOME/lib
    

That's all! Qt is now installed. Qt's documentation can be read with Qt Assistant or by any web browser; the contents page is $QTDIR/doc/html/index.html.

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. Pourquoi les programmeurs sont-ils moins payés que les gestionnaires de programmes ? Manquent-ils de pouvoir de négociation ? 43
  4. Les développeurs ignorent-ils trop les failles découvertes dans leur code ? Prenez-vous en compte les remarques des autres ? 17
  5. Quelles nouveautés de C++11 Visual C++ doit-il rapidement intégrer ? Donnez-nous votre avis 10
  6. Qt Commercial : Digia organise un webinar gratuit le 27 mars sur la conception d'interfaces utilisateur et d'applications avec le framework 0
  7. 2017 : un quinquennat pour une nouvelle version du C++ ? Possible, selon Herb Sutter 9
Page suivante

Le Qt Developer Network au hasard

Logo

Génération de bindings PySide avec Shiboken

Le Qt Developer Network est un réseau de développeurs Qt anglophone, où ils peuvent partager leur expérience sur le framework. 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 3.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