Results 1 to 10 of 10

Thread: Qt thinking - pointers?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Oct 2013
    Posts
    6
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Qt thinking - pointers?

    It seems that the time has come for me to start thinking QT things, so as a QT-newbie, but old fart in programming I'd like to ask:

    Any pointers to writings on thinking QT - the paradigm?
    Something about what kind of architectures are preferable within QT community.
    I understand that QT is "advertized" as good framework for event based systems. Why, How?
    Are there generally accepted ideas of basic patterns? (Like in C#/WPF it's almost always MVVM).
    What should the main function do? The main work or almost nothing?
    ...
    (I hope you get the picture.)

    Also, is there a good technical overview about what QT is made of and how it works?

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt thinking - pointers?

    Firstly, its Qt and not QT

    Secondly you can go through http://qt-project.org/resources/getting_started
    The most important things to know about Qt are -
    Signals and Slots
    Object trees and ownership.

    Rest if you are familiar with C++, you should sail smoothly

  3. #3
    Join Date
    Oct 2013
    Posts
    6
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Qt thinking - pointers?

    Thanks - I'll have a look there.

  4. #4
    Join Date
    Oct 2013
    Posts
    6
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Qt thinking - pointers?

    Hm, those pages don't seem to give any ideas about "good" program structures.

    Does anyone know any SW architecture related material?
    (Which way to think about the SW to be implemented using Qt.)

  5. #5
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt thinking - pointers?

    Qt is C++. So any pattern for C++ application should also work with Qt.

    Additional links you can browse more are as follows -
    1) An Introduction to Design Patterns in C++ with Qt 4 [ Google for this book ]
    http://www.ics.com/design-patterns

    2) http://www.slideshare.net/YnonPerek/...atterns‎

  6. #6
    Join Date
    Dec 2012
    Posts
    197
    Thanks
    25
    Thanked 41 Times in 33 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Qt thinking - pointers?

    An Introduction to Design Patterns in C++ with Qt
    A Great book, went through it at my university class. Its really helpful.

  7. #7
    Join Date
    Oct 2013
    Posts
    6
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Qt thinking - pointers?

    Quote Originally Posted by aamer4yu View Post
    Qt is C++. So any pattern for C++ application should also work with Qt.

    Additional links you can browse more are as follows -
    1) An Introduction to Design Patterns in C++ with Qt 4 [ Google for this book ]
    http://www.ics.com/design-patterns

    2) http://www.slideshare.net/YnonPerek/...atterns‎
    Thanks. Part I chapter 8 on. The rest seems to be general C++ (and O-O).
    Although, not so sure about the "Qt thinking"-part.

    BTW, with "Object trees and ownership." you mean the "parent-relation"?

  8. #8
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt thinking - pointers?

    BTW, with "Object trees and ownership." you mean the "parent-relation"?
    Yes, Its the parent child relation . This provides a semi garbage collection like system where you don't have to delete all the child objects individually, but if you delete the parent then all the child objects will be deleted automatically.


    Although, not so sure about the "Qt thinking"-part.
    Yes, I don't think there is a book for that. And with Qt 5, I wonder if developer days are the best thing to follow to learn and think in Qt :-)

    May be discussions and real life problems will help understand the Thinking in Qt part

  9. #9
    Join Date
    Oct 2013
    Posts
    6
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Qt thinking - pointers?

    Quote Originally Posted by aamer4yu View Post

    Yes, I don't think there is a book for that. And with Qt 5, I wonder if developer days are the best thing to follow to learn and think in Qt :-)

    May be discussions and real life problems will help understand the Thinking in Qt part
    It's just that lerning by induction is slow - the details need to be many. And not all of them are done by
    knowledgeable programmer... ;-)

  10. #10
    Join Date
    Oct 2013
    Posts
    6
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Qt thinking - pointers?

    More concrete case:
    I’m writing a simple external device commander that “discusses” with the computer via serial port.

    There are two kinds of commands: simple one line commands and a bit more complex multiblock commands. A block is some hundreds of bytes long. Simple command is just a couple of tens of bytes long.

    Is it good idea to have mainwindow to handle the UI, simple commander, block commanderand a device specific serial handler (using the QSerialPort)? Later on, the UI will be dropped and the rest is to be moved into a “subsystem” of a bigger whole.
    The mainwindow has slots of all “command sending” widgets (mostly buttons), and when a command is sent, it gets data from other fields (command parameters) and sends the bunch to the appropriate commander, that handle the command and “code” them using the device specific serial handler.
    The mainwindow has “command signals” and “response slots” and so do the command handlers and the device specific serial handler.
    The mainwindow ties the “command signals” and “response slots” together, except that the device specific serial handler connects its “command signals” and “response slots” with the QSerialPort stuff.
    Is that an OK structure? Am I overusing/underusing signals/slots?

    How about handling ACK-messages? Those can come for both simple and multiblock commands. Is it better to use a flag for routing the ACK to the appropriate commander, or is re-connecting signals/slots between the device specific serial handler and the appropriate commander a preferred way?

Similar Threads

  1. Replies: 3
    Last Post: 6th April 2012, 16:44
  2. Replies: 2
    Last Post: 22nd July 2011, 13:17
  3. When to use templates thinking in the speed of the program.
    By tonnot in forum General Programming
    Replies: 1
    Last Post: 22nd June 2011, 10:43
  4. "Thinking in C++" vol 2 book
    By mickey in forum General Discussion
    Replies: 2
    Last Post: 15th April 2008, 13:21
  5. help with pointers and
    By sincnarf in forum Qt Programming
    Replies: 6
    Last Post: 2nd July 2007, 15:09

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
  •  
Qt is a trademark of The Qt Company.