Brief Technical FAQThis document describes how to use more than one Qt version on one machine and how to use Qt on X11 without a window manager. In addition it explains the most common source of link errors with Qt.Other frequently asked questions can be found in the FAQ index and in the Technical FAQ.
This indicates that you've included the Q_OBJECT macro in a class
declaration and probably also run the moc, but forgot to link the
moc-generated object code into your executable. See Using the Meta Object Compiler for details on how to use moc.
Qt programs need the following components of a Qt distribution:
Qt distributions consist of different files needed at compile time,
link time, or run time. Trolltech distributes Qt in the form of a
source package that contain all these files once they have been built.
Other vendors distribute Qt in the form of binary packages. Binary packages
usually consist of two parts:
Depending on how you are using Qt, you need to make specific parts of
the Qt distribution available to your programs. Typical situations are
described below.
You build programs with a single version of Qt, but you still need
to run programs linked with another version of Qt. You are typically
a Linux developer who builds programs for Qt 3.x on a KDE desktop based
on Qt 2.x. Qt packages are usually split into a shared library
package with a name like qt and a developer package with a name
like qt-dev. You will need the appropriate packages:
Just install the packages, qt2, qt3, and qt3-dev. You may
need to set the environment variable QTDIR to point to Qt 3.x.
You build and run programs for Qt 2.x and Qt 3.x. You will need:
Get the source distributions of both Qt 2.x and Qt 3.x.
To develop with Qt 2.x use:
To develop with Qt 3.x use:
Setting QTDIR ensures that the proper resources are used, such as the
documentation appropriate to the version of Qt you're using. Also
your Makfiles may refer to "$QTDIR"/include and "$QTDIR"/lib to
include the proper header files and link with the proper libraries.
Setting the PATH ensures that the proper version of moc and other
tools is being used.
When using Qt without a window manager on Unix/X11, you will most
likely experience focus problems. Without a window manager, there is
no focus handling on X11, and no concept of an active window
either. If you want your application to work in such an environment,
you have to explicitly mark a window as active after showing it:
Note that setActiveWindow() won't work if the widget does not become
physically visible during this event cycle. However, without a window
manager running, this is guaranteed to happen. For the curious reader:
setActiveWindow() emulates a window manager by explicitly setting the
X Input Focus to a widget's top level window.
|
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.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 ! |
Copyright © 2000-2012 - www.developpez.com