Qt-6.7.0

Introduction to Qt6

Qt6 is a cross-platform application framework that is widely used for developing application software with a graphical user interface (GUI) (in which cases Qt6 is classified as a widget toolkit), and also used for developing non-GUI programs such as command-line tools and consoles for servers.

[Note]

Note

Development versions of BLFS may not build or run some packages properly if LFS or dependencies have been updated since the most recent stable versions of the books.

Package Information

Qt6 Dependencies

Required

Xorg Libraries

Recommended

Optional

BlueZ-5.75 (for sdpscanner, and at runtime for QtConnectivity module), GTK+-3.24.41, ibus-1.5.29, MariaDB-10.11.7 or MySQL, MIT Kerberos V5-1.21.2, pciutils-3.12.0, PostgreSQL-16.2, PulseAudio-17.0, SDL2-2.30.1, unixODBC-2.3.12, assimp, Flite, Firebird, FreeTDS, libproxy, OpenAL, speech-dispatcher, and tslib

Setting the installation prefix

Installing in /opt/qt6

The BLFS editors recommend installing Qt6 in a directory other than /usr, ie /opt/qt6. This is needed to avoid conflicts with Qt5. To do this, set the following environment variable:

export QT6PREFIX=/opt/qt6
[Tip]

Tip

Sometimes the installation paths are hardcoded into installed files. This is the reason why /opt/qt6 is used as installation prefix instead of /opt/qt-6.7.0. To create a versioned Qt6 directory, you may rename the directory and create a symlink:

mkdir -pv /opt/qt-6.7.0
ln -sfnv qt-6.7.0 /opt/qt6

Later on, you may want to install other versions of Qt6. To do that, just remove the symlink, create the new versioned directory, and recreate the /opt/qt6 symlink again before building the new version. Which version of Qt6 you use depends only on where the symlink points.

Installation of Qt6

[Warning]

Warning

If Qt6 is being reinstalled into the same directory as an existing instance, run the commands done by root, such as make install, from a console or non-Qt6 based window manager. It overwrites Qt6 libraries that should not be in use during the install process.

[Caution]

Caution

If you did not install some of the recommended dependencies, examine ./configure --help output to check how to disable them or use internal versions bundled in the source tarball.

[Note]

Note

The build time and space required for the full Qt6 is quite long. The instructions below do not build the tutorials and examples. Removing the -nomake line will create additional resources..

[Note]

Note

The BLFS editors do not recommend installing Qt6 into the /usr hierarchy because it becomes difficult to find components and to update to a new version. There are also some programs that conflict with those installed by Qt5.

First make a correction identified upstream:

sed -i '/if __cpp_lib_span/s/if/ifdef/' qtbase/src/corelib/tools/qspan.h

Install Qt6 by running the following commands:

./configure -prefix $QT6PREFIX      \
            -sysconfdir /etc/xdg    \
            -dbus-linked            \
            -openssl-linked         \
            -system-sqlite          \
            -nomake examples        \
            -no-rpath               \
            -syslog                 \
            -skip qt3d              \
            -skip qtquick3dphysics  \
            -skip qtwebengine       \
            -Wno-dev                &&
ninja

This package does not come with a test suite.

Now, as the root user:

ninja install

Remove references to the build directory from installed library dependency (prl) files by running the following command as the root user:

find $QT6PREFIX/ -name \*.prl \
   -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \;

Install images and create the menu entries for installed applications. Again as the root user:

pushd qttools/src &&

install -v -Dm644 assistant/assistant/images/assistant-128.png       \
                  /usr/share/pixmaps/assistant-qt6.png               &&

install -v -Dm644 designer/src/designer/images/designer.png          \
                  /usr/share/pixmaps/designer-qt6.png                &&

install -v -Dm644 linguist/linguist/images/icons/linguist-128-32.png \
                  /usr/share/pixmaps/linguist-qt6.png                &&

