QtCreator cannot find QML modules for QtQuick

Hello o/

I reciently picked up some interest in learning QtQuick. I’ve started a little playground project to build a QtQuick application using Nix: https://gitlab.com/roosemberth/playground-qtquick-test-ha. The project uses a nixpkgs/release-20.03 flake.

I’ve added qtcreator to the shell derivation, however, when I open the main view of the project in the editor I get the error QML module not found (QtQuick.Window) (see https://gitlab.com/roosemberth/playground-qtquick-test-ha/-/issues/1). I have this error in both 20.03 and 20.09.

I was suggested adding qt5Full to the shell inputs (20.03 only, 20.09 is broken). But this doesn’t help.

Moreover, trying to build the project on 20.03 yields a QtGui/qtguiglobal.h: file not found error.

The project build successfully using nix-build, and I’m able to open the aformentioned view using qmlscene main.qml without any problems either. Hence I think this problem is related to my qtcreator configuration.

  • Do you have any ideas on what could be misconfigured or missing?
  • Is anyone able to reproduce? (for convinience, you may run nix develop -c qtcreator . (or nix-shell --run 'qtcreator .') from the top of the repo).

Cheers!
Roos

1 Like

I’ve managed to get it working. In order to do so, I had to do the following things:

  • Update to nixos-20.09 (commit).
  • Use Qt514 instead of Qt515 (since qtwebkit-5.212.0-alpha4 is broken but is part of qt5.full). If you don’t need all Qt5 modules, you can probably skip this.
  • Clear my user’s QtProject config (original post suggesting this).
  • Clear my project’s .pro.user file.

Upon restarting qtcreator I had to reconfigure the project. In the Qt section, two versions were available (one with path qtbase and another with path qtfull. I chose the qtfull in the Qt version field of my kit.

Cheers!

2 Likes