December
15th June 2007, 15:07
Hi All,
I've noticed that most projects I compile from source have a lot of .cpp files, many of them with only a few functions in them. One of my own projects is getting a little more complex and I was wondering what the best way to proceed would be.
I have a project and am now adding a new part to it. To accommodate the new stuff I am adding a new tab to an existing QTabWidget, which take up the majority of the main window.
I could write a new class that creates the new tab and handles most of the things inside it. The only thing it would need from the main program is some of the settings information, and the main program would need to pass info to this class once in a while.
Should I be doing it this way, or should I simply add the tab in the ui file and put the code for in in the main class on the same .cpp file as all the other stuff?
Also.. sorry for sticking a second question on a thread.. but I know this has been answered, I just wanted to make sure I understood it.
In QT3 Designer I used to add custom slots. From what I understand, with QT4 I should be using connect() statements in the initializing function for my class?
Thanks for any help in advance.
I've noticed that most projects I compile from source have a lot of .cpp files, many of them with only a few functions in them. One of my own projects is getting a little more complex and I was wondering what the best way to proceed would be.
I have a project and am now adding a new part to it. To accommodate the new stuff I am adding a new tab to an existing QTabWidget, which take up the majority of the main window.
I could write a new class that creates the new tab and handles most of the things inside it. The only thing it would need from the main program is some of the settings information, and the main program would need to pass info to this class once in a while.
Should I be doing it this way, or should I simply add the tab in the ui file and put the code for in in the main class on the same .cpp file as all the other stuff?
Also.. sorry for sticking a second question on a thread.. but I know this has been answered, I just wanted to make sure I understood it.
In QT3 Designer I used to add custom slots. From what I understand, with QT4 I should be using connect() statements in the initializing function for my class?
Thanks for any help in advance.