Results 1 to 2 of 2

Thread: Program design best practices

  1. #1
    Join Date
    Aug 2010
    Posts
    107
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Windows

    Question Program design best practices

    I am writing a program that has a stacked widget and some of the pages are used for database entry/correction other pages are used for reporting/printing. There are methods for populating the lineedits, comboboxes, entering new data, etc. Several of the pages have methods that are almost identical. I wanted to know what the best or appropriate methods would be. From what I can tell my options would be:

    1. Have all the methods for populating/verifying and manipulation all in the class for the widget that contains the stacked widget.
    2. Create a class (with a header and cpp file) for each page of the stacked widgets and call each method as needed.

    What would be the best method? Or is there a better way?

  2. #2
    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: Program design best practices

    I would go with number two, since it's more modular, and it would be easier to implement/test each module separately and later add new modules if necessary.

    If you go with your first design remember that in C++ you have templates which can be used to write generic functions (so that you don't repeat the same code again and again)

Similar Threads

  1. programming practices with connect
    By jajdoo in forum Qt Programming
    Replies: 6
    Last Post: 5th September 2010, 13:19
  2. Best practices concerning QStandardItemModel
    By tim47 in forum Qt Programming
    Replies: 2
    Last Post: 27th January 2010, 05:29
  3. Replies: 3
    Last Post: 5th October 2008, 23:41
  4. query about best practices
    By Raajesh in forum Qt Programming
    Replies: 3
    Last Post: 13th June 2008, 18:47
  5. Qt <-> Java - Best Practices?
    By mentat in forum Qt Programming
    Replies: 6
    Last Post: 20th July 2006, 02:32

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.