[solved]I cant use qrc files in my project
-
hi .
i make a text file and write this code on it :<!DOCTYPE RCC><RCC version="1.0">
<qresource>
<file>qml.qml</file>
</qresource>
</RCC>and save it as a qrc file .
whene i add this qrc file to my project qmlf.qrc and that .qml file are shown .
but whene i use it in my code it not work .QFile file("qrc:/qml.qml"); if (file.exists())msg.setText("exist"); else msg.setText("False"); msg.exec();
and return false .
(i use minGw and I have this proble whene use short path of file and I have to write complate path of files that i want to use even that file exist in my current )
-
hi .
i make a text file and write this code on it :<!DOCTYPE RCC><RCC version="1.0">
<qresource>
<file>qml.qml</file>
</qresource>
</RCC>and save it as a qrc file .
whene i add this qrc file to my project qmlf.qrc and that .qml file are shown .
but whene i use it in my code it not work .QFile file("qrc:/qml.qml"); if (file.exists())msg.setText("exist"); else msg.setText("False"); msg.exec();
and return false .
(i use minGw and I have this proble whene use short path of file and I have to write complate path of files that i want to use even that file exist in my current )
-
@p3c0
its amazing!
QFile work OK!QFile file(":/qml.qml"); if (file.exists())msg.setText("exist"); else msg.setText("False"); msg.exec();
return exist
but QQmlComponent no !
QQmlEngine engine; QQmlComponent component(&engine,":/qml.qml"); QObject *object = component.create();
it return :
QQmlComponent: Component is not ready :( -
@p3c0
its amazing!
QFile work OK!QFile file(":/qml.qml"); if (file.exists())msg.setText("exist"); else msg.setText("False"); msg.exec();
return exist
but QQmlComponent no !
QQmlEngine engine; QQmlComponent component(&engine,":/qml.qml"); QObject *object = component.create();
it return :
QQmlComponent: Component is not ready :(