Results 1 to 8 of 8

Thread: Learning Path for Qt

  1. #1
    Join Date
    Mar 2014
    Posts
    15
    Thanks
    1
    Qt products
    Qt5
    Platforms
    Unix/X11

    Question Learning Path for Qt

    Hi all

    I have some general knowledge of C++ picked up 20 yrs ago in programming courses. I have done some javascript, php and sql, and bits of BASIC and VisualBasic. I am trying to learn Qt 'from the ground up'. The examples and tutorials I have found are mostly for versions <5.2 and suffer from an almost complete lack of explanation. In the 'textedit' example there is a line - #include "ui_textfinder.h" - wherein a file (ui_textfinder.h) is included that doesn't appear to exist and there is no real explanation of where this came from or where it is, just some vague reference to possibly being auto-generated by uic. And that's just an example of what I've been running into everywhere - or just plain outdated.

    So my question is this: Where do I go to start at "Hello World" and work up from there with clear and unambiguous explanations of what's going on? A good text? I have "An Introduction to Design Patterns in C++ with Qt - 2nd ed" and it's like What? - this is not for beginners! Up-to-date on-line tutorials?

    Any help would be greatly appreciated (I've been swimming round and round in circles for months).

  2. #2
    Join Date
    Sep 2011
    Location
    Bangalore
    Posts
    254
    Thanks
    92
    Thanked 16 Times in 16 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Re: Learning Path for Qt

    This is exactly what you need - http://www.voidrealms.com/index.php?r=tutorial/index
    In there, under Language tab, there's a dropdown box (we call it QComboBox in Qt), select the option Qt.
    For any doubts related to Qt classes, check the documentation.

  3. #3
    Join Date
    Mar 2014
    Posts
    15
    Thanks
    1
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default Re: Learning Path for Qt

    Thank you. Looks good.

  4. #4
    Join Date
    Oct 2012
    Posts
    132
    Thanks
    10
    Thanked 21 Times in 21 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: Learning Path for Qt

    In the 'textedit' example there is a line - #include "ui_textfinder.h" - wherein a file (ui_textfinder.h) is included that doesn't appear to exist and there is no real explanation of where this came from or where it is, just some vague reference to possibly being auto-generated by uic.
    This page of the Qt documentation might answer your question: https://qt-project.org/doc/qt-5.0/qt...a-ui-file.html
    In my opinion the documentation of Qt is good (comparing to other libraries).
    This tutorial is worth a look as well: http://www.digitalfanatics.org/projects/qt_tutorial/

  5. #5
    Join Date
    Mar 2014
    Posts
    15
    Thanks
    1
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default Re: Learning Path for Qt

    Thank you all for your help and suggestions. You are probably right about the docs being pretty good - they certainly are extensive, but they really aren't for 'beginners'; sort of like unix man pages. I'm sure once one gets a better understanding of the fundamentals they are invaluable.

    This might be drifting a little off topic but as it's already been discussed: Is the include file ui_foo.h 'persistent' or is it a 'virtual' file created temporarily by uic? The way I undersand it looks like uic generates the file 'in memory' which is then used further down the build chain and then destroyed after the build is completed. I only say this because I can find no evidence of it in the project folder or on my hard drive.

    TIA
    Last edited by phil_n; 31st March 2014 at 01:32.

  6. #6
    Join Date
    Sep 2009
    Location
    Wroclaw, Poland
    Posts
    1,394
    Thanked 342 Times in 324 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Learning Path for Qt

    The way I undersand it looks like uic generates the file 'in memory' which is then used further down the build chain and then destroyed after the build is completed
    You are right, uic generates ui_*.h files during compilation (using information from *.ui forms), but "ui_" files are not removed from disk - except if you call "make clean" or "make distclean". You can choose a directory for ui_*.h files by setting "UI_DIR=path" in .pro file.

  7. #7
    Join Date
    Mar 2014
    Posts
    15
    Thanks
    1
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default Re: Learning Path for Qt

    Found it in the 'build' directory.

  8. #8
    Join Date
    Apr 2013
    Location
    Prague
    Posts
    258
    Thanks
    3
    Thanked 65 Times in 59 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Learning Path for Qt

    The ui_*.h file(s) are generated from the *.ui files during building your application. You are not writing the ui_*.h files. The file(s) are not removed from the disk after building the app. They are used for compiling (C++) your app. They are registered in the makefile and redone every time the corresponding *.ui file change.

    You need to #include the the ui_*.h file(s) in your code, even if "they do exist" to trigger an "on demand" building them. The files contain C++ classes made from the *.ui files.

    As to Qt: there are 4 books on the web (PDF files) which help greatly:

    (1) Blanchette, Summerfield - C++ GUI programming with Qt4. A good starting point.
    (2) Molkentin - A Book of Qt4. Another good starting point.
    (3) Ezust, Ezust - An Introduction to Design Patterns in C++ with Qt. A basic knowledge of Qt classes is helpful when reading this.
    (4) Summerfield - Advanced Qt programming. Not a "starting point". A very good book but read later.

Similar Threads

  1. QT Learning
    By cuteatul in forum Qt Programming
    Replies: 4
    Last Post: 8th July 2011, 17:25
  2. Learning C++ for Qt
    By dana in forum Newbie
    Replies: 2
    Last Post: 5th May 2010, 21:59
  3. Replies: 8
    Last Post: 17th October 2009, 09:10
  4. Learning by doing
    By skoegl in forum General Discussion
    Replies: 2
    Last Post: 3rd November 2007, 15:18
  5. Learning Qt with C++
    By Philip_Anselmo in forum Newbie
    Replies: 2
    Last Post: 4th May 2006, 23:37

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.