Can I run .qml files in CommandPrompt or PowerShell?
-
Forgive me ,i make a serious mistake.....it's .qml not .xml..
When i write a python,i can run this file(.py) by some IDE like "PY Charm",but i also can execute file(.py) in CommandPrompt or PowerShell like this
python E:/HelloWorld.py
So,if i write a QML file,like "E:/HelloQML.qml"
import QtQuick Rectangle{ width: 200 height: 50 Text{ anchors.centerIn: parent text:qsTr("Hello QML") } }
Can I execute "E:/HelloQML.qml" by CommandPrompt or PowerShell like
xxx E:/HelloQML.qml
-
@qazaq408
Start by reading The Whole Shebang - Running QML Files Directly. It's 10 years old, but often Qt stuff remains the same!It looks like there should be an executable program
qml.exe
under Windows --- assuming it exists for that OS. However in any case note the author statesThe usefulness of this tool is somewhat limited, because it only works for self-contained QML files and most real-world applications have some C++ code. However, it can be useful for applications such as tests and small demo programs. You might want to consider using it for small applications that you would have normally written as a shell script, but with QML (and JavaScript) can be done in a more portable way, as well as supporting a graphical user interface.
-
Q qazaq408 has marked this topic as solved on