Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Qt Creator Pyside6 project QML modules not found
Forum Updated to NodeBB v4.3 + New Features

Qt Creator Pyside6 project QML modules not found

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
4 Posts 2 Posters 937 Views 1 Watching
  • 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.
  • A Offline
    A Offline
    Anonimista
    wrote on last edited by
    #1

    I installed Qt6 in my home directory and am trying to use it for PySide6 Qml projects. I am able to create a project and when prompted I let the Ide download and install PySide6 in the project .qtcreator subdirectory, but when I open a Qml file I get these errors/warnings

    Screenshot_2024-09-25_18-26-06.png

    and the Qml editor autocomplete does not work. The project runs though and the Qml window is shown. Based on the above messages I tried to add my Qt6 installation Qml directory like this

    Screenshot_2024-09-25_18-27-09.png

    This is my Qt6 installation directory

    Screenshot_2024-09-25_18-29-15.png

    When I create a C++ Qml project the Qml editor autocomplete works.

    jsulmJ 1 Reply Last reply
    0
    • A Anonimista

      I installed Qt6 in my home directory and am trying to use it for PySide6 Qml projects. I am able to create a project and when prompted I let the Ide download and install PySide6 in the project .qtcreator subdirectory, but when I open a Qml file I get these errors/warnings

      Screenshot_2024-09-25_18-26-06.png

      and the Qml editor autocomplete does not work. The project runs though and the Qml window is shown. Based on the above messages I tried to add my Qt6 installation Qml directory like this

      Screenshot_2024-09-25_18-27-09.png

      This is my Qt6 installation directory

      Screenshot_2024-09-25_18-29-15.png

      When I create a C++ Qml project the Qml editor autocomplete works.

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @Anonimista said in Qt Creator Pyside6 project QML modules not found:

      I installed Qt6 in my home directory and am trying to use it for PySide6 Qml projects

      Is not going to work - this installation has nothing to do with PySide6. Install PySide packages containing what you need.
      For example on Ubuntu there is python3-pyside2.qtqml to get QML in PySide. How to install these packages (and which packages) depends on how you installed PySide6 and on what distribution.

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      A 1 Reply Last reply
      1
      • jsulmJ jsulm

        @Anonimista said in Qt Creator Pyside6 project QML modules not found:

        I installed Qt6 in my home directory and am trying to use it for PySide6 Qml projects

        Is not going to work - this installation has nothing to do with PySide6. Install PySide packages containing what you need.
        For example on Ubuntu there is python3-pyside2.qtqml to get QML in PySide. How to install these packages (and which packages) depends on how you installed PySide6 and on what distribution.

        A Offline
        A Offline
        Anonimista
        wrote on last edited by Anonimista
        #3

        @jsulm

        Thanks that's a step in the right direction.

        When I created the project I was prompted that Qt Creator needs to create a Python virtual environment and install PySide6. I clicked Ok and the virtual environment was installed in the .qtcreator subdirectory of the project

        The project runs ok and the Qml window is shown. I can add QtQuick controls etc and the only thing that's missing is autocomplete int the Qml editor.

        This is the message from the Qml editor

        Screenshot_2024-09-26_17-15-48.png

        and this is my attempt to appent to QML_IMPORT_PATH in the project environment

        Screenshot_2024-09-26_17-33-59.png

        This doesn't work sadly. The project still executes but the autocomplete is not there

        So after I attempt to add my Qml installation directory to QML_IMPORT_PATH it is not successful and the message still shows QML_IMPORT_PATH without it

        Screenshot_2024-09-26_17-50-10.png

        1 Reply Last reply
        0
        • A Offline
          A Offline
          Anonimista
          wrote on last edited by
          #4

          So after trying all possible suggestions from the yellow popup this is what worked: the untitled9.pyproject file contents

          {
              "qmlImportPaths": [
                  "/home/jon/Documents/QtDesignerProjects/untitled9/.qtcreator/Python_3_12_4venv/lib/python3.12/site-packages/PySide6/Qt/qml/"
              ],
          
              "files": [
                  "main.py",
                  "main.qml"
              ]
          }
          
          

          This is according to the message for Qbs projects, declare and set a qmlImportPaths property...

          Now I can import Qml modules and have autocomplete in the Qml editor

          1 Reply Last reply
          0
          • A Anonimista has marked this topic as solved on

          • Login

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