PDA

View Full Version : QGraphicsProxyWidget shows in a blimp of a second



stijn1989
27th October 2010, 23:38
Hello

I'm making an KDE plasmoid and use an QGraphicsLinearLayout to add some elements. Those elements can't be Widget's but must me from the class QGraphicsLayoutItem. So I create a new QGraphicsProxyWidget and call the "setWidget(QWidget*)" function. It shows in a blimp of second and then it dissappears. Can someone help me fix this.

The header file of my .ui widget: http://aiids.pastebin.com/7cTiJ8rg
The calling code: http://aiids.pastebin.com/2BtcSvsV

The funny is, when I replace frameLayout->addItem(proxyWidget); with frameLayout->addItem(new QLabel("foo"));, it shows the label.

stijn1989
29th October 2010, 11:37
Solved it thanks to the follow code:

http://websvn.kde.org/trunk/KDE/kdeexamples/plasma/c%2B%2B/plasmoids/scrollwidget/scrollwidgetexample.cpp?view=markup