- Qt 6.9
- Qt for Wayland Requirements
- Qt 6.9.1 Reference Documentation

# Qt for Wayland Requirements

To download and install Qt for Wayland, follow the instructions on the Getting Started with Qt page.

## Requirements for Development Host

Ubuntu versions later than 14.04 contain all necessary dependencies, so you dont' need to build Wayland yourself.

The following packages are required:

- libwayland-dev
- libwayland-egl1-mesa
- libwayland-server0
- libgles2-mesa-dev
- libxkbcommon-dev

## Building Qt for Wayland

### Getting the Sources

Qt sources can be installed in Qt Online Installer. Source packages are also available through Git, as archives in the Qt Account (commercial users), and on download.qt.io (open-source users).

If you install the sources through Qt Online Installer, they will be available in the Qt installation directory, for example `$HOME/Qt/6.9.1/Src`.

If you downloaded the single source archive, extract it to a directory of your choice:

     cd /tmp
     tar xf ~/Downloads/qt-everywhere-src-6.9.1.tar.xz

### Install Build Requirements

Tool | Supported Versions
--- | ---
CMake | Version 3.22 and newer.
Ninja | -
Python | Version 3

Note: configure always uses the Ninja generator and build tool if a `ninja` executable is available. Ninja is cross-platform, feature-rich, performant, and recommended on all platforms. The use of other generators might work but is not officially supported.

### Build the Qt Libraries and Tools

To configure your build, create a build directory and run the `./configure` script in this directory:

     mkdir -p ~/dev/qt-build
     cd ~/dev/qt-build
     /tmp/qt-everywhere-src-6.9.1/configure

By default, Qt is configured for installation in the `/usr/local/Qt-6.9.1` directory. This can be changed by using the `-prefix` option. See the list of configure options to tweak further.

Did `configure` run successfully? Then proceed with building the libraries and tools:

     cmake --build . --parallel

After building, you need to install the libraries and tools in the appropriate place (unless you enabled a developer build):

     cmake --install .

Note that this might require root access.

### Using Qt

After Qt is installed, you can start building applications with it.

If you work from the command line, consider adding the Qt tools to your default `PATH`. This is done as follows:

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

     PATH=/usr/local/Qt-6.9.1/bin:$PATH
     export PATH

In `.login` (if your shell is csh or tcsh), add the following line:

     setenv PATH /usr/local/Qt-6.9.1/bin:$PATH

See also Wayland and Qt.