install -v -Dm644 qdbus/qdbusviewer/images/qdbusviewer-128.png       \
                  /usr/share/pixmaps/qdbusviewer-qt6.png             &&
popd &&


cat > /usr/share/applications/assistant-qt6.desktop << EOF
[Desktop Entry]
Name=Qt6 Assistant
Comment=Shows Qt6 documentation and examples
Exec=$QT6PREFIX/bin/assistant
Icon=assistant-qt6.png
Terminal=false
Encoding=UTF-8
Type=Application
Categories=Qt;Development;Documentation;
EOF

cat > /usr/share/applications/designer-qt6.desktop << EOF
[Desktop Entry]
Name=Qt6 Designer
GenericName=Interface Designer
Comment=Design GUIs for Qt6 applications
Exec=$QT6PREFIX/bin/designer
Icon=designer-qt6.png
MimeType=application/x-designer;
Terminal=false
Encoding=UTF-8
Type=Application
Categories=Qt;Development;
EOF

cat > /usr/share/applications/linguist-qt6.desktop << EOF
[Desktop Entry]
Name=Qt6 Linguist
Comment=Add translations to Qt6 applications
Exec=$QT6PREFIX/bin/linguist
Icon=linguist-qt6.png
MimeType=text/vnd.trolltech.linguist;application/x-linguist;
Terminal=false
Encoding=UTF-8
Type=Application
Categories=Qt;Development;
EOF

cat > /usr/share/applications/qdbusviewer-qt6.desktop << EOF
[Desktop Entry]
Name=Qt6 QDbusViewer
GenericName=D-Bus Debugger
Comment=Debug D-Bus applications
Exec=$QT6PREFIX/bin/qdbusviewer
Icon=qdbusviewer-qt6.png
Terminal=false
Encoding=UTF-8
Type=Application
Categories=Qt;Development;Debugger;
EOF

Command Explanations

-nomake examples: This switch disables building of the example programs included in the source tarball. Remove it if you want to build them.

-skip qt3d: This switch disables building qt3d support. There is a problem building these files without an external library and no packages in BLFS use qt3d.

-system-sqlite: This switch enables use of the system version of SQLite.

-dbus-linked -openssl-linked: These switches enable explicit linking of the D-Bus and OpenSSL libraries into Qt6 libraries instead of dlopen()-ing them.

-syslog: This switch allows to send Qt messages to the syslog logging system.

-skip qtwebengine: This switch disables building the QtWebEngine. The BLFS editors have chosen to build qtwebengine-6.7.0 separately.

-skip qtquick3dphysics: This switch disables building the Qt Quick 3D Physics submodule. On 32-bit systems, this will cause the build process to fail with an inlining error in Qt6's bundled copy of the PhysX SDK.

Configuring Qt6

Configuration Information

If Sudo-1.9.15p5 is installed, QT6DIR should be available to the super user as well. Execute the following commands as the root user:

cat > /etc/sudoers.d/qt << "EOF"
Defaults env_keep += QT6DIR
EOF

You now need to update the following configuration files so that Qt6 is correctly found by other packages and system processes.

As the root user, update the /etc/ld.so.conf file and the dynamic linker's run-time cache file:

cat >> /etc/ld.so.conf << EOF
# Begin Qt addition

/opt/qt6/lib

# End Qt addition
EOF

ldconfig

As the root user, create the /etc/profile.d/qt6.sh file:

cat > /etc/profile.d/qt6.sh << "EOF"
# Begin /etc/profile.d/qt6.sh

QT6DIR=/opt/qt6

pathappend $QT6DIR/bin           PATH
pathappend $QT6DIR/lib/pkgconfig PKG_CONFIG_PATH

export QT6DIR

# End /etc/profile.d/qt6.sh
EOF

Contents

