Project

General

Profile

Actions

Bug #12012

closed

WTreeView - Items don't get selected

Added by Stefan Bn 8 months ago. Updated 7 months ago.

Status:
Closed
Priority:
High
Target version:
Start date:
10/08/2023
Due date:
% Done:

100%

Estimated time:

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

Actions #1

Updated by Matthias Van Ceulebroeck 8 months 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.

Actions #2

Updated by Matthias Van Ceulebroeck 8 months ago

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

Updated by Matthias Van Ceulebroeck 8 months ago

  • Assignee set to Korneel Dumon
Actions #4

Updated by Korneel Dumon 7 months ago

  • Status changed from Review to Resolved
  • Assignee changed from Korneel Dumon to Matthias Van Ceulebroeck
Actions #5

Updated by Matthias Van Ceulebroeck 7 months ago

  • Status changed from Resolved to Implemented @Emweb
  • % Done changed from 0 to 100
Actions #6

Updated by Matthias Van Ceulebroeck 7 months ago

  • Status changed from Implemented @Emweb to Closed
Actions

Also available in: Atom PDF