Page 1 of 2 12 LastLast
Results 1 to 20 of 23

Thread: Is Qt for GUI only?

  1. #1
    Join Date
    Jan 2011
    Posts
    128
    Thanks
    2

    Red face Is Qt for GUI only?

    Hi guys,I am a new Qt user.I have some C++ experience and decided to start making GUI(after console app.)
    So,my question is:Is Qt only for GUI development,or it can be used to code the "engine"(functionality)of my program as well?

    Thank you.

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Is Qt for GUI only?

    It is not only for programming a GUI. QtCore, QtXml, QtSql etc. all doesn't belong to GUI. So Qt is also quite perfect to code an engine. Just go ahead an you'll see.

  3. #3
    Join Date
    Jan 2011
    Posts
    128
    Thanks
    2

    Default Re: Is Qt for GUI only?

    Quote Originally Posted by Lykurg View Post
    It is not only for programming a GUI. QtCore, QtXml, QtSql etc. all doesn't belong to GUI. So Qt is also quite perfect to code an engine. Just go ahead an you'll see.
    Aha..but can I also add code(for the engine)in my main.cpp file?
    And can you please recommend a good tutorial/book that expalines Qt well?

    Thanks.

  4. #4
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Is Qt for GUI only?

    Quote Originally Posted by "BumbleBee" View Post
    Aha..but can I also add code(for the engine)in my main.cpp file?
    I am sorry, but I don't get you. What do you want to do?
    And can you please recommend a good tutorial/book that expalines Qt well?
    There are a lot of thread about that at the forum. But also my favorite one of Johan Thelin is mainly focused on GUI creation. So better say what kind of library you are planing and we probably point you to the important classes you will need to know. Also the documentation is good enough to learn.

  5. #5
    Join Date
    Jan 2011
    Posts
    128
    Thanks
    2

    Default Re: Is Qt for GUI only?

    Well,when you are coding in a console app. you have the main function,where everything happens,I asked if the file main.cpp hold ass well the code for the engine(like commends besides the GUI..:/)

    And I don't have in mind anything specific right now,I just want to learn using Qt as a normal language....so that I can create any project I like.

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Is Qt for GUI only?

    Qt is not a language. Qt apps are usually written in C++ so everything that applies to any C++ application applies to Qt applications too.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  7. #7
    Join Date
    Jan 2011
    Posts
    128
    Thanks
    2

    Default Re: Is Qt for GUI only?

    Ok,so as I understand I can code(functionality) in Qt...so any good books to get me started?

  8. #8
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Is Qt for GUI only?

    Have you completed the address book tutorial ?

    The documentation is also very good if you don't understand something.

    If you can't find something in the documentation (or don't understand it) then you are welcome to post here.

    There is also a thread on this forum about books, should you prefer to learn that way.

  9. #9
    Join Date
    Jan 2011
    Posts
    128
    Thanks
    2

    Default Re: Is Qt for GUI only?

    Quote Originally Posted by squidge View Post
    Have you completed the address book tutorial ?

    The documentation is also very good if you don't understand something.

    If you can't find something in the documentation (or don't understand it) then you are welcome to post here.

    There is also a thread on this forum about books, should you prefer to learn that way.
    Sorry,what is the adressbook?

  10. #10
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: Is Qt for GUI only?

    Quote Originally Posted by "BumbleBee" View Post
    Sorry,what is the adressbook?
    http://doc.qt.nokia.com/4.7/tutorials-addressbook.html

  11. #11
    Join Date
    Jan 2011
    Posts
    128
    Thanks
    2

    Default Re: Is Qt for GUI only?

    Thank you...
    How much does it usually take to learn Qt and create applications alone?

  12. #12
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: Is Qt for GUI only?

    Quote Originally Posted by "BumbleBee" View Post
    Thank you...
    How much does it usually take to learn Qt and create applications alone?
    Time to learn or time to write?
    Anyway, that's very subjective. It depends from person to person. Some people learn fast or write fast, others require more time and practice.

    What do you already know about computer programming? Do you know any languages? Techniques? ...

  13. #13
    Join Date
    Jan 2011
    Posts
    128
    Thanks
    2

    Default Re: Is Qt for GUI only?

    Quote Originally Posted by tbscope View Post
    Time to learn or time to write?
    Anyway, that's very subjective. It depends from person to person. Some people learn fast or write fast, others require more time and practice.

    What do you already know about computer programming? Do you know any languages? Techniques? ...
    Yes,I have been learning C++ for 2 months(approximately) now,and I have learned everything basic to some advanced stuff(loops,ifs,typedef,structures,classes,inherit ance,polymorphism,pointers,functions....).

    To make you understand better I have completed this,I was reading MSDN'S C++ Beginner Guide parallel with C++ in 21 days,and also read the tutorial at http://www.learncpp.com/

    I have made small projects like TicTacToe game(OOP),a letter counter(from a file,with ifstream....)

    Well,nearly all these...would it be difficult for me to get used to Qt?
    BTW:I downloaded today C++ GUI Programming with Qt 4 (2nd Edition).

  14. #14
    Join Date
    May 2010
    Location
    Romania
    Posts
    1,021
    Thanks
    62
    Thanked 260 Times in 246 Posts
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Is Qt for GUI only?

    Quote Originally Posted by BumbleBee
    ...Yes,I have been learning C++ for 2 months(approximately) now,and I have learned everything basic to some advanced stuff(loops,ifs,typedef,structures,classes,inherit ance,polymorphism,pointers,functions....)...
    I really don't want to disappoint you, but those are only basic stuff.
    Anyway, if you learned and understood OOP topics, you should understand Qt framework pretty fast.

    But don't hurry, always remember that understanding is the key to programming, so don't limit yourself to just tutorials (since tutorial usually don't offer that many explanations): read books, articles, documentation, forums (i have learned a lot about C++ and Qt from forums) etc... and always try to understand the things you read.

    Also it may take longer to get familiar with the "GUI stuff" (since you have done only console applications, i was is the same situation, only standard C++(and STL) for one year, and then Qt as the first GUI framework)
    This link can help with other links to concepts used in Qt framework, if you didn't understood some topic in a book you can browse there for some more information.

    Here you can find my opinion about Foundations of Qt development by Johan Thelin (read the whole topic since you have more books recommendations there)

    And don't forgot about memory management, it's a very important C++ topic so it's also very important Qt topic, even if Qt has some mechanisms that help you with that, you still need understand memory management.

    Happy learning
    Last edited by Zlatomir; 29th January 2011 at 18:42.

  15. #15
    Join Date
    Oct 2009
    Posts
    364
    Thanks
    10
    Thanked 37 Times in 36 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Is Qt for GUI only?

    Good for you to decide on Qt. From all the different IDE (Integrated Development Environments) that I have sampled over the years, I believe Qt has one of the slickest (Qt Creator).

    There are many reasons why Qt is a great choice for learning C++ (and other programming languages). Not only does Qt feature a powerful IDE but if you use diligence (use Qt classes that hide OS specifics), your code will run on different OS's just by recompiling (Cross Platform).

    The built-in GUI designer is top notch in my opinion, and the help system is extensive and features many good examples.

    Please spend some time understanding the Signal/Slot mechanism and the Model/View architecture and you will be well on your way.

    Developers nowadays are fortunate to have such a powerful and free tool at their disposal.

    (This isn't paid advertising - I just wanted to express my gratitude to Nokia and the trolls )

  16. #16
    Join Date
    Jan 2011
    Posts
    128
    Thanks
    2

    Default Re: Is Qt for GUI only?

    Quote Originally Posted by Zlatomir View Post
    I really don't want to disappoint you, but those are only basic stuff.
    Anyway, if you learned and understood OOP topics, you should understand Qt framework pretty fast.

    But don't hurry, always remember that understanding is the key to programming, so don't limit yourself to just tutorials (since tutorial usually don't offer that many explanations): read books, articles, documentation, forums (i have learned a lot about C++ and Qt from forums) etc... and always try to understand the things you read.

    Also it may take longer to get familiar with the "GUI stuff" (since you have done only console applications, i was is the same situation, only standard C++(and STL) for one year, and then Qt as the first GUI framework)
    This link can help with other links to concepts used in Qt framework, if you didn't understood some topic in a book you can browse there for some more information.

    Here you can find my opinion about Foundations of Qt development by Johan Thelin (read the whole topic since you have more books recommendations there)

    And don't forgot about memory management, it's a very important C++ topic so it's also very important Qt topic, even if Qt has some mechanisms that help you with that, you still need understand memory management.

    Happy learning
    What else in your opinion should I learn in order to be ok with Qt...(althought from the moment I started,I don't meet any syntax difficulties,only some complexities of Qt flow.)?
    And with "memory managment",you mean memory allocation?

  17. #17
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Is Qt for GUI only?

    Pointers, classes, inheritance, virtual methods, static methods, overloading and overriding, const methods, casting, basics of templates. That's the least you should know and understand to feel at least a bit comfortable using Qt. Otherwise you'll be struggling all the time.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  18. #18
    Join Date
    May 2010
    Location
    Romania
    Posts
    1,021
    Thanks
    62
    Thanked 260 Times in 246 Posts
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Is Qt for GUI only?

    Quote Originally Posted by BumbleBee
    And with "memory managment",you mean memory allocation?
    Not only that, also difference between stack and heap storage, deletion, life-time of objects (including the life of the pointer used for allocating object on heap), memory leaks...
    And of course the things Qt framework add to help you manage this, i mean the parent-children relationship.
    With Qt classes (most likely the ones for GUI) you will extensively use heap allocation and you will see that you don't need to have a delete statement for each call of new that is because the parent will delete it's children.

    For other things you should know, i don't know, you will probably find a lot of them, just go along with the book/books, tutorials, documentation, articles and remember that understanding is what you are after, not just "hack" a thing that somehow magically works (or worse just looks like it works)

    Whenever you don't understand something, search the documentation site, this site, and if you still have questions, just create a new topic

  19. #19
    Join Date
    Aug 2009
    Location
    Belgium
    Posts
    310
    Thanks
    10
    Thanked 31 Times in 25 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Is Qt for GUI only?

    Hi,

    If you want to write a GUI, and if you plan to use C++, then Qt is definitively your number 1 choice. It is free, and it is much easier to use than any other C/C++ toolkit. Just make sure to use QtCreator.

    Don't let people scare you too much with the things you should know. You know the basics of OOP and C++, and you are obviously willing to learn more. So you'll be able to do quite a lot already with what you know now, and the rest you will learn along the way.

    Best regards,
    Marc

    P.S. As mentioned before, Qt also has easy to use libraries to do any non-GUI stuff that you would like to do.
    P.P.S. Borland C++ Builder is also very good, but it isn't free.

  20. #20
    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: Is Qt for GUI only?

    oops,ifs,typedef,structures,classes,inheritance,po lymorphism,pointers,functions....)
    Just make sure to use QtCreator
    I'll rather say: "Just make sure you know why to use QtCreator".
    Know the tools. Learn how to use qmake, gdb, make. Learn the basics of STL. Try to make some serious use of all the stuff you've mentioned.
    And don't think that "gui programming" is some kind of "higher level" of programming in general. The fact that you can do some gui don't makes you a better programmer

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.