[Qt-creator] QML dir hierarchy
alexander.wingard at crosscontrol.com
Wed Jan 4 18:55:18 CET 2017
That can absolutely be done.
Made a quick example:
// This is how the qrc is structured
// And this is how you can address components under prefixes
import QtQuick 2.1
import QtQuick.Controls 1.0
import "qrc:/assets" // NEEDED FOR COMPONENTS UNDER PREFIXES!
title: qsTr("Hello World")
// Available due to the explicit import of qrc:/assets
// Path pattern: "qrc:<prefix>/< path>"
// Tip: You can use aliases in qml.qrc to shorten paths for files in subfolders.
Hope that helped!
making machines smart, safe and productive
From: Qt-creator [mailto:qt-creator-bounces+alexander.wingard=maximatecc.com at qt-project.org] On Behalf Of Jason H
Sent: den 4 januari 2017 16:44
To: interestqt-project.org; qt-creator
Subject: [Qt-creator] QML dir hierarchy
I am cross posting this to QtC and Interest because it's a combinational issue.
My QML projects are getting sizable, I'd like to start breaking my QML resources down in a hierarchy, but my attempt at that has failed.
I'd like to break it down into:
- Screens /
- Components /
But I was not able to accomplish this in QtC. So I hacked the QRC file to have two prefix entries: <qresource prefix="/screens"> and <qresource prefix="/components"> However this resulted in errors.
Also, in QtC they weren't folderized, they just appeared as screens/Screen1.qml ...
How can I accomplish a folderized QRC? Currently, the filesystem is flat, but I don't mind adding them to actual folders if that would help.
Qt-creator mailing list
Qt-creator at qt-project.org
Actuant Corporation Email Notice
This message is intended only for the use of the Addressee and may contain information that is PRIVILEGED and/or CONFIDENTIAL.
This email is intended only for the personal and confidential use of the recipient(s) named above. If the reader of this email is not an intended recipient, you have received this email in error and any review, dissemination, distribution or copying is strictly prohibited.
If you have received this email in error, please notify the sender immediately by return mail and permanently delete the copy you received.
More information about the Qt-creator