I want to dynamically add and remove widgets to a display, but it doesn't seem to work...

the addBackground slot is called on properly but no extra widgets appear, even when I resize it. What can I do to make it work?

I have members:
Qt Code:
  1. QPtrList<BackgroundWidget> *backgrounds;
  2. QVBoxLayout *backgroundsLayout;
To copy to clipboard, switch view to plain text mode 

This is supposed to add stuff:
Qt Code:
  1. void KreatorMain::addBackground() {
  2. int value=backgroundValue->value();
  3. QString name=backgroundName->currentText();
  4. BackgroundWidget *bg=
  5. new BackgroundWidget( name, value,
  6. generalBackgroundsTab, "", 0);
  7. backgrounds->append(bg);
  8. connect(bg,SIGNAL(removeBackground()),this,SLOT(removeBackground()));
  9. backgroundsLayout->addWidget(bg);
  10.  
  11. }
To copy to clipboard, switch view to plain text mode