Results 1 to 3 of 3

Thread: A Style Question of how Code & Files are Organised !

  1. #1
    Join Date
    Apr 2009
    Qt products
    Qt3 Qt4
    Unix/X11 Windows

    Question A Style Question of how Code & Files are Organised !

    Hi All,

    Most of all the Qt examples and structures i have familiarised myself to are simple and restricted to around 3 files which might include (main.cpp, form1.h & form1.cpp).

    Lets say your developing a Dialog application with a QTabWidget with many tabs, and each tab contains many buttons/widgets. While both the form1.h class and main.cpp files are quite manageable, the form1.cpp implementation file is becoming VERY LARGE !!!

    I would like to ask you what are your preferences in terms of how you would partition/organise this implementation ?

    Some simple examples would be really useful too !

    Many Thanks & looking forward to your replies.

  2. #2
    Join Date
    Jan 2006
    Warsaw, Poland
    Thanked 5,014 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits

    Default Re: A Style Question of how Code & Files are Organised !

    You can implement each tab in a separate class (and separate two files) and then integrate them using a wrapping class. You can also refactor any class into smaller parts and use them. So the area to experiment is practically infinite.
    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.

  3. #3
    Join Date
    Sep 2009
    Thanked 348 Times in 333 Posts
    Qt products

    Default Re: A Style Question of how Code & Files are Organised !

    I would put the Dialog class into it's own directory, along with a class for each tab, which would be in there own file in that directory. The controller class (which the tab classes would communicate with) would also be in that directory.

Similar Threads

  1. Replies: 7
    Last Post: 11th December 2009, 05:01
  2. Mac style StatusBar Question
    By wafto in forum Newbie
    Replies: 0
    Last Post: 6th December 2008, 20:46
  3. question about the mac style
    By billconan in forum Newbie
    Replies: 3
    Last Post: 31st August 2006, 11:40
  4. pen style question
    By impeteperry in forum Qt Programming
    Replies: 4
    Last Post: 21st July 2006, 20:49
  5. Replies: 1
    Last Post: 29th May 2006, 09:49


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.