Qt-interest Archive, January 2008
Is this the correct way to handle dialog windows?
Message 1 in thread
Thank you for reading this.
I'm working on a rainy weekend project that has extended to at least a rainy
week due to local flooding.
What I have is a main class (plus several other classes) that is sub classed
from a main window dialog generated by Designer under Qt3. What I want to
happen is to have a number of different dialog windows open depending upon
menu selections. The main class will then process the data that those
dialogs contain.
I have discovered two solution but I don't know which is correct. Actually,
I'm often unsure of a solution even if it seems to work correctly.
Is it better to have the main class handle each of the dialogs or should I
generate a new sub class for each of the dialogs? The first method generates
a large file that can make maintenance tedious and the second method means
that I will have lots of classes and will have to remember what each one
does.
Generating sub classes for each of the dialogs does seem to be a more tidy
solution because code is associated with a particular dialog and not hidden
among other unrelated code.
Now that I've explained this I now think that sub classed dialogs is the
correct solution, or is it?
Regards,
Phil.
--
[ signature omitted ]
Message 2 in thread
On Fri, January 18, 2008 08:33, Phil wrote:
> Now that I've explained this I now think that sub classed dialogs is the
> correct solution, or is it?
Yes, sub-classed dialogs IS the correct solution, if that helps :)!
Have fun, René
--
[ signature omitted ]
Message 3 in thread
Hi Phil,
I strongly suggest you separate the UI from the data. Have classes to
represent the data for each dialog, and a master class that knows about the
others. Each dialog gets a copy or reference to its particular data class.
This makes it much easier to test the data classes without the UI.
Regards,
Tony Rietwyk
(Melbourne)
> -----Original Message-----
> From: Phil [mailto:phillor@xxxxxxxxxxx]
> Sent: Friday, 18 January 2008 18:33
> To: qt-interest@xxxxxxxxxxxxx
> Subject: Is this the correct way to handle dialog windows?
>
>
> Thank you for reading this.
>
> I'm working on a rainy weekend project that has extended to
> at least a rainy
> week due to local flooding.
>
> What I have is a main class (plus several other classes) that
> is sub classed
> from a main window dialog generated by Designer under Qt3.
> What I want to
> happen is to have a number of different dialog windows open
> depending upon
> menu selections. The main class will then process the data that those
> dialogs contain.
>
> I have discovered two solution but I don't know which is
> correct. Actually,
> I'm often unsure of a solution even if it seems to work correctly.
>
> Is it better to have the main class handle each of the
> dialogs or should I
> generate a new sub class for each of the dialogs? The first
> method generates
> a large file that can make maintenance tedious and the second
> method means
> that I will have lots of classes and will have to remember
> what each one
> does.
>
> Generating sub classes for each of the dialogs does seem to
> be a more tidy
> solution because code is associated with a particular dialog
> and not hidden
> among other unrelated code.
>
> Now that I've explained this I now think that sub classed
> dialogs is the
> correct solution, or is it?
>
> Regards,
> Phil.
>
>
> --
> To unsubscribe - send a mail to
> qt-interest-request@xxxxxxxxxxxxx with "unsubscribe" in the
> subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
>
>
--
[ signature omitted ]