fix the "figure out which layout to use" codepath
svn path=/trunk/KDE/kdelibs/; revision=1034850
This commit is contained in:
parent
2bdb8bc405
commit
2b762d0581
@ -122,10 +122,18 @@ void PopupApplet::setWidget(QWidget *widget)
|
||||
if (d->dialog) {
|
||||
d->dialog->setGraphicsWidget(0);
|
||||
QVBoxLayout *lay = 0;
|
||||
if (d->dialog->layout()) {
|
||||
lay = static_cast<QVBoxLayout *>(lay);
|
||||
} else {
|
||||
lay = new QVBoxLayout(d->dialog);
|
||||
|
||||
QLayout *existingLayout = d->dialog->layout();
|
||||
if (existingLayout) {
|
||||
lay = dynamic_cast<QVBoxLayout *>(existingLayout);
|
||||
if (!lay) {
|
||||
delete existingLayout;
|
||||
}
|
||||
}
|
||||
|
||||
if (!lay) {
|
||||
lay = new QVBoxLayout;
|
||||
d->dialog->setLayout(lay);
|
||||
}
|
||||
|
||||
lay->removeWidget(d->widget);
|
||||
|
Loading…
x
Reference in New Issue
Block a user