[Qt-interest] QStackedWidget Problem

Malyushytsky, Alex alex at wai.com
Thu Apr 28 11:40:29 CEST 2011


Use debugger to find reason the code  is crushing.
If you use binaries you might need to build Qt  yourself, so you can step in.
If you provided minimal compilable example, someone could help you in it.
As is there are too many chances problem is in your code you don't provide.

Alex

From: qt-interest-bounces+alex=wai.com at qt.nokia.com [mailto:qt-interest-bounces+alex=wai.com at qt.nokia.com] On Behalf Of Sujan Dasmahapatra
Sent: Wednesday, April 27, 2011 11:22 PM
To: qt-interest at trolltech.com
Subject: Re: [Qt-interest] QStackedWidget Problem

Hi Syam and all others
By setting
pointerToSomeOtherClass as parent of curPlot its crashing.

Actually my pointerToSomeOtherClass is a QScrollArea

pointerToSomeOtherClass->setWidget(curPlot);

But its crashing .. any other hints highly appreciated.


Kind Regards,


Sujan Dasmahapatra
Project Leader, Aero Group
Aero Group
Tel    +91 80 66470248
Mob
sdh at lmwindpower.com<mailto:%25EMAIL%25>

LM Wind Power Blades
lmwindpower.com

Together we capture the wind to power a cleaner world
________________________________

This e-mail and any attachments are confidential. If you are not the named or intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Any unauthorized disclosure, use or storage is prohibited and might be unlawful.
From: qt-interest-bounces+sdh=lmwindpower.com at qt.nokia.com [mailto:qt-interest-bounces+sdh=lmwindpower.com at qt.nokia.com] On Behalf Of Syam Krishnan
Sent: Wednesday, April 27, 2011 7:24 PM
To: qt-interest at qt.nokia.com
Subject: Re: [Qt-interest] QStackedWidget Problem

On 04/27/2011 02:57 PM, Sujan Dasmahapatra wrote:
Dear Friends

class COptWidget : public QWiget
{
                Q_OBJECT
public:
                COptWidget(SomeOtherClass *parent=0);
                ~COptWidget();
};

COptWidget *plotopt = new COptWidget(pointerToSomeOtherClass);
QStackedWidget  *curPlot =  new QStackedWidget;
curPlot->addWidget(plotopt);
curPlot->setCurrentWidget(plotopt);


But with this I am not able to see the plot what am I missing here. Application crashed at curPlot->addWidget(plotopt);

What/where is the parent widget for the stacked widget? It looks like you need to pass 'pointerToSomeOtherClass' as the parent of the stacked widget instead of your plot widget.

regards,

Syam


---------------------------------------------------------------------------------------------------
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."
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110428/0f3b7d5a/attachment.html 


More information about the Qt-interest-old mailing list