Pai, Cary
2011-04-14 02:13:37 UTC
Hi, All,
I have created a MTF application, but when I run the application with the QPushButton add into MApplicationPage, it will have the segmentation fault, why MTF can't add the QWidget based item? The code I wrote are as below :
int main(int argc, char *argv[])
{
MApplication a(argc, argv);
MApplicationWindow w;
MApplicationPage p;
QPushButton* but = new QPushButton("test");
p.scene()->addWidget(but);
p.appear(&w);
w.show();
return a.exec();
}
Since the p.scene() is QGraphicsScene why it will have the error on runtime?
Best Regards.
Intel Software & Service Group
[cid:image001.jpg-***@public.gmane.org]
B1 #205 Tun-Hwa North Rd, Taipei, Taiwan
Desk
+886-2-2514-4603
Mobile
+886-987-369-617
E-Mail
cary.pai-***@public.gmane.org<mailto:gorden.nieh-***@public.gmane.org>
I have created a MTF application, but when I run the application with the QPushButton add into MApplicationPage, it will have the segmentation fault, why MTF can't add the QWidget based item? The code I wrote are as below :
int main(int argc, char *argv[])
{
MApplication a(argc, argv);
MApplicationWindow w;
MApplicationPage p;
QPushButton* but = new QPushButton("test");
p.scene()->addWidget(but);
p.appear(&w);
w.show();
return a.exec();
}
Since the p.scene() is QGraphicsScene why it will have the error on runtime?
Best Regards.
Intel Software & Service Group
[cid:image001.jpg-***@public.gmane.org]
B1 #205 Tun-Hwa North Rd, Taipei, Taiwan
Desk
+886-2-2514-4603
Mobile
+886-987-369-617
cary.pai-***@public.gmane.org<mailto:gorden.nieh-***@public.gmane.org>