Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Qt Creator sets wrong QML2_IMPORT_PATH in environment.
Forum Update on Monday, May 27th 2025

Qt Creator sets wrong QML2_IMPORT_PATH in environment.

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 292 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mtty
    wrote on 10 Feb 2023, 15:40 last edited by mtty 2 Oct 2023, 15:45
    #1

    I use Qt Creator 5.0.3 (Based on Qt 5.15.3). I configured the kit and linked qt version (set path to qmake). When I wish to run example QtQuick project (Qt Quick Application - scroll), cmake can build the project but cannot run the result executable.

    The problem is that QML2_IMPORT_PATH points to other Qt framework than the one I configured (linked qt version in Options/Kits/QtVersion). It seems it points to the Qt framework that is used by Qt Creator. My project is Qt6; Qt creator is Qt5.

    I found in the directory with the qmake (linked qt version in Options/Kits/QtVersion) file qt.conf. When I put copy of qt.conf into the build directory of my qt project then I can run the executable (from terminal or form Qt Creator).

    Why Qt Creator corrupts the build environment with wrong QML2_IMPORT_PATH? Why Qt Version is linked wrong? What Qt Creator expects from the qmake executable? Why "linking Qt Version" requires path to qmake executable? Why Qt Creator ignores file qt.conf when I turns out it is important?

    I have source code for the Qt6 so if I knew how Qt Creator uses the qmake I could patch it. Could you point me in the right direction?

    PS. relevant links

    • https://forum.qt.io/topic/125638/qml2_import_path-build-environment-and-project-sharing?_=1676041317847
    • https://doc.qt.io/qt-6/qt-conf.html
    • https://doc.qt.io/qtcreator/creator-project-qmake.html
    1 Reply Last reply
    0

    1/1

    10 Feb 2023, 15:40

    • Login

    • Login or register to search.
    1 out of 1
    • First post
      1/1
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved