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 over 2 years ago. Updated 2 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 over 2 years ago

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

Actions #2

Updated by Roel Standaert over 2 years ago

  • Target version set to 4.9.0
Actions #3

Updated by Roel Standaert about 2 years ago

  • Target version changed from 4.9.0 to 4.10.0
Actions #4

Updated by Matthias Van Ceulebroeck over 1 year ago

  • Target version changed from 4.10.0 to 4.10.1
Actions #5

Updated by Matthias Van Ceulebroeck over 1 year ago

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

Updated by Matthias Van Ceulebroeck over 1 year ago

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

Updated by Yoika Ghysens over 1 year ago

  • Assignee set to Yoika Ghysens
Actions #8

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
Actions #9

Updated by Matthias Van Ceulebroeck over 1 year ago

  • Status changed from Implemented @Emweb to Closed
Actions #10

Updated by Andreas Frolov 2 months ago

The bug fix does not work with WBootstrap5Theme. Tested with version 4.11.0.

Actions #11

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

Also available in: Atom PDF