QML to .exe
Page |
1 |
I am trying to move from my simple QML files to a windows .exe that I can pass on to management for review. I installed the Visual Studio add-in but it looks like it wants to open a .pro file. All I have is .qml and .qmlproject. Could someone point me in the right direction of what needs done?
26 replies
something like (not tested, just coded here in reply form)
- int main (int argc, char **argv)
- {
- QDeclarativeView view("/path/to/your/Example.qml");
- view.setResizeMode(QDeclarativeView::SizeRootObjectToView);
- view.resize(500,500); //this and prev lines are needed only if you don't have sizes in root element of your qml
- view.show();
- return app.exec();
- }
Save code I wrote you before as main.cpp and run in folder with it
- qmake -project
It will create a .pro file. Open it and find QT var. I think it will contain only
- QT += core gui
make it
- QT += core gui declarative
After it run qmake in this folder with name of .pro file as argument. And after it run make (or nmake, if you are using msvc compiler).
You must log in to post a reply. Not a member yet? Register here!



