Only emit item_selected once per Tree row, closes #5280

This commit is contained in:
Juan Linietsky 2016-06-30 17:51:45 -03:00
parent 729e61e1d5
commit 89bb72b2d3
1 changed files with 6 additions and 1 deletions

View File

@ -1355,6 +1355,8 @@ void Tree::select_single_item(TreeItem *p_selected,TreeItem *p_current,int p_col
switched=true; switched=true;
} }
bool emitted_row=false;
for (int i=0;i<columns.size();i++) { for (int i=0;i<columns.size();i++) {
TreeItem::Cell &c=p_current->cells[i]; TreeItem::Cell &c=p_current->cells[i];
@ -1373,7 +1375,10 @@ void Tree::select_single_item(TreeItem *p_selected,TreeItem *p_current,int p_col
selected_item=p_selected; selected_item=p_selected;
selected_col=0; selected_col=0;
selected_item=p_selected; selected_item=p_selected;
if (!emitted_row) {
emit_signal("item_selected"); emit_signal("item_selected");
emitted_row=true;
}
//if (p_col==i) //if (p_col==i)
// p_current->selected_signal.call(p_col); // p_current->selected_signal.call(p_col);
} }