Nominate our 2022 Qt Champions!

How to learn Qt Quick

  • Hi all,

    I have started reading this book about QML and Qt Quick but it's very confusing. I can't imagine how the reader(s) have thought someone who wants to learn Qt Quick uses their book! Probably they have written their book for professionals. OK, so why do professional need to read their book?!!

    Please have a look at here and read 2.3 to 2.4
    It says about many types of applications but it doesn't speak about how to create the apps! We are not magicians.

    I don't know why whatever I read on Qt, it's not clear at all.

    I've learnt C++ by the book Programming Principles and Practice using C++, one of the most complex books on C++, it has never been that confusing for me.

    The problem with the Qt tuts/books is that they think we do not need details and know many things on Qt. If we know many thing on Qt we would not need to read those so-called books/tuts.

  • Lifetime Qt Champion


    You do realise that this particular book is written by people on their spare time ? They are trying to provide a nice tool to help people get started aside the documentation and you are invited to make suggestion to improve it.

    One thing I agree with you on is that most of the books written about Qt expect that the reader has gone through one or more of the tutorials found in Qt's documentation. Documentation which covers all aspects of Qt's feature like signals and slots, model view programming etc.

    You should also take into account that Qt is a very big framework. Even after several years of use you likely won't have touched every part of it.

  • The problem exists with the Docs too. And the sadness is that.
    If the Docs were really good on teaching the newcomers of Qt programming I would certainly only use them.

    In both the book and Docs, there are points in each project that I get stuck because it's not explained there and then don't know what to do.
    The bigger problem is that this will be repeated almost in every project!

    What can I do in this situation?

  • Well, you've done the
    Progress until you stuck.
    Forums and book

    Sometimes: the example projects give you enough to understand what you didn't know.
    In the Welcome screen, there's Projects, Examples and Tutorials. These are actually really helpful and have bailed me out many times just tinkering to make little changes.

    I won't try to teach or preach to you but what I've discovered is:
    Instead of trying to understand everything, focus on just getting a working solution and break it in little bits and it's not entirely stupid if it works!
    If you can gut an example application and get something. Hey! It works - you solved the build problems :)
    Don't make too many changes at one time so you know what you did == broken.

    You sound inquisitive, I'm the same I just want to know everything and understand everything. I like knowing every detail - but this will be an enemy to progress at times and that's the game, to keep making progress, there is a time to just say it's a magic black box that does the magic you need. Only open it when you really need to.

  • Your attitude is applied for various fields of study and acceptable (or the only acceptable solution) for many learners, but, just like you, I'm not like that! The reason is just the one in your mind!

    I know this may make me exhausted and tired and regret of choosing the programming as a working job, but I need to go on.
    Anyway, I think I should read the books (one on Qt and another on QML) and if I have problems I use Google and forums (after thinking enough and not getting a solution for the problem).

    I thank you for the experience you offered as a help.

  • All good mate, I won't dissuade you in learning what you need. Just wasn't sure what your priorities were.

    Sometimes it helps to come up for air and sidestep the head on approach :-) and sometimes you do just have to smash it though. I'm sadly not so great with Build setup etc and haven't had a v1 release yet so ... I'd help if I could and had more experience.

    One other thing that is really useful but sadly rare for a sole developer of a team is peer programming sessions.
    It's such an valuable experience to solidifying / proving / breaking your (mis)understandings - as well as drawing on a different perspective and experience.

    I used to have a bigger team, but now it's just me. Lucky I have a hands on boss who is like my sounding board. It's almost as good. And yea, sorry I can't help more!

  • Hi,

    You can find a great tutorial for starting out with Apps and Qt here. The tutorial is tailored for V-Play apps, but the concepts are applicable for all Qt apps.


  • Moderators

    @tomy said in How to learn Qt Quick:

    Please have a look at here and read 2.3 to 2.4
    It says about many types of applications but it doesn't speak about how to create the apps! We are not magicians.

    I don't know why whatever I read on Qt, it's not clear at all.

    One of the issues is that there's a distinction between Qt (the framework) and Qt Creator (the IDE). It is not strictly necessary to use Qt Creator to develop Qt applications. For example, @ambershark in uses the command line instead of Qt Creator. From the point of view of the command line tools, there is no difference between a Console Application vs. a Widget Application -- the steps to set up either are basically the same. Therefore, many tutorials/documentations are environment-agnostic.

    What would be useful is a tutorial that shows us how to achieve the same thing using different tools.

    Anyway, I believe you might find this a better starting point: (in particular, see "Creating a Qt Quick Application"). It shows you how to set up the project using Qt Creator, followed by basic code for a functioning application.

  • Moderators

    @Lorenz said in How to learn Qt Quick:

    You can find a great tutorial for starting out with Apps and Qt here. The tutorial is tailored for V-Play apps, but the concepts are applicable for all Qt apps.

    Hi @Lorenz,

    The OP is looking for information on how to set up a project. Unfortunately, the tutorial you linked does not contain such information.

  • @tomy I think your biggest problem here is you are trying to learn too much at once.

    Most of us (assuming here) knew C++ quite well before we tackled Qt. And I would also imagine most of us knew how to write native C++ GUIs on at least one of the operating systems before starting Qt.

    So you are really starting out without any of the base knowledge you need. You don't know how to use compilers, build systems (cmake, autotools, etc), or truly understand the C++ language.

    All these make it a lot harder. So maybe instead of trying to tackle everything at once you can take some steps back and learn each base piece a little better.

    C++ is one of the toughest languages to learn. It has some syntax nightmares compared to other languages. You also need to manage everything from memory down to data structure packing. It can be really difficult if you haven't spent some serious time learning.

    As mentioned above I prefer the command line, but that was a habit I developed long ago while learning. It helps you understand what is actually happening in your IDE if you can do it manually without the GUI IDE helping you. Maybe take a step back there and understand the build tools and process.

    I read that same QML book as I started learning qml last month, and I found it to be very easy to understand and implement. I had to learn from the Qt docs as well. They are quite well written though. The only reason I ended up turning to that book was having some serious keyboard focus issues in the app I was developing.

    So to sum up, don't expect to learn this stuff over night. You will be working long and hard hours for many years to get good at programming. But it should be fun. If you don't love it I highly recommend a different career choice. There are much easier to do jobs if you just want money. :)

  • @ambershark

    I loved programming, read most of the book PPP of the creator of C++
    I've only learnt console apps form that book. I went for qt as the first and only way for GUI apps. so Qt is new for me and QML is very new.

    I think you recommend me working on Linux to solve many issues, like the ones I stated here. Some time later I will start Linux.

    I don't want to learn too much at the start. I simply pay more attention to the stuff written in a page (of a book for example), and I think it's needed to be accurate.

    Now, do you think I've forgotten some stuff to read before entering to QML (or even Qt)?

  • @tomy The declarative part of QML is pretty straightforward to learn but before long you have to know javascript, just declaring objects and bindings isn't enough for most real life applications. Fortunately it has many similarities with C++ (and other C-style languages).

    Programming with Qt doesn't require much knowledge of C++ if you compare the required knowledge to the whole language. You don't even have to create any templates, just use them. A common problem when coming from command line interfaces (which are used in tutorial books) is to orientate to event-driven programming. Signals and slots are one of the most important parts of Qt and is not part of standard C++. Models and views are difficult IMO. But those and anything else are in some form or another common to any application framework.

    Then there is this toolchain issue. We all are familiar with your feelings when we read instructions which should be simple but leave out something we don't know. It feels very frustrating when you have to learn 10 new things before being able to complete one simple task, just because the required pre-knowledge doesn't come automatically. But there's no escaping it and you just have to patiently learn. Just pray you never have to learn GNU autotools, sometimes called autohell...

  • @Eeli-K

    You don't even have to create any templates, just use them

    It's correct in other aspects of programming too.
    You don't have to create functions.
    You don't have to create structs/classes.
    You don't have to create containers.
    You don't have to create exception catching.
    You don't have to put white spaces.
    You don't have to supply comments.

    In reality, none on the above is a must; they are utilities, just like templates.
    And yes, Qt is a library for picking the things, but I use the C++ knowledge I've spent much time for it, and love it forever.

    being able to complete one simple task

    What is that simple task in your point of view?

    Look mate, I know your purpose is helping me but please do not underestimate what I've gathered through hard working.
    For example, I learnt English just by myself (only by books with no need to attend any class!)

  • Back to the issue, I go on reading the two books (qt and QML) and some time later install a Linux alongside windows 10 x64 and continue the works. If there is another language needed for me, no worries, I begin and will work on it too.

  • @Eeli-K said in How to learn Qt Quick:

    Just pray you never have to learn GNU autotools, sometimes called autohell...

    So glad things like cmake exist now. I remember using autotools a lot, it was awful!

  • @tomy said in How to learn Qt Quick:

    Now, do you think I've forgotten some stuff to read before entering to QML (or even Qt)?

    Well it's not so much forgetting to read something, it's just spending the time actually using what you've learned. I.e. C++. Pick a program you can write with C++, something command line so you don't need to use a GUI at all.

    It could be anything.. just think of something you always wanted to make your computer do. Then write that program. For me my first program was an application launcher. This was back when there was no windows only DOS. And I wanted a program to launch other apps for me. So that's what I did.

    Anyway, once you write some actual programs (not just tutorial based stuff) you will start to understand the language better and what kind of pitfalls you will run into. You will also get some experience debugging as you are bound to have dangling pointers, uninitialized memory, etc, that will cause crashes.

    So at this point it's less about books and tutorials and more about learning to actually apply your knowledge. Once you can do that, then move on to the next step which could be learning Qt for the GUI aspect. Although you can start here if you like, it will just be a bit harder.

    Instead of tackling more and more technologies though try to focus on what you're actively learning. I am a fast learner. Like very fast. I learned enough python to write an application in a weekend. It took me about 4 years to get good with C++. That should put it in perspective for you. It is going to take a lot of time to get good enough to really understand this stuff. During those 4 years I wrote code for my own applications all day every day. If I was awake I was coding it felt like. I had a ton of fun, and at the end of that even scored some clients and made some money writing websites (in C++, lol).

  • @ambershark
    Please look, my C++ is good. It's a long time I'm dealing with it.
    I think my shortage is of Qt, QML, Linux and using CLI more than an ordinary Windows user.
    Points will be achieved, and the only need is continuing the way! :-)

  • @tomy Sorry if I sound patronizing or something. I just tried to answer your question "do you think I've forgotten some stuff to read before entering to QML (or even Qt)?" I said you may need javascript but no more C++ than just basics (which you already know, and more). In your first post you also ranted about the difficulty of not knowing the tools, and I can relate to that, I know the feeling. "You don't even have to create any templates, just use them" meant that C++ knowledge required by Qt is easy; creating templates and knowing when to create them is more difficult than using ready-made templates and Qt requires only using ready-made templates, that's why I used it as an example.

  • you may need javascript

    Yes, I've heard much about it in apps having good GUIs. I will keep it in mind too.
    Thank you.

Log in to reply