diff options
Diffstat (limited to 'src/widgets/kernel/qgridlayout.cpp')
-rw-r--r-- | src/widgets/kernel/qgridlayout.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/widgets/kernel/qgridlayout.cpp b/src/widgets/kernel/qgridlayout.cpp index 96820e3891..7da2104971 100644 --- a/src/widgets/kernel/qgridlayout.cpp +++ b/src/widgets/kernel/qgridlayout.cpp @@ -85,6 +85,7 @@ public: void setGeometry(const QRect &r) { item_->setGeometry(r); } Qt::Alignment alignment() const { return item_->alignment(); } QLayoutItem *item() { return item_; } + void setItem(QLayoutItem *newitem) { item_ = newitem; } QLayoutItem *takeItem() { QLayoutItem *i = item_; item_ = 0; return i; } int hStretch() { return item_->widget() ? @@ -171,6 +172,18 @@ public: } return 0; } + QLayoutItem* replaceAt(int index, QLayoutItem *newitem) Q_DECL_OVERRIDE + { + if (!newitem) + return 0; + QLayoutItem *item = 0; + QGridBox *b = things.value(index); + if (b) { + item = b->takeItem(); + b->setItem(newitem); + } + return item; + } void getItemPosition(int index, int *row, int *column, int *rowSpan, int *columnSpan) const { if (index < things.count()) { |