Not getting anywhere (Trying to learn how to do QT via an official tutorial)
-
I've recently decided to stick with Qt Creator instead of going through the struggle to try compiling QT apps with sublime text, so I figured I needed some kind of tutorial to get started. http://qt-project.org/doc/qt-5/gettingstartedqml.html <- That is what I found. But I am already stuck...´
My problem is the "label: <text>" part not so far away from the beginning. According to the real-time syntax reader or whatever you call it, that property doesn't exist. Label, that property. I've tried figuring out what the tutorial really wants to say, but I guess I'm better off asking it here instead of going through the unnecessary struggle.
Could some nice guy or girl help me out?
-
Hi, and welcome to the Qt Dev Net!
It is unfortunate that the tutorial is badly-written. It is describing a custom Button, not the "official Button":http://qt-project.org/doc/qt-5/qml-qtquick-controls-button.html -- the official Button does not have the "label" property. This is confusing, and should be changed.
In the meantime, I recommend ignoring that tutorial. Try this one instead: http://qt-project.org/doc/qt-5/qml-tutorial.html
A few more tips:
- The easy way to create a new project is, in Qt Creator, click "File" -> "New File or Project..." -> "Applications" -> "Qt Quick Application" and choose "Qt Quick 2.0". Then, edit the 'main.qml' file that is created for you.
- Run the application by clicking the "Run" button (green arrow), instead of using qmlscene.
By the way, do you have any preferences on which part of Qt to learn first? Essentially, Qt uses 2 languages: C++ and QML.
-
u can get tutorial from qt creator itself. Just click on help option. and all the documentation is available there and examples also. u can get it from there.
-
Hiii Easter-Egg-X,
You are using Qt 5 ,so the contents on Qt 5 is not much available on internet even there is no book on Qt 5. It is under processed I hope so.
see this link--> you can get some suggestions.
http://qt-project.org/forums/viewthread/35794/hope it will help you.
-
http://www.bogotobogo.com/Qt/Qt5_Creating_QtQuick2_QML_Application_Animation_A.php Its not official. but yea.. till an extend its a good tutorial.
-
Thanks for your will to help me out guys. I'll see what other tutorials I can find out there, but meanwhile, I'll finish the tutorial JKSH gave me.
[quote author="JKSH" date="1392772129"]Hi, and welcome to the Qt Dev Net!
It is unfortunate that the tutorial is badly-written. It is describing a custom Button, not the "official Button":http://qt-project.org/doc/qt-5/qml-qtquick-controls-button.html -- the official Button does not have the "label" property. This is confusing, and should be changed.
In the meantime, I recommend ignoring that tutorial. Try this one instead: http://qt-project.org/doc/qt-5/qml-tutorial.html
A few more tips:
- The easy way to create a new project is, in Qt Creator, click "File" -> "New File or Project..." -> "Applications" -> "Qt Quick Application" and choose "Qt Quick 2.0". Then, edit the 'main.qml' file that is created for you.
- Run the application by clicking the "Run" button (green arrow), instead of using qmlscene.
By the way, do you have any preferences on which part of Qt to learn first? Essentially, Qt uses 2 languages: C++ and QML.[/quote]
I dunno, I've already started reading the tutorial (which is much easier to understand than my previous one) and am getting a clearer picture of how QML is, and my impression is that it's good.
I think I will start getting in depth with the QT language first, then try integrating C++ into my applications. You can't reach it's fullest potential unless you combine the two languages, right?
-
[quote]I think I will start getting in depth with the QT language first, then try integrating C++ into my applications. You can’t reach it’s fullest potential unless you combine the two languages, right?[/quote]It depends on what you want to do :)
Qt began as a C++ library. Its C++ features are very mature, and you can create powerful apps using C++ alone. To create a GUI in C++, you can use "Qt Widgets":http://qt-project.org/doc/qt-5/qtwidgets-index.html. This is good for traditional, office-style desktop GUIs.
QML is the exciting new technology that's designed for creating modern, smartphone-style GUIs. However, you can also use it to create traditional-style GUIs. You can also easily embed JavaScript code for logic, so you can create powerful apps using QML alone (example: http://qt-project.org/doc/qt-5/qml-advtutorial.html )
The current recommendation for high-performance apps is to create your GUI with QML, and write your logic in C++. In can be tricky to get started, but once you understand it it's easy to combine QML and C++: http://qt-project.org/doc/qt-5/qtqml-cppintegration-topic.html
-
[quote author="JKSH" date="1393036489"][quote]I think I will start getting in depth with the QT language first, then try integrating C++ into my applications. You can’t reach it’s fullest potential unless you combine the two languages, right?[/quote]It depends on what you want to do :)
Qt began as a C++ library. Its C++ features are very mature, and you can create powerful apps using C++ alone. To create a GUI in C++, you can use "Qt Widgets":http://qt-project.org/doc/qt-5/qtwidgets-index.html. This is good for traditional, office-style desktop GUIs.
QML is the exciting new technology that's designed for creating modern, smartphone-style GUIs. However, you can also use it to create traditional-style GUIs. You can also easily embed JavaScript code for logic, so you can create powerful apps using QML alone (example: http://qt-project.org/doc/qt-5/qml-advtutorial.html )
The current recommendation for high-performance apps is to create your GUI with QML, and write your logic in C++. In can be tricky to get started, but once you understand it it's easy to combine QML and C++: http://qt-project.org/doc/qt-5/qtqml-cppintegration-topic.html[/quote]
Yes indeed it's tricky getting started, but now I'm talking about even solely combining QML with JS. I had a look at using Qt Widgets but I gave up, I felt way too overwhelmed... so I decided to just accept the fact that I may not be ready for that yet, so I thought QML+JS would be a good start since I have experience with javascript (although I've forgot most of it. It's been like half a year since I last used that language, and I only used that for specifically that occasion since I had to use it for AJAX) Now it seems like I'm even too stupid to grasp the basics of the framework. I'm on the verge of giving up. (Well, not really, but I'm just feeling overwhelmed yet again. I'm still trying to figure out how to do what I want to achieve)
I don't really know what I am doing wrong here... still getting nowhere although I really want to make coding into a habit so I have something to do during my free-times. I could really use some extra tips.
-
My advise (as I'm pretty much in the same stage as you… as I just started to learn QML and I am still scare of the C++ side) is to look at what you already achieved. I still have the feeling that QML is a mountain in front of me…but when I look behind, I realize that I'm not in the valley anymore (I have a rough idea of how it works, not scare of the QML style anymore, know how to run a QML code…etc). So don't give up, keep climbing… even if it's slow…. everything step you make (as little as it can be) brings you closer to the top.
Right now, I'm trying to understand what is going on in the QML tutorials (like calc, text editor….). I comment out some of the lines and see what happens…. and my goal, is to start writing a very simple application within a few weeks.
-
The first thing I did when I started with QML was watching this video from Dev Days:
http://www.youtube.com/watch?v=WBf9TbzHBfkAnd I see there is even a more recent one:
http://www.youtube.com/watch?v=Zna1KHQj_8YGood luck, hope it helps.
Some parts of QML are a bit "magical", so I think these videos help out by actually showing what you can do and how. I wouldn't have guessed about some of these.
-
[quote author="Bidochon" date="1393424983"]My advise (as I'm pretty much in the same stage as you… as I just started to learn QML and I am still scare of the C++ side) is to look at what you already achieved. I still have the feeling that QML is a mountain in front of me…but when I look behind, I realize that I'm not in the valley anymore (I have a rough idea of how it works, not scare of the QML style anymore, know how to run a QML code…etc). So don't give up, keep climbing… even if it's slow…. everything step you make (as little as it can be) brings you closer to the top.
Right now, I'm trying to understand what is going on in the QML tutorials (like calc, text editor….). I comment out some of the lines and see what happens…. and my goal, is to start writing a very simple application within a few weeks. [/quote]
Good news is that I've overcome the worst, and I wish you the best of luck too. What I did was forgetting about the javascript part and changed my mindset to just focus on pure QML. I'm finally starting to get a hang of how it possibly could cooperate with other languages such as JS and C++.
It's a good idea to not aim too high and get a feel for what is possible for us to accomplish with the current knowledge and skill. I'm 100% sure there will be more problems to tackle in the future and it could indeed be a scary experience, but the important thing is to be persistent, just like before. I mean, I did get past these overwhelming parts, so why wouldn't I in the future?
And if I ever start feeling too overwhelmed by waves of "No, this is not possible" and it's becoming a dominant thought inside of me, then it's probably a good idea to just forget about it and start on something else, whether it would be aiming lower or going on to other stuff I enjoy to do.
Again, wish you the best.
[quote author="frankiefrank" date="1393425861"]The first thing I did when I started with QML was watching this video from Dev Days:
http://www.youtube.com/watch?v=WBf9TbzHBfkAnd I see there is even a more recent one:
http://www.youtube.com/watch?v=Zna1KHQj_8YGood luck, hope it helps.
Some parts of QML are a bit "magical", so I think these videos help out by actually showing what you can do and how. I wouldn't have guessed about some of these.[/quote]
Awesome, thanks a bunch. I'll check em out.