PDA

View Full Version : Adding custom widget to an existing layout



santana
3rd June 2010, 07:34
Hi all , thanks in advance for any advise...

I have a widget I created in designer, a few QLineEdit and QLabel aranged in a QGridLayout. I need to add this QWidget to an existing QGridLayout at a specific row,column.



this->BlockCacheUI=new pqSQBlockCacheWidget;
this->BlockCacheUI->setupUi(this);
this->PanelLayout->addWidget((QWidget*)this->BlockCacheUI,8,0,2,2,Qt::AlignTop|Qt::AlignLeft);

The last line produces



QLayout: Attempting to add QLayout "" to pqSQBOVMetaReader "pqSQBlockCacheWidget", which already has a layout


I have tried a few variations with out luck. What exactly is the problem? I have seen nested grid layouts before... How might I insert this custom widget into the existing grid layout?

yers
22nd June 2010, 18:29
I am also having difficulty getting a widget to appear. Any luck?