PDA

View Full Version : Relationship b/w different classes



salmanmanekia
2nd June 2010, 18:24
Hi all,
before making any question i will first tell you about my class heirarchy..starting from down i have two widget classes ,these two widget classes are included in a scene class which is included in a view class and the view is controlled by a widget ....so when the main is executed a widget is called which turns on the view which has a scene and that scene has two widget parts to it..
Now my problem is at the scene and one of the widget...
i want to include a tab bar/widget in that widget and have tried to written a few lines of code in scene class...the output always has been nothing ....but the code for tab seems ok as if i show() it just there it is visible in a separte widget of its own..
now i am certain here that i am missing something of a setParent /child thing here....i cannt set a tabs parent to be scene or even a proxy widget ,so i have no idea how to over come this problem

below is my code ,if it helps any of you to understand the problem..Thanks already!



Scene::Scene()
{
proxy = new QGraphicsProxyWidget;
inItem = new InputItems(); //this is my QWidget class which should be displayed when a particular Tab is ON
tabBar = new QTabBar();

tabBar->setTabButton(1,QTabBar::LeftSide,new QPushButton);
tabBar->addTab("first");
proxy = addWidget(inItem);


}