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?

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 26 Apr 2021, 00:15 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
    • O oria66
      26 Apr 2021, 14:16

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

      A Offline
      A Offline
      alpartis
      wrote on 30 Apr 2021, 04:08 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)
      O 1 Reply Last reply 1 May 2021, 19:36
      1
      • O Offline
        O Offline
        oria66
        wrote on 26 Apr 2021, 14:16 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 30 Apr 2021, 04:08
        0
        • O oria66
          26 Apr 2021, 14:16

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

          A Offline
          A Offline
          alpartis
          wrote on 30 Apr 2021, 04:08 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)
          O 1 Reply Last reply 1 May 2021, 19:36
          1
          • A alpartis
            30 Apr 2021, 04:08

            @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)
            O Offline
            O Offline
            oria66
            wrote on 1 May 2021, 19:36 last edited by oria66 5 Jan 2021, 19:38
            #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 3 Apr 2022, 18:32 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 29 Jan 2024, 09:37
              3
              • A afalsa
                3 Apr 2022, 18:32

                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 29 Jan 2024, 09:37 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