PDA

View Full Version : QProxyWidget and My Scene



salmanmanekia
2nd June 2010, 01:14
Hi all,
I am working on a project and using QGraphicsScene class and QGraphicsProxyWidget class in it ...
I am facing a very basic problem in the implementation of these classes and cant figure out whats the problem..below is the description of the problem..



#include "InputItems.h"

class Scene : public QGraphicsScene
{
,,
InputItems *inItem;
QGraphicsProxyWidget *proxy;
};
#include "scene.h"


Scene::Scene()
{

inItem = new InputItems();
proxy = addWidget(inItem);

}


class InputItems : public QWidget
{
..
private:
QLabel *numberLabel;
..
};



InputItems::InputItems()
{
numberLabel = new QLabel("Telephone number");
}
After running this piece of code i am expecting a QLabel in my widget !!..But there is nothing displayed...Any Ideas..??,..Thanks

CeeKey
2nd June 2010, 07:40
Hey,

i can't find any piece of code, where you add the QLabel "numberlabel" to the QWidget "InputItems".

salmanmanekia
2nd June 2010, 07:51
meaning..? :confused:

salmanmanekia
2nd June 2010, 07:56
Its visible now...I set parents to my Label in the widget...Thanks:)