Project

General

Profile

Actions

Bug #10512

closed

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

Added by Andreas Frolov about 2 years ago. Updated 10 months ago.

Status:
Closed
Priority:
Normal
Target version:
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.

Actions #1

Updated by Andreas Frolov about 2 years ago

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

Actions #2

Updated by Roel Standaert about 2 years ago

  • Target version set to 4.9.0
Actions #3

Updated by Roel Standaert almost 2 years ago

  • Target version changed from 4.9.0 to 4.10.0
Actions #4

Updated by Matthias Van Ceulebroeck about 1 year ago

  • Target version changed from 4.10.0 to 4.10.1
Actions #5

Updated by Matthias Van Ceulebroeck about 1 year ago

  • Status changed from New to InProgress
  • Assignee set to Matthias Van Ceulebroeck
Actions #6

Updated by Matthias Van Ceulebroeck about 1 year ago

  • Status changed from InProgress to Review
  • Assignee deleted (Matthias Van Ceulebroeck)
Actions #7

Updated by Yoika Ghysens about 1 year ago

  • Assignee set to Yoika Ghysens
Actions #8

Updated by Matthias Van Ceulebroeck 10 months ago

  • Status changed from Review to Implemented @Emweb
  • Assignee changed from Yoika Ghysens to Matthias Van Ceulebroeck
  • % Done changed from 0 to 100
Actions #9

Updated by Matthias Van Ceulebroeck 10 months ago

  • Status changed from Implemented @Emweb to Closed
Actions

Also available in: Atom PDF