Tutorial QML is missing 2 things: where to start and how to run !
-
I'm referring to this:
https://qt-project.org/doc/qt-5.1/qtquick/qml-tutorial1.htmlI'm downloading Qt just now for the first time.
The tutorial start with code, but ... where must i write this ?After the 3rd page, the first app is complete. But.. how to compile and run ?
Why Qt doc is so ... poor ?
-
Come on, it's so easy. Take a look at the bottom of the page at "Viewing the example".
...For example, to run the provided completed Tutorial 1 example from the install location, you would type:
qmlscene tutorials/helloworld/tutorial1.qml... -
Uhm... I loaded from the QtCreator "Application Exampl"
I click 'Run' and it told me :
":-1: error: Qt Creator needs a compiler set up to build. Configure a compiler in the kit options."... This is my OOBE (Out of box experience)...
I'll try to install 'some other components' from package manager.
-
[quote author="realtebo" date="1374180436"]I'm referring to this:
https://qt-project.org/doc/qt-5.1/qtquick/qml-tutorial1.html
I'm downloading Qt just now for the first time.
The tutorial start with code, but ... where must i write this ?After the 3rd page, the first app is complete. But.. how to compile and run ?
Why Qt doc is so ... poor ?[/quote]Hi,
-
First, any text editor can be used to create the .qml file. such as notepad.exe, gedit, kwrite, ...
-
Then, pass the .qml file to the qmlscene tool
That's all.
-
-
[quote author="realtebo" date="1374182981"]Uhm... I loaded from the QtCreator "Application Exampl"
I click 'Run' and it told me :
":-1: error: Qt Creator needs a compiler set up to build. Configure a compiler in the kit options."... This is my OOBE (Out of box experience)...
I'll try to install 'some other components' from package manager. [/quote]
Hi, which type of application are you trying to open?
- Qt Quick UI
- Qt Quick Application
The former contains .qml/.js files only, no compiler is needed, can be run through qmlscene
The latter contians .qml/.js files and .cpp/.h files, they should be compiled to generate a exe file, which can be run by double click.
-
File->Open File or Project->Qt Quick2 application(build in type)
Write your codes, and click run, well to go
If you need better control, please google how to use qmake
-
I've opened an example named "Application Example", so I think is a Qt Application, NOT a Quick, but when i press the red 'Play' button, it complain about compiler .... I'll retry to reinstall ...
-
Two questions:
Which build of Qt did you install?
Do you have a compiler that matches your answer for question #1?
-
- I downloaded the latest qt installer, so I think it's the lates Qt stable build
- I've no idea where can I found an answer to question #1. It's the reason I asked here... I downloaded, opened, run, ... error .... This evening (in Italy), I'll retry a full reinstall, but, I repeat, that's a completly negative OOBE.
-
You can find which version you have in the installer name. Also if It asks you for a compiler you likely have installed one of the MSVC flavor which requires that you have the according Visual Studio installed. If you don't want that go for the mingw version which have the compiler bundled.
Hope it helps
-
[quote author="realtebo" date="1374219330"]1. I downloaded the latest qt installer, so I think it's the lates Qt stable build
2. I've no idea where can I found an answer to question #1. It's the reason I asked here... I downloaded, opened, run, ... error ....[/quote]By "which build did you install?", I meant which one of these did you install?:- 32-bit, MinGW 4.8, OpenGL?
- 32-bit VS 2010?
- 32-bit VS 2010, OpenGL?
- 64-bit VS 2012?
- 64-bit VS 2012, OpenGL?
- etc.
If you download "Qt 5.1.0 for Windows 32-bit (VS 2010, 505 MB)", then you'll need to download the 32-bit Visual Studio 2010 compiler from Microsoft too.
On the other hand, if you download "Qt 5.1.0 for Windows 32-bit (MinGW 4.8, OpenGL, 666 MB)", you don't need to download a separate compiler because it is already included in the package (the downloads page says "The MinGW binary package includes a 32 bit MinGW-builds (gcc 4.8.0, dwarf exception handing, posix threading) toolchain")
-
[quote author="realtebo" date="1374182981"]Uhm... I loaded from the QtCreator "Application Exampl"
I click 'Run' and it told me :
":-1: error: Qt Creator needs a compiler set up to build. Configure a compiler in the kit options."... This is my OOBE (Out of box experience)...
I'll try to install 'some other components' from package manager. [/quote]
Just install a compiler like g++
sudo apt-get install g++ -
Please tell us which OS you are using and show us the link of the
Qt you download. -
I downloaded
I re-installed with ALL of mingW and VC I've seen.
The problem is still here. -
This evening i'll retry removing ALL and then installing a clean version using a precise installer, not the installer. Sorry for time lost.
-
Even with the online installer, only install one version of Qt.
Also, I would recommend you choose one with MinGW, so you won't have to install an additional compiler
-
[quote author="SGaist" date="1374237696"]Even with the online installer, only install one version of Qt.[/quote]Agreed. This will minimize the risk of your system mixing versions together (installing all of them makes things harder, not easier)
[quote author="SGaist" date="1374237696"]Also, I would recommend you choose one with MinGW, so you won't have to install an additional compiler[/quote]Almost. In the online installer, you'll need to select the MinGW compiler to download it. (The difference with MSVC is that you'll need to go to the Microsoft website to get MSVC -- MinGW can be obtained through this installer)
[quote author="realtebo" date="1374237102"]This evening i'll retry removing ALL and then installing a clean version using a precise installer, not the installer. Sorry for time lost.[/quote]Good idea. These are the recommended options:
!http://i.imgur.com/LfwIYiS.png(Qt 5 Online MinGW options)!Don't worry about time lost; the first step is always the hardest. Things will get much nicer later :)
-
Maybe Qt should have a better guide to show the users how to install, compile, link and execute the program step by step on three platforms--windows, mac and linux?Better document could help many users get into the realm of Qt(like how to install Qt with graphics).
Like bjarne said, even c++ is a huge and complicated language, when we get used to it, we may treat those "arcane" concepts or syntax in c++ as "basic staffs", but they are still "arcane creatures" for others(I forgot the original words, but the meaning should be the same).How to setup Qt under different environment is the same, especially today there are many classes don't teach students(I am one of them, since I am not a CS student but an EE student, this may make sense) what is the relationship between linker, compiler and makefile, they just give them an IDE and show them how to codes.
-
@JKSH JKSH Ah ... a picture has more value than one houndred words !!! Thanks
Now I'll remove ALL and reinstall like received suggestion