Options:
1. Qt Creator
via flatpak
- Install
Qt Creator
viaflatpak
.
flatpak install --user flathub io.qt.QtCreator
- Run the
Qt Creator
with--user
and--filesystem=/var/guix/profiles
flatpak run --user --filesystem=/var/guix/profiles io.qt.QtCreator
-
Open/Create your project and go to the
Project/Manage Kits
-
Qt Versions
Tab:
Click onAdd
and the real path ofqmake
command in the guix store. A path like this:
/gnu/store/3ag62qr53br83x0p0739xdhshd3km7yk-qtbase-5.15.2/bin/qmake
-
Compilers
Tab:
Click onAdd
and add theGCC-C
andGCC-C++
. Enter the real path of thegcc
andg++
from the guix store inCompiler Path
text box. Example:
/gnu/store/sjnh6a1fizi2jkiiham0d9s37bccpzid-gcc-toolchain-11.2.0/bin/gcc
/gnu/store/sjnh6a1fizi2jkiiham0d9s37bccpzid-gcc-toolchain-11.2.0/bin/g++
-
Debuggers
Tab:
Click onAdd
and add the real path ofgdb
. Example:
/gnu/store/9nsgri0qgffyr83ry90fq2ik92ih4s2p-gdb-10.2/bin/gdb
-
CMake
Tab:
Click onAdd
and add the real path ofcmake
. Example:
/gnu/store/vfbw5h12hqg23bagnzgrmclds2vrky3q-cmake-3.21.1/bin/cmake
-
Kits
Tab:
Click onAdd
, set a proper name and set all toolchain with them you added above. (qmake
,gcc
,g++
,gdb
andcmake
) -
Ensure the
Qt Creator
is using thatqmake
you entered in theProject/QtXX/Build/Effective qmake call
-
Update the
QML2_IMPORT_PATH
andQT_PLUGIN_PATH
env variables:
Go to theProject
, choose the kit which you added, go to theRun
and update theQML2_IMPORT_PATH
andQT_PLUGIN_PATH
in theEnvironment
part.
QT_PLUGIN_PATH=/gnu/store/3ag62qr53br83x0p0739xdhshd3km7yk-qtbase-5.15.2/lib/qt5/plugins:/gnu/store/49rn4wjbwaagb8hr6rgdgwdm6bbdab6x-qtdeclarative-5.15.2/lib/qt5/plugins:/gnu/store/5jixar8hqbwmm302h2r04kw6g4268qyk-qtsvg-5.15.2/lib/qt5/plugins
QML2_IMPORT_PATH=/gnu/store/49rn4wjbwaagb8hr6rgdgwdm6bbdab6x-qtdeclarative-5.15.2/lib/qt5/qml:/gnu/store/22jq16rmk7rj5yi9sr01m9nic94k1jdp-qtgraphicaleffects-5.15.2/lib/qt5/qml:/gnu/store/3rxgqyhchca58apbafy6jkx2cs6zrhns-qtquickcontrols-5.15.2/lib/qt5/qml:/gnu/store/yw5fj3hjdv9wg8wr2ax4rgh8xslwf1p5-qtquickcontrols2-5.15.2/lib/qt5/qml:/gnu/store/5xssbna6yw6nvvkph0zn4v17al3cf2mk-qtxmlpatterns-5.15.2/lib/qt5/qml
If you don’t this last step, the project will be built but if you use QtQuick.Controls@2.x
, it will be crashed.
2. VSCode
:
To build and running the QML
application in VSCode
, only you need to update QT_PLUGIN_PATH
and QML2_IMPORT_PATH
env variables like above.