ReilenBlaeyze
16th February 2006, 00:43
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:
QPtrList<BackgroundWidget> *backgrounds;
QVBoxLayout *backgroundsLayout;
This is supposed to add stuff:
void KreatorMain::addBackground() {
int value=backgroundValue->value();
QString name=backgroundName->currentText();
BackgroundWidget *bg=
new BackgroundWidget( name, value,
generalBackgroundsTab, "", 0);
backgrounds->append(bg);
connect(bg,SIGNAL(removeBackground()),this,SLOT(re moveBackground()));
backgroundsLayout->addWidget(bg);
}
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:
QPtrList<BackgroundWidget> *backgrounds;
QVBoxLayout *backgroundsLayout;
This is supposed to add stuff:
void KreatorMain::addBackground() {
int value=backgroundValue->value();
QString name=backgroundName->currentText();
BackgroundWidget *bg=
new BackgroundWidget( name, value,
generalBackgroundsTab, "", 0);
backgrounds->append(bg);
connect(bg,SIGNAL(removeBackground()),this,SLOT(re moveBackground()));
backgroundsLayout->addWidget(bg);
}