Bug #1074
closedRemoving widget from container with layout
0%
Description
Hi,
I'm seeing unexpected behaviour when removing a widget from a container with a layout. It looks like the layout is 'copied' and appears twice on the page (with the same id). One time original, one time with the removed item removed. Please see the screenshot and attached code.
What am I doing wrong?
void HelloApplication::create()
{
box_ = new WGroupBox(root());
box_->setTitle("test");
WGridLayout *layout = new WGridLayout();
box*->setLayout(layout*_, AlignTop);
layout->addWidget(new WText("testitem1"), 0, 0);
layout->addWidget(new WText("testitem2"), 1, 0);
WPushButton *remove = new WPushButton("test_remove", root());
remove->clicked().connect(boost::bind(&HelloApplication::test_response, this));
}
void HelloApplication::test_response()
{
// box*layout()>removeWidget(box*->children().at(0));
box_removeWidget(box_>children().at(0));
}
I'm using 3.1.11
Kind regards,
Rob.
Files
Updated by Koen Deforche almost 13 years ago
- Status changed from New to Resolved
- Assignee set to Koen Deforche
- Target version set to 3.2.1
Hey Rob,
Thanks. An off-by-one error, fixed in git now.
Regards,
koen