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 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"?

  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?

    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

  3. #3
    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... ;-)

  4. #4
    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.