I am trying to create a layout on top of a widget derived from QWidget:

myWidget::myWidget(QWidget *parent, const char *name )
{
setFixedSize(300, 150); // Just for now

m_plotpanel = new PlotPanel(this); // PlotPanel is scubclassed from QWidget, not MainWindow
m_controllpanel = new PlotPanel(this); // for now
m_plotpanel->setStyleSheet("background-color: red"); // to see that
m_controllpanel->setStyleSheet("background-color: black"); // they are both there

horLayout = new QHBoxLayout;
horLayout->addWidget(m_plotpanel);
horLayout->addWidget(m_controllpanel);
m_plotpanel->show();
m_controllpanel->show();

widgets.png

Both widgets are shown, with the right colours, but they are detached from myWidget. How can I attach them to myWidget? Do I have to use QDockWidget?