From Gentoo Wiki
< Qt
Jump to: navigation, search
The information in this article is probably outdated. You can help the Gentoo community by verifying and updating this article.

This is a list of frequently asked questions about the Qt framework.

Why do I get blockers when trying to emerge Qt?

Gentoo uses split ebuilds of the various components of Qt to allow finer-grained control of dependencies from other packages and reduced compilation time for revision bumps or USE changes. However, despite there being separate ebuilds all those components must be of the same version, which means they must all be upgraded together.

If some of the updated version packages are keyworded but others are not, you get those blockers.

Another source of Qt blocks is incompatible USE flag combinations, the portage output should tell you which those are.

Blocks caused by mixing stable and testing versions

Mixing stable and testing versions is discouraged. Currently, when users want to install both Qt4 and Qt5, it is necessary to add a dev-qt/* entry to /etc/portage/package.keywords, because Qt5 can only be installed in parallel with >=qtcore-4.8.6-r1. This dependency is enforced by qtchooser, a helper package that can set environment variables for the default Qt environment, see

user $qtchooser --help

qtwebkit vs chromium block caused by icu

A block might appear between www-client/chromium and dev-qt/qtwebkit version 4, because we do not enable the icu USE flag by default. If you want to install chromium as well as qtwebkit, then you have to set custom USE flags for the latter (or set them globally if you like). This can be done in two ways:

FILE /etc/portage/package.use/icublockDisable both icu and gstreamer
dev-qt/qtwebkit -gstreamer -icu
FILE /etc/portage/package.use/icublockEnable both icu and gstreamer
dev-qt/qtwebkit gstreamer icu

Disabling gstreamer means you will not get HTML5 audio and video capability in qtwebkit-based applications.

Solving the block

After you have checked your keywords and USE flags are set correctly, if you still get unresolvable blocks, then the easiest (not necessarily the best, but the one with the least headaches) way to get the blocks out of the way for a Qt upgrade is to uninstall all Qt components, and then emerge the new version:

This obviously will break everything using the Qt libraries until they have finished emerging.

1. List all installed qt packages:

root #export INSTALLED_QT_PACKAGES=$(eix --only-names -IC dev-qt)

2. Save tarballs of the old versions should we have to roll back:

root #quickpkg ${INSTALLED_QT_PACKAGES}

3. Unmerge old version and emerge new version:

root #emerge -Ca ${INSTALLED_QT_PACKAGES} && emerge -av1 ${INSTALLED_QT_PACKAGES}

Should we need to roll back, then we can emerge the packaged versions:

root #emerge -av1 --usepkgonly ${INSTALLED_QT_PACKAGES}
the eix command is provided by app-portage/eix

What does the exceptions USE flag do?

The USE flag description is technical, because the issue is technical. It is enabled by default, because this is the recommended setting for Qt. See bug #240185 for a discussion. When a developer uses exceptions in his program, it will then produce a warning on certain errors, instead of a crash. This is a good thing, which we generally want. The downside is that the application will use some more memory and disk space. So in cases where those are limited (think for example of embedded environments) it could be useful to turn exceptions off. That is why we have decided to offer a USE flag to disable this feature, after some users requested this.