Installed Programs: androiddeployqt (hard link to androiddeployqt6), androiddeployqt6, androidtestrunner, assistant, balsam, balsamui, canbusutil, cooker, designer, instancer, lconvert, linguist, lrelease, lupdate, materialeditor, meshdebug, pixeltool, qdbus, qdbuscpp2xml, qdbusviewer, qdbusxml2cpp, qdistancefieldgenerator, qdoc, qmake (hard link to qmake6), qmake6, qml, qmldom, qmleasing, qmlformat, qmllint, qmlls, qmlplugindump, qmlpreview, qmlprofiler, qmlscene, qmltc, qmltestrunner, qmltime, qqem, qsb, qtdiag (hard link to qtdiag6), qtdiag6, qtpaths (hard link to qtpaths6), qtpaths6, qtplugininfo, qt-cmake, qt-cmake-create, qt-configure-module, shadergen, and shapegen
Installed Libraries: libQt6Bluetooth.so, libQt6Bodymovin.so, libQt6BundledEmbree.a, libQt6BundledPhysX.a, libQt6BundledResonanceAudio.a, libQt6Charts.so, libQt6ChartsQml.so, libQt6Coap.so, libQt6Concurrent.so, libQt6Core.so, libQt6Core5Compat.so, libQt6DBus.so, libQt6DataVisualization.so, libQt6DataVisualizationQml.so, libQt6DeclarativeOpcua.so, libQt6Designer.so, libQt6DesignerComponents.so, libQt6DeviceDiscoverySupport.a, libQt6EglFSDeviceIntegration.so, libQt6EglFsKmsGbmSupport.so, libQt6EglFsKmsSupport.so, libQt6ExampleIcons.a, libQt6FbSupport.a, libQt6Graphs.so, libQt6Grpc.so, libQt6Gui.so, libQt6Help.so, libQt6HttpServer.so, libQt6InputSupport.a, libQt6JsonRpc.so, libQt6KmsSupport.a, libQt6LabsAnimation.so, libQt6LabsFolderListModel.so, libQt6LabsQmlModels.so, libQt6LabsSettings.so, libQt6LabsSharedImage.so, libQt6LabsWavefrontMesh.so, libQt6LanguageServer.so, libQt6Location.so, libQt6Mqtt.so, libQt6Multimedia.so, libQt6MultimediaQuick.so, libQt6MultimediaWidgets.so, libQt6Network.so, libQt6NetworkAuth.so, libQt6Nfc.so, libQt6OpcUa.so, libQt6OpenGL.so, libQt6OpenGLWidgets.so, libQt6PacketProtocol.a, libQt6Positioning.so, libQt6PositioningQuick.so, libQt6PrintSupport.so, libQt6Protobuf.so, libQt6Qml.so, libQt6QmlCompiler.so, libQt6QmlCore.so, libQt6QmlDebug.a, libQt6QmlDom.a, libQt6QmlLocalStorage.so, libQt6QmlLS.a, libQt6QmlModels.so, libQt6QmlToolingSettings.a, libQt6QmlTypeRegistrar.a, libQt6QmlWorkerScript.so, libQt6QmlXmlListModel.so, libQt6Quick.so, libQt6Quick3D.so, libQt6Quick3DAssetImport.so, libQt6Quick3DAssetUtils.so, libQt6Quick3DEffects.so, libQt6Quick3DGlslParser.so, libQt6Quick3DHelpers.so, libQt6Quick3DHelpersImpl.so, libQt6Quick3DIblBaker.so, libQt6Quick3DParticleEffects.so, libQt6Quick3DParticles.so, libQt6Quick3DPhysics.so, libQt6Quick3DPhysicsHelpers.so, libQt6Quick3DRuntimeRender.so, libQt6Quick3DSpatialAudio.so, libQt6Quick3DUtils.so, libQt6QuickControls2.so, libQt6QuickControls2Impl.so, libQt6QuickControlsTestUtils.a, libQt6QuickDialogs2.so, libQt6QuickDialogs2QuickImpl.so, libQt6QuickDialogs2Utils.so, libQt6QuickEffects.so, libQt6QuickLayouts.so, libQt6QuickParticles.so, libQt6QuickShapes.so, libQt6QuickTemplates2.so, libQt6QuickTest.so, libQt6QuickTestUtils.a, libQt6QuickTimeline.so, libQt6QuickWidgets.so, libQt6RemoteObjects.so, libQt6RemoteObjectsQml.so, libQt6Scxml.so, libQt6ScxmlQml.so, libQt6Sensors.so, libQt6SensorsQuick.so, libQt6SerialBus.so, libQt6SerialPort.so, libQt6ShaderTools.so, libQt6SpatialAudio.so, libQt6Sql.so, libQt6StateMachine.so, libQt6StateMachineQml.so, libQt6Svg.so, libQt6SvgWidgets.so, libQt6TextToSpeech.so, libQt6UiTools.so, libQt6VirtualKeyboard.so, libQt6WaylandClient.so, libQt6WaylandCompositor.so, libQt6WaylandEglClientHwIntegration.so, libQt6WaylandEglCompositorHwIntegration.so, libQt6WebChannel.so, libQt6WebChannelQuick.so, libQt6WebSockets.so, libQt6WebView.so, libQt6WebViewQuick.so, libQt6Widgets.so, libQt6WlShellIntegration.so, libQt6XcbQpa.so, and libQt6Xml.so
Installed Directories: /opt/qt6 and /opt/qt-6.7.0

Short Descriptions

assistant

is a tool for presenting on-line documentation

balsam

is a tool to convert 3D scenes from various creation tools to QML format, for use by the new QtQuick 3D library

canbustil

is a tool to deal with arbitrary CAN bus frames. A Controller Area Network (CAN) is a vehicle bus standard designed to allow microcontrollers and devices to communicate with each other in applications without a host computer

designer

is a full-fledged GUI builder. It includes powerful features such as preview mode, automatic widget layout, support for custom widgets, and an advanced property editor

lconvert

is part of Qt6's Linguist tool chain. It can be used as a standalone tool to convert and filter translation data files

linguist

provides support for translating applications into local languages

lrelease

is a simple command line tool. It reads XML-based translation file in TS format and produces message files used by the application

lupdate

finds the translatable strings in the specified source, header and Qt Designer interface files, and stores the extracted messages in translation files to be processed by lrelease

meshdebug

displays information about qtquick-3d mesh files

pixeltool

is a desktop magnifier and as you move your mouse around the screen it will show the magnified contents in its window

qdbus

lists available services, object paths, methods, signals, and properties of objects on a bus

qdbuscpp2xml

takes a C++ source file and generates a D-Bus XML definition of the interface

qdbusviewer

is a graphical D-Bus browser

qdbusxml2cpp

is a tool that can be used to parse interface descriptions and produce static code representing those interfaces,

qdistancefieldgenerator

allows a font cache to be pregenerated for Text.QtRendering to speed up an application's startup if the user interface has a lot of text, or multiple fonts, or a large amount of distinct characters, e.g. in CJK writing systems

qdoc

is a tool used by Qt Developers to generate documentation for software projects

qmake

uses information stored in project files to determine what should go in the makefiles it generates

qml

executes a QML file

qmleasing

is a tool used to define the easing curves using an interactive curve editor

qmlformat

formats QML files according to the QML coding conventions

qmllint

is a syntax checker for QML files

qmlplugindump

is a tool to create a qmltypes file

qmlpreview

is a tool used to analyze QML applications

qmlprofiler

is a tool which watches QML and JavaScript files on disk and updates the application live with any changes

qmlscene

is a utility that loads and displays QML documents even before the application is complete

qmltestrunner

is a tool used to make tests

qtdiag

is a tool for reporting diagnostic information about Qt and its environment

qtpaths

is a tool to query Qt path information

qtplugininfo

dumps meta-data about Qt plugins in JSON format