A similar question has already been asked here Starting with KDE Frameworks 5 and Qt Creator. However, the answer still hasn't clarified my doubts. So here is the problem: on Linux (Ubuntu) there are two ways to install Qt, first is to use apt
(sudo apt install qt5-default
) and the other one is to download Qt from the official website. Now when you install using the first way Qt is installed by defualt /usr/lib
and the second way in the home folder (or in /opt
if you ran the installed with administrator privileges).
Now I would like to integrate KDE Frameworks 5 in my project so on the official website it is suggested to use:
sudo apt install framework
And then you can just include that in your project by QT += framework
. The problem is I installed Qt using the second way (downloading from the website) and as a result Qt Creator always return Project ERROR: Unknown module(s) in QT: framework
. This I believe is because Qt doesn't seem to be aware of the fact that the modules are in /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/
instead it probably looks for them somewhere else.
How do I solve this problem with a permanent solution? I cannot install Qt using apt
because I would like to use the latest version which usually in not immediately available in the default repositories.
Ok so after a looking a lot, a solution has been suggested here https://forum.qt.io/topic/104861/how-to-use-kde-frameworks-with-qt-creator/8 Essentially Qt, if not installed through the system's repositories, is unable to find the KF5 modules. In order to fix this you can add a QMAKEPATH environment build variable to your project that tells Qt where it should look for the module, in my case this was in
/usr/lib/x86_64-linux-gnu/qt5