Bug #12012
closedWTreeView - Items don't get selected
100%
Description
With Wt 4.10.1 all my WTreeViews broke since none of the items can be selected by mouse-click anymore.
The clicked()
event is triggered but the the clicked item doesn't get selected/highlighted.
I assume this is caused by changes introduced in Wt 4.10.1 by
https://redmine.webtoolkit.eu/issues/10512
This works fine in Wt 4.10.0, but not in Wt 4.10.1:
auto model = std::make_shared<WStringListModel>();
model->addString("Value A"); model->addString("Value B");
model->addString("Value C"); model->addString("Value D");
auto treeView = app->root()->addNew<WTreeView>();
treeView->setModel(model);
treeView->resize(600, 400);
treeView->setSelectionMode(SelectionMode::Single);
treeView->clicked().connect([=] (WModelIndex selIndex, WMouseEvent e)
{
(void) e;
std::cerr << "*** Row Clicked: " << selIndex.row() << std::endl;
} );
I'm not sure what the earlier behavior was, but I think it can also be seen in Wt Widget Gallery. The items in the WTreeView GitBrowser cannot be selected, only the expand
action works.
https://webtoolkit.eu/widgets/trees-tables/mvc-tree-views
Updated by Matthias Van Ceulebroeck about 1 year ago
- Status changed from New to InProgress
- Assignee set to Matthias Van Ceulebroeck
- Target version set to 4.10.2
Indeed, this was an oversight on my part. I missed a call to a parent class, which then did not add the keyboard and mouse events to the nodes of the view. A fix has been created and will be released in 4.10.2.
Updated by Matthias Van Ceulebroeck about 1 year ago
- Status changed from InProgress to Review
- Assignee deleted (
Matthias Van Ceulebroeck)
Updated by Matthias Van Ceulebroeck about 1 year ago
- Assignee set to Korneel Dumon
Updated by Korneel Dumon about 1 year ago
- Status changed from Review to Resolved
- Assignee changed from Korneel Dumon to Matthias Van Ceulebroeck
Updated by Matthias Van Ceulebroeck about 1 year ago
- Status changed from Resolved to Implemented @Emweb
- % Done changed from 0 to 100
Updated by Matthias Van Ceulebroeck about 1 year ago
- Status changed from Implemented @Emweb to Closed