Results 1 to 9 of 9

Thread: How to design Qt applications are better?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #3
    Join Date
    Jan 2006
    Location
    Frankfurt
    Posts
    500
    Thanks
    1
    Thanked 52 Times in 52 Posts
    Platforms
    MacOS X Unix/X11

    Default Re: How to design Qt applications are better?

    I think it is a matter of personal taste.

    I agree with you that the QMainWindow subclass is a good candidate to become the good object of a QApplication.

    From the academic point of view, this is purely wrong because a window is a view class and should not contain any business logic code at all.

    I suggest to put most code in QObject-subclasses and let these objects provide actions that you can put around in your mainwindow. The downside of this approach is that you cannot do it with designer.

    An extra suggestion from me is to put most of your code in subclasses of QAbstractListModel or QAbstractTableModel if it somehow represents a list in any form, even if you will not it in a listview in the final gui. The nice thing about this is that you can attach a listview to it for debugging purposes instead of adding a lot of qDebug.
    It's nice to be important but it's more important to be nice.

  2. The following user says thank you to axeljaeger for this useful post:

    FinderCheng (19th October 2009)

Similar Threads

  1. Replies: 3
    Last Post: 28th August 2009, 13:45
  2. Replies: 3
    Last Post: 5th October 2008, 23:41
  3. Need some help on design and implementation
    By cool_qt in forum Qt Programming
    Replies: 2
    Last Post: 30th July 2008, 21:19
  4. Dialog and code design issue
    By Gopala Krishna in forum Qt Programming
    Replies: 1
    Last Post: 24th September 2006, 17:54

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.