Project

General

Profile

Bug #10512

After the model is reset, elements in WTreeView no longer respect the disabled status of the view

Added by Andreas Frolov 6 months ago. Updated 2 months ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
Start date:
06/20/2022
Due date:
% Done:

0%

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.

#1

Updated by Andreas Frolov 6 months ago

The same problem occurs when the model sends the signal layoutChanged.

#2

Updated by Roel Standaert 5 months ago

  • Target version set to 4.9.0
#3

Updated by Roel Standaert 2 months ago

  • Target version changed from 4.9.0 to 4.10.0

Also available in: Atom PDF