.. _qt-guide-index: QT Guide ======== Requirements ------------ For creating the QT6 toolchain a complete Yocto build environment is required. Depending on your module choose the correct guide - if not already set up. .. note:: **QSXP, QSXM, QS8M, TX8M, TX8P** use :ref:`nxp-yocto-guide-index` .. note:: **QSRZ, QSMP, TXRZ, TXMP, TX6, TXUL** use :ref:`mainline-yocto-guide-index` Build ----- 1. Setup the Yocto build-directory as described in the Yocto guide for your machine. Use the following values: * ``DISTRO=karo-wayland`` * ``MACHINE=`` 2. Build the image for your target: .. prompt:: :prompts: $ bitbake karo-image-qt6 3. Program your board using our :ref:`software-documentation/index:Flashtools`. **You can also boot the image from net/tftp**. 4. Build the SDK: .. prompt:: :prompts: $ bitbake meta-toolchain-qt6 Installing SDK -------------- To install the previously built SDK on your host, simply run: .. prompt:: :prompts: $ /tmp/deploy/sdk/.sh .. hint:: It is recommended to install every toolchain into a seperate folder inside ``/opt/`` Installing QT Creator --------------------- Download the QT Creator offline installation for Linux from https://www.qt.io/offline-installers and execute the `.run` file. This will install the QT Creator for you. Setup QT Creator ---------------- Now we have to tell QtCreator to use our previously installed SDK. SDK ~~~ Start QT Creator, go to :menuselection:`Edit --> Preferences` and select the **Kits** section. Configure Qt Versions (qmake), Compilers and Debuggers as shown in the following screenshots. Of course you have to fit the paths depending on your SDK. .. figure:: images/qt-versions.png :align: left :scale: 50% :figwidth: 100% QT Versions .. figure:: images/compilers-2.png :align: left :scale: 50% :figwidth: 100% C Compilers .. figure:: images/compilers-1.png :align: left :scale: 50% :figwidth: 100% C++ Compilers .. figure:: images/debuggers.png :align: left :scale: 50% :figwidth: 100% Debuggers Go to the **CMake** section and add cmake executable. .. figure:: images/cmake.png :align: left :scale: 50% :figwidth: 100% CMake Device ~~~~~~ .. note:: For the next step it is required that your target has a working ethernet connection to your host. .. tip:: To find out the IP of our target, run ``ip a`` there. Go to section **Devices** and choose :menuselection:`Add --> Remote Linux Device --> Start Wizard`. Follow the steps to configure your target. .. figure:: images/devices.png :align: left :scale: 50% :figwidth: 100% Devices Now in **Kits** section, add a Kit with all the previously configured parameters. .. figure:: images/kits.png :align: left :scale: 50% :figwidth: 100% Complete Kits Press :kbd:`Apply` and close the Options Window. Hello World ----------- Create a new project using the project wizard on QTCreator start screen clicking :kbd:`+ New`. Select e.g. "Qt Quick Application" and go through the steps. **Make sure you select the right Kit**. Once created you should be able to run project on your target. .. figure:: images/run.png :align: left :scale: 50% :figwidth: 100% Run