4

Qt6 supports importing QML modules without specifying the version number.

Example:

  • Qt5: import QtQuick 2.0
  • Qt6: import QtQuick

where Qt6 will just choose the newest version of the module.

My problem is, that the current version of qtcreator does not seem to know about this feature (or any Qt6 features, most likely). I get the following error:

QtQuick import error

Opening the Designer with this error present, results in an error message telling me, that the QML code is broken. Running the project works flawlessly. I work on Arch Linux and installed the whole qt6 group as well as pyside6 and the install was successful. I tried to add Qt6 functionality by choosing /usr/bin/qmake-qt6 under Tools > Options > Kits > Qt Versions > Add, but this did not change anything, which does not seem surprising to me, but I thought I would try.

Is anyone else facing this problem? Have I overseen something? Can I maybe select another QML linter in an option I did not see?

Any help will be very much appreciated, I will continue to work with hardcoded version numbers for now, but I really like this new feature.

user8408080
  • 2,298
  • 1
  • 7
  • 17
  • What is your kit ? – Mohammad Kanan Jan 02 '21 at 18:06
  • @MohammadKanan I use the Desktop Kit and I also selected Qt6 under *Qt version* in *Manage Kits*, which I forgot to mention – user8408080 Jan 02 '21 at 18:19
  • Ok, i am laso trying to compare with windows .. I remember I observed something unusual working on Ubuntu .. not sure what exactly .. but Qt6/QML .. – Mohammad Kanan Jan 02 '21 at 18:28
  • Have you managed to make this run? Also, could you chose PySide6 for new projects? I'm still stuck with 5.15. – Noir Jan 30 '21 at 21:47
  • @Noir at the moment I am still using 5.15, but with PySide6. I don't get how such an important feature as correct linting didn't make its way into the newest qtcreator version, but I guess we will have to wait until changes trickle down from Qt's commercial products. There is something about changes to imports in QML in the [changelog](https://github.com/qt-creator/qt-creator/commit/416461c8a176b0f4771a6b498db0382ff8bb6dca) for 4.15 though, maybe this fixes it – user8408080 Feb 01 '21 at 12:43

0 Answers0