Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 3

Qt-interest Archive, June 2007
reusing of dialog/form


Message 1 in thread

Hi... 

Is it possible to compose a dialog with other dialogs ?

In other words, if I have 

classA + dialogA
classB + dialogB
classC : public classA, public classB

is it possible to design a form/dialog for classC reusing dialogA &
dialogB ?

On some IDE I can create a frame for A, a frame for B and then put such
frames into a new form C... is there a way to do the same in QT ? 

thanks a lot,

  Andy



--
 [ signature omitted ] 

Message 2 in thread

Hi, Andy,

I think there are two ways which are like your requirement.

1. Creating Custom Widgets for Qt Designer,
http://doc.trolltech.com/4.3/designer-creating-custom-widgets.html

2. QUiLoader
http://doc.trolltech.com/4.3/quiloader.html

Regards,
Liang

--
 [ signature omitted ] 

Message 3 in thread

Andy Hirsh wrote:
> Hi... 
> 
> Is it possible to compose a dialog with other dialogs ?
> 
> In other words, if I have 
> 
> classA + dialogA
> classB + dialogB
> classC : public classA, public classB
> 
> is it possible to design a form/dialog for classC reusing dialogA &
> dialogB ?
> 
> On some IDE I can create a frame for A, a frame for B and then put such
> frames into a new form C... is there a way to do the same in QT ? 
> 
> thanks a lot,
> 
>   Andy
>
Andy,
	Using designer, in class C, put a place holder widget that is the base 
class of the derived class. That is, if classA is derived from QtWidget, 
use QtWidget as the place holder. If classB is derived from QtForm, use 
QtForm as the plass holder. Then right click on the place holder widget 
and select "Promote to Custom Widget". In the dialog that pops up, enter 
the name of classA and the path to the header file.

--
 [ signature omitted ]