diff options
Diffstat (limited to 'ui')
-rw-r--r-- | ui/qt/proto_tree.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/ui/qt/proto_tree.cpp b/ui/qt/proto_tree.cpp index e28f795fce..bcafb37fd4 100644 --- a/ui/qt/proto_tree.cpp +++ b/ui/qt/proto_tree.cpp @@ -587,8 +587,11 @@ void ProtoTree::collapseAll() updateContentWidth(); } -void ProtoTree::itemClicked(const QModelIndex &index) { - if (index == selectionModel()->selectedIndexes().first()) { +void ProtoTree::itemClicked(const QModelIndex &index) +{ + if (selectionModel()->selectedIndexes().isEmpty()) { + emit fieldSelected(0); + } else if (index == selectionModel()->selectedIndexes().first()) { FieldInformation finfo(proto_tree_model_->protoNodeFromIndex(index).protoNode()); if (finfo.isValid()) { @@ -597,7 +600,8 @@ void ProtoTree::itemClicked(const QModelIndex &index) { } } -void ProtoTree::itemDoubleClicked(const QModelIndex &index) { +void ProtoTree::itemDoubleClicked(const QModelIndex &index) +{ FieldInformation finfo(proto_tree_model_->protoNodeFromIndex(index).protoNode()); if (!finfo.isValid()) return; |