[Qt-interest] problem with QMainWindow setCentralWidget and stackedWidget

Malyushytsky, Alex alex at wai.com
Tue May 18 02:28:12 CEST 2010


If I got you right, you have to:

a) set QStackedWidget instance as a centralWidget. It is set once.
b) to switch between the widgets in the stack ( to control which is visible ) you use functions
void    QStackedWidget::setCurrentIndex ( int index )
void    QStackedWidget::setCurrentWidget ( QWidget * widget )

Alex




From: qt-interest-bounces at trolltech.com [mailto:qt-interest-bounces at trolltech.com] On Behalf Of Meir Yanovich
Sent: Friday, May 14, 2010 9:07 PM
To: qt-interest at trolltech.com
Subject: [Qt-interest] problem with QMainWindow setCentralWidget and stackedWidget

Hello
i have gui the i created in the designer , simple one .
QMainWIndow that contains stackedWidget , the application starts with
stackedWidget index 0 that contains qwebkit widget and after some user flow ,it changes to stackedWidget
index 1 that contains QTree widget , to center the first widget i use in the QMainWindow constractor this line of code
this->setCentralWidget(ui.webView); but when the application switching to index number 1 im getting exception that is
coming from the switching command .
why ?


---------------------------------------------------------------------------------------------------
Weidlinger Associates, Inc. made the following annotations.

“This message and any attachments are solely for the intended recipient and may contain confidential or privileged information. If you are not the intended recipient, any disclosure, copying, use, or distribution of the information included in this message and any attachments is prohibited. If you have received this communication in error, please notify us by reply e-mail and immediately and permanently delete this message and any attachments. Thank you.”

“Please consider our environment before printing this email.”




More information about the Qt-interest-old mailing list