QML to .exe
-
wrote on 3 Dec 2010, 19:33 last edited by
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?
-
wrote on 3 Dec 2010, 19:36 last edited by
Is Qmlviewer the right tool?
-
wrote on 3 Dec 2010, 19:36 last edited by
You can write small wrapper (I think Creator already can do it automatically, but not sure) for showing qml.
-
wrote on 3 Dec 2010, 19:38 last edited by
If you could provide me with some more details of how exactly to get from the .qml files to a usable .exe, that would be helpful. Thanks,
Kyle
-
wrote on 3 Dec 2010, 19:48 last edited by
something like (not tested, just coded here in reply form)
@
int main (int argc, char **argv)
{
QApplication app(argc,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();
}
@ -
wrote on 3 Dec 2010, 19:49 last edited by
Can I compile this in any compiler?
-
wrote on 3 Dec 2010, 19:50 last edited by
I don't think that compiler can be problem here. Just make sure you have all needed in your env variables.
-
wrote on 3 Dec 2010, 19:52 last edited by
Where can I download all the environment variables? While I tried to compile, I got a QApplication undeclared error.
-
wrote on 3 Dec 2010, 19:53 last edited by
you have to include them. Sorry I forgot them.
@
#include <QApplication>
#include <QDeclarativeView>
@Also don't forget to add gui and declarative to QT var in your .pro file.
-
wrote on 3 Dec 2010, 19:55 last edited by
Please excuse my ignorance but you will have to explain the last sentence you wrote. I do not have a .pro file, do I need one?
-
wrote on 3 Dec 2010, 19:57 last edited by
Yes, you need a .pro file.
-
wrote on 3 Dec 2010, 19:58 last edited by
Again, forgive my beginner questions but how do I create one? What is it?
-
wrote on 3 Dec 2010, 20:00 last edited by
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).
-
wrote on 3 Dec 2010, 20:12 last edited by
I did every step up until the make command which returned:
make: *** No targets specified and no makefile found. Stop. -
wrote on 3 Dec 2010, 20:17 last edited by
Is there Makefile file created after ?
@
qmake yourproject.pro
@ -
wrote on 3 Dec 2010, 20:19 last edited by
the command executes without an error, but I don't see a makefile
-
wrote on 3 Dec 2010, 20:43 last edited by
What files fo you have in your folder after running this command?
-
wrote on 3 Dec 2010, 20:43 last edited by
1.qml Keyboard.qml
10.qml Map.qml
11.qml MenuTabText.qml
12.qml MenuText.qml
13.qml MenuTitle.qml
2.qml PanMap.qml
25.qml QML.pro
3.qml QMLFinal.qml
4.qml QMLFinal.qmlproject
5.qml QMLFinal.qmlproject.user
6.qml RandNumGenerator.qml
7.qml SetupBars.qml
8.qml SetupBlack.qml
9.qml TabMenu.qml
Back.qml WidgetLarge.qml
CheckBox.qml WidgetSmall.qml
Dashboard.qml build
DropDown.qml keyboard.png
Front.qml main.cpp
GPSWidget.qml main.h
HomeText.qml map.png
Images
Info.plist -
wrote on 3 Dec 2010, 20:46 last edited by
so you run in this folder
@
qmake QML.pro
@
and nothing new appears?
If yes then sorry, but I can't help with problem. Maybe some one more familiar with windows can. -
wrote on 3 Dec 2010, 20:50 last edited by
Try to open this .pro in QtCreator and build it there. I think it will help you.
5/27