Hi.

I have subclassed QDockWidget and added some widgets to a vertical layoutmanager in it's constructor.
However, the widget of MyWidgetType is not visible.
If I don't add the QListWidget, I see the MyWidgetType widget just fine.

Could anybody give me any pointers as to what is going on here?

Torleif

Qt Code:
  1. this->setAllowedAreas(Qt::LeftDockWidgetArea);
  2. mContextWidget = new QWidget(this);
  3. mContextWidget->setMaximumSize(150, 250);
  4. this->setWidget(mContextWidget);
  5.  
  6. mVerticalLayout = new QVBoxLayout();
  7. mVerticalLayout->setMargin(9);
  8. mContextWidget->setLayout(mVerticalLayout);
  9.  
  10. QLabel *myLabel = new QLabel(mContextWidget);
  11. myLabel->setText("mylabel:");
  12. mVerticalLayout->addWidget(myLabel);
  13.  
  14. mListWidget = new QListWidget(mContextWidget);
  15. mVerticalLayout->addWidget(mListWidget);
  16.  
  17. MyOwnWidgetType *myWidget = new MyOwnWidgetType(mContextWidget);
  18. mVerticalLayout->addWidget(myWidget);
To copy to clipboard, switch view to plain text mode