how to use .qmlproject .ui.qml forms from Design Studio in Qt Creator .pro project?
-
I'm involved in a project that has a designer working in Design Studio to develop
.ui.qmlforms (with related assets) and me, the developer, working on an existing Qt Creator.proproject. 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.qmlresources from the.qmlprojectin the QtQuick QML files in my.proproject.Thanks for any an all pointers.
-
Hi, @alpartis. Do you check this https://doc.qt.io/qtdesignstudio/quick-converting-ui-projects.html?
@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:
- set up a separate
qds_project.qrcresource file in the application workspace that contains references to the desired.ui.qmlfiles from the QDS project with relative path names as well as analiasattribute on the<file/>elements:
<qresource prefix="/forms"> <file alias="AForm">../other_workspace/AForm.ui.qml</file> </qresource>- add an
import "qrc:/forms"to my application.qmlwrapper resource file(s)
- set up a separate
-
Hi, @alpartis. Do you check this https://doc.qt.io/qtdesignstudio/quick-converting-ui-projects.html?
-
Hi, @alpartis. Do you check this https://doc.qt.io/qtdesignstudio/quick-converting-ui-projects.html?
@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:
- set up a separate
qds_project.qrcresource file in the application workspace that contains references to the desired.ui.qmlfiles from the QDS project with relative path names as well as analiasattribute on the<file/>elements:
<qresource prefix="/forms"> <file alias="AForm">../other_workspace/AForm.ui.qml</file> </qresource>- add an
import "qrc:/forms"to my application.qmlwrapper resource file(s)
- set up a separate
-
@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:
- set up a separate
qds_project.qrcresource file in the application workspace that contains references to the desired.ui.qmlfiles from the QDS project with relative path names as well as analiasattribute on the<file/>elements:
<qresource prefix="/forms"> <file alias="AForm">../other_workspace/AForm.ui.qml</file> </qresource>- add an
import "qrc:/forms"to my application.qmlwrapper resource file(s)
- set up a separate
-
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
-
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