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. how to use .qmlproject .ui.qml forms from Design Studio in Qt Creator .pro project?
QtWS25 Last Chance

how to use .qmlproject .ui.qml forms from Design Studio in Qt Creator .pro project?

Scheduled Pinned Locked Moved Solved QML and Qt Quick
design studioformsqmlnewbiecreator
6 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.
  • A Offline
    A Offline
    alpartis
    wrote on last edited by
    #1

    I'm involved in a project that has a designer working in Design Studio to develop .ui.qml forms (with related assets) and me, the developer, working on an existing Qt Creator .pro project. I would like to keep the two projects in separate repositories.

    I'm certain that this is not a new request, but in my initial searches here in the forums, etc. I have not found the information I'm seeking.

    Can I be pointed to a tutorial that covers this? Or a wiki page? Or some other resource on the web that explains how to do what I want to do i.e. use the .ui.qml resources from the .qmlproject in the QtQuick QML files in my .pro project.

    Thanks for any an all pointers.

    1 Reply Last reply
    0
    • oria66O oria66

      Hi, @alpartis. Do you check this https://doc.qt.io/qtdesignstudio/quick-converting-ui-projects.html?

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

      @oria66 Yes, I had read through that portion of the Design Studio manual, but it was still unclear what alternative there is to either copying the resources from the QDS project workspace into the .pro application workspace, or creating the application project from the QDS project in the same workspace.

      Two things helped me achieve the results I was seeking:

      1. set up a separate qds_project.qrc resource file in the application workspace that contains references to the desired .ui.qml files from the QDS project with relative path names as well as an alias attribute on the <file/> elements:
      <qresource prefix="/forms">
          <file alias="AForm">../other_workspace/AForm.ui.qml</file>
      </qresource>
      
      1. add an import "qrc:/forms" to my application .qml wrapper resource file(s)
      oria66O 1 Reply Last reply
      1
      • oria66O Offline
        oria66O Offline
        oria66
        wrote on last edited by
        #2

        Hi, @alpartis. Do you check this https://doc.qt.io/qtdesignstudio/quick-converting-ui-projects.html?

        The truth is out there

        A 1 Reply Last reply
        0
        • oria66O oria66

          Hi, @alpartis. Do you check this https://doc.qt.io/qtdesignstudio/quick-converting-ui-projects.html?

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

          @oria66 Yes, I had read through that portion of the Design Studio manual, but it was still unclear what alternative there is to either copying the resources from the QDS project workspace into the .pro application workspace, or creating the application project from the QDS project in the same workspace.

          Two things helped me achieve the results I was seeking:

          1. set up a separate qds_project.qrc resource file in the application workspace that contains references to the desired .ui.qml files from the QDS project with relative path names as well as an alias attribute on the <file/> elements:
          <qresource prefix="/forms">
              <file alias="AForm">../other_workspace/AForm.ui.qml</file>
          </qresource>
          
          1. add an import "qrc:/forms" to my application .qml wrapper resource file(s)
          oria66O 1 Reply Last reply
          1
          • A alpartis

            @oria66 Yes, I had read through that portion of the Design Studio manual, but it was still unclear what alternative there is to either copying the resources from the QDS project workspace into the .pro application workspace, or creating the application project from the QDS project in the same workspace.

            Two things helped me achieve the results I was seeking:

            1. set up a separate qds_project.qrc resource file in the application workspace that contains references to the desired .ui.qml files from the QDS project with relative path names as well as an alias attribute on the <file/> elements:
            <qresource prefix="/forms">
                <file alias="AForm">../other_workspace/AForm.ui.qml</file>
            </qresource>
            
            1. add an import "qrc:/forms" to my application .qml wrapper resource file(s)
            oria66O Offline
            oria66O Offline
            oria66
            wrote on last edited by oria66
            #4

            @alpartis yes, indeed. That's the only way I use it. Consider marking this post as "SOLVED".

            The truth is out there

            1 Reply Last reply
            0
            • A Offline
              A Offline
              afalsa
              wrote on last edited by
              #5

              Hello @alpartis

              Thank you for the info. What about import statement of Qt Desing Studio project (in my Qt Creator project)?

              import QtQuick
              import QtQuick.Controls
              import MyQTDesignStudioProject  ###(my project)
              

              I manage to import the ui.qml file but of course, it has the import "MyQTDesignStudioProject" and I get the error:

              "Qml module not found (MyQTDesignStudioProject)"
              or
              "module "MyQTDesignStudioProject" is not installed"

              Are there any extra steps I'm missing? (QML_DESIGNER_IMPORT_PATH? Another path?)

              Thanks, afalsa

              M 1 Reply Last reply
              3
              • A afalsa

                Hello @alpartis

                Thank you for the info. What about import statement of Qt Desing Studio project (in my Qt Creator project)?

                import QtQuick
                import QtQuick.Controls
                import MyQTDesignStudioProject  ###(my project)
                

                I manage to import the ui.qml file but of course, it has the import "MyQTDesignStudioProject" and I get the error:

                "Qml module not found (MyQTDesignStudioProject)"
                or
                "module "MyQTDesignStudioProject" is not installed"

                Are there any extra steps I'm missing? (QML_DESIGNER_IMPORT_PATH? Another path?)

                Thanks, afalsa

                M Offline
                M Offline
                moussavie
                wrote on last edited by
                #6

                @afalsa same here

                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