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 Design Studio project import on Qt creator
QtWS25 Last Chance

Qt Design Studio project import on Qt creator

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
4 Posts 4 Posters 4.5k 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
    matteosperandio
    wrote on last edited by
    #1

    I imported a Qt design studio project on Qt creator following the guide: https://doc.qt.io/qtdesignstudio/quick-converting-ui-projects.html

    After the import of all the modules included Timeline I've tried to run the project.
    The following errors appear:

    qrc:/qml/Cluster_Art.ui.qml:54:1: module "Data" is not installed
    qrc:/qml/Cluster_Art.ui.qml:56:1: module "QtQuick.Studio.Effects" is not installed
    qrc:/qml/Cluster_Art.ui.qml:55:1: module "QtQuick.Studio.Components" is not installed

    Data is a directory under the Qt Design Studio project
    Studio/Components is a directory under the Qt Design Studio project
    Studio/Effects is a directory under the Qt Design Studio project

    Why Qt creator doesn't recognize them?
    What I have to do?

    I'm a newbie please help me.

    Regards

    1 Reply Last reply
    0
    • T Offline
      T Offline
      Thomas Hartmann
      wrote on last edited by
      #2

      You have to add the import path for the imports in main.cpp.
      Before calling setSource() you simply have to add:
      view.engine->addImportPath("qrc:/qml/imports");

      We will adjust the documentation.

      1 Reply Last reply
      2
      • P Offline
        P Offline
        Pratik Tayshete
        wrote on last edited by
        #3
        from PySide2.QtWidgets import QApplication, QMainWindow
        from PySide2.QtQuick import QQuickView
        from PySide2.QtCore import QUrl
        from imports import QtQuick
        app = QApplication([])
        view = QQuickView()
        url = QUrl("Screen01.ui.qml")
        view.engine().addImportPath("imports")
        view.setSource(url)
        view.show()
        app.exec_()
        

        This gives the following error:
        module "Qt.SafeRenderer" is not installed
        module "QtStudio3D" is not installed

        V 1 Reply Last reply
        0
        • P Pratik Tayshete
          from PySide2.QtWidgets import QApplication, QMainWindow
          from PySide2.QtQuick import QQuickView
          from PySide2.QtCore import QUrl
          from imports import QtQuick
          app = QApplication([])
          view = QQuickView()
          url = QUrl("Screen01.ui.qml")
          view.engine().addImportPath("imports")
          view.setSource(url)
          view.show()
          app.exec_()
          

          This gives the following error:
          module "Qt.SafeRenderer" is not installed
          module "QtStudio3D" is not installed

          V Offline
          V Offline
          Vladimir Fekete
          wrote on last edited by
          #4

          @Pratik-Tayshete I know its been a year now (I'm starting with qt / python only now).

          What helped me was to set absolute path instead of qrc. Also it is a good to know what paths are known to the engine (QQmlEngine Class).

          My test application came out of QtStudio 2.0 with internal Qt5 (Tools/QtDesignSstudion/qt5_design_studio_reduced_version). Although I'm not an expert it seems to me that the engine is trying to find the corresponding QML files. Name of the import (QtQuick.Studio.Effects) suggest location of those files (Tools/QtDesignStudio/qt5_design_studio_reduced_version/qml/QtQuick/Studio/Effects)

          So when I changed the default code from project template to this:

          import os
          from pathlib import Path
          import sys
          
          from PySide6.QtGui import QGuiApplication
          from PySide6.QtQml import QQmlApplicationEngine
          
          if __name__ == "__main__":
              app = QGuiApplication(sys.argv)
              engine = QQmlApplicationEngine()
              engine.addImportPath("D:/code/fworks/qtnew/6.1.1/mingw81_64/qml/")
              print(str(engine.importPathList()))
              # path = Path(__file__).resolve().parent / "main.qml"
              path = "main.qml"
              engine.load(os.fspath(path))
              if not engine.rootObjects():
                  print('EE: Cannot get engine rootObjects')
                  sys.exit(-1)
              sys.exit(app.exec_())
          

          Suddenly it recognized the files and import worked (plus the 'print' line prints out all import paths known to engine).

          I still struggle with makeing it run, but I assume problem is that QtStudio (installed via online installer) uses reduced Qt5 and I'm trying to use Qt6. Interestingly, if I point the path to Qt.6.1.1 directory it doesn't work either (but the import path is recognized, so this is a different problem).

          1 Reply Last reply
          0

          • Login

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