Make qrc path aliases the same as filesystem ones
This commit is contained in:
parent
ddd1587b7d
commit
b867584784
|
@ -66,8 +66,7 @@ file_content += '<RCC version="1.0">'
|
||||||
file_content += '<qresource prefix="/">'
|
file_content += '<qresource prefix="/">'
|
||||||
|
|
||||||
for(file, RESOURCE_FILES) {
|
for(file, RESOURCE_FILES) {
|
||||||
alias = $$replace(file, src/, '')
|
file_content += ' <file alias="$$file">../$$file</file>'
|
||||||
file_content += ' <file alias="$$alias">../$$file</file>'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
file_content += '</qresource>'
|
file_content += '</qresource>'
|
||||||
|
|
|
@ -23,11 +23,11 @@ int main(int argc, char *argv[]) {
|
||||||
objectContext->setContextProperty("debugMode", false);
|
objectContext->setContextProperty("debugMode", false);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
QFileInfo qrcPath(":/qml/Window.qml");
|
QFileInfo qrcPath(":src/qml/Window.qml");
|
||||||
|
|
||||||
QQmlComponent component(
|
QQmlComponent component(
|
||||||
&engine,
|
&engine,
|
||||||
qrcPath.exists() ? "qrc:/qml/Window.qml" : "src/qml/Window.qml"
|
qrcPath.exists() ? "qrc:/src/qml/Window.qml" : "src/qml/Window.qml"
|
||||||
);
|
);
|
||||||
component.create(objectContext);
|
component.create(objectContext);
|
||||||
|
|
||||||
|
|
|
@ -163,7 +163,7 @@ class Theme(ConfigFile):
|
||||||
|
|
||||||
|
|
||||||
async def default_data(self) -> str:
|
async def default_data(self) -> str:
|
||||||
async with aiofiles.open("src/themes/Default.qpl", "r") as file:
|
async with aiofiles.open("src/themes/Default.qpl") as file:
|
||||||
return await file.read()
|
return await file.read()
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -53,7 +53,7 @@ Python {
|
||||||
}
|
}
|
||||||
|
|
||||||
addImportPath("src")
|
addImportPath("src")
|
||||||
addImportPath("qrc:/")
|
addImportPath("qrc:/src")
|
||||||
importNames("python", ["APP"], () => {
|
importNames("python", ["APP"], () => {
|
||||||
loadSettings(() => {
|
loadSettings(() => {
|
||||||
callCoro("saved_accounts.any_saved", [], any => {
|
callCoro("saved_accounts.any_saved", [], any => {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user