Actions
Bug #10512
closedAfter the model is reset, elements in WTreeView no longer respect the disabled status of the view
Start date:
06/20/2022
Due date:
% Done:
100%
Estimated time:
Description
Consider the example:
auto layout = std::make_unique<Wt::WVBoxLayout>();
auto model = std::make_shared<Wt::WStringListModel>();
std::vector<Wt::WString> data = { "aaa", "bbb", "ccc" };
model->setStringList(data);
auto view = layout->addWidget(std::make_unique<Wt::WTreeView>());
view->setSelectionMode(Wt::SelectionMode::Single);
view->setModel(model);
auto button1 = layout->addWidget(std::make_unique<Wt::WPushButton>("Disable view"));
button1->clicked().connect([view]() {
view->setDisabled(true);
});
auto button2 = layout->addWidget(std::make_unique<Wt::WPushButton>("Reset model"));
button2->clicked().connect([view, model]() {
view->setModel(model);
});
root()->setLayout(std::move(layout));
root()->setMaximumSize(200, 200);
After creation, the elements are selectable.
First we click the button "Disable view". Elements can no longer be selected.
Then we reset the model by clicking on the "Reset model" button. Elements can be selected again although the view is disabled.
Updated by Andreas Frolov over 2 years ago
The same problem occurs when the model sends the signal layoutChanged.
Updated by Roel Standaert about 2 years ago
- Target version changed from 4.9.0 to 4.10.0
Updated by Matthias Van Ceulebroeck over 1 year ago
- Target version changed from 4.10.0 to 4.10.1
Updated by Matthias Van Ceulebroeck over 1 year ago
- Status changed from New to InProgress
- Assignee set to Matthias Van Ceulebroeck
Updated by Matthias Van Ceulebroeck over 1 year ago
- Status changed from InProgress to Review
- Assignee deleted (
Matthias Van Ceulebroeck)
Updated by Matthias Van Ceulebroeck over 1 year ago
- Status changed from Review to Implemented @Emweb
- Assignee changed from Yoika Ghysens to Matthias Van Ceulebroeck
- % Done changed from 0 to 100
Updated by Matthias Van Ceulebroeck over 1 year ago
- Status changed from Implemented @Emweb to Closed
Updated by Andreas Frolov 2 months ago
The bug fix does not work with WBootstrap5Theme. Tested with version 4.11.0.
Updated by Matthias Van Ceulebroeck 2 months ago
Hello Andreas,
thank you for following up on this. There indeed is still a case for Bootstrap 5 specifically it seems, due to it being able to visually select items outside Wt. I have created #13106 to track this for the next version.
Actions