Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Call for Presentations - Qt World Summit

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

    QML and Qt Quick
    design studio forms qml newbie creator
    3
    5
    1421
    Loading More Posts
    • 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
      alpartis last edited by

      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 Reply Quote 0
      • A
        alpartis @oria66 last edited by

        @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)
        oria66 1 Reply Last reply Reply Quote 1
        • oria66
          oria66 last edited by

          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 Reply Quote 0
          • A
            alpartis @oria66 last edited by

            @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)
            oria66 1 Reply Last reply Reply Quote 1
            • oria66
              oria66 @alpartis last edited by oria66

              @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 Reply Quote 0
              • A
                afalsa last edited by

                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

                1 Reply Last reply Reply Quote 1
                • First post
                  Last post