Only emit item_selected once per Tree row, closes #5280

(cherry picked from commit 89bb72b2d3)
This commit is contained in:
Juan Linietsky 2016-06-30 17:51:45 -03:00 committed by Rémi Verschelde
parent 242ceb1869
commit 9b90d70ae7
1 changed files with 6 additions and 1 deletions

View File

@ -1282,6 +1282,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];
@ -1300,7 +1302,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;
emit_signal("item_selected"); if (!emitted_row) {
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);
} }