PDA

View Full Version : show another ui form



k.qasempour
16th July 2012, 08:23
hi all... im writing a QT gui application... and i wana show a seconde form in my application...
so i add a new QT designer form to my project and named it as "secondeform.ui"...
So how can i show this form for example when i pressing a button??
thank u all

sonulohani
16th July 2012, 09:53
Just create the class of that form and then create the object of that form class in your original class and call the show function whenever you're clicking on the button.

Added after 7 minutes:

See this example. May be you'll get some help from this---->

8018

Zlatomir
16th July 2012, 09:55
Just a little detail to what sonulohani said: if you use show (without modal window flags) you need to allocate memory on the heap for the second dialog/window (see this (http://www.qtcentre.org/faq.php?faq=qt_general_category#faq_qt_stack_creat ed_widgets) FAQ for details) and sample code for your original question can be found in this (http://www.qtcentre.org/faq.php?faq=qt_general_category#faq_qt_designer_2f orms) FAQ.

wysota
16th July 2012, 11:26
hi all... im writing a QT gui application... and i wana show a seconde form in my application...
so i add a new QT designer form to my project and named it as "secondeform.ui"...
So how can i show this form for example when i pressing a button??
thank u all

http://www.qtcentre.org/faq.php?faq=qt_general_category#faq_qt_designer_2f orms