runtime widget generation

Philip Scott scotty at philipscott.freeserve.co.uk
Wed Jun 5 20:25:00 BST 2002


Yes, you can. You simply use C++'s 'new' keyword.
for example, to create a new push button:

QPushButton* ourpushbutton = new QPushButton(parent);
ourpushbutton->setText("Push me!");

Where parent is the parent widget, which is probably your main window unless 
you have made any VBoxes or HBoxes to align stuff.

If you need any more help, just give me a shout.. I've probably made every 
mistake in the book myself so I should be able to help you out.

On Wednesday 05 June 2002 11:14 am, aqdas tahir wrote:

> hi everyone
> I am a Qt and KDE beginner. I don't know whether we
> can create and display a widget (say a push button) at
> runtime or not? If we can, then how?
>
> Please be simple in your answer. Will be very thankful.
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! - Official partner of 2002 FIFA World Cup
> http://fifaworldcup.yahoo.com
> ___________________________________________________
> This message is from the kde mailing list.
> Account management:  http://mail.kde.org/mailman/listinfo/kde.
> Archives: http://lists.kde.org/.
> More info: http://www.kde.org/faq.html.

___________________________________________________
This message is from the kde mailing list.
Account management:  http://mail.kde.org/mailman/listinfo/kde.
Archives: http://lists.kde.org/.
More info: http://www.kde.org/faq.html.




More information about the kde mailing list