diff options
Diffstat (limited to 'ui/qt/models/proto_tree_model.cpp')
-rw-r--r-- | ui/qt/models/proto_tree_model.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/ui/qt/models/proto_tree_model.cpp b/ui/qt/models/proto_tree_model.cpp index 45e1d6b056..b782c7a449 100644 --- a/ui/qt/models/proto_tree_model.cpp +++ b/ui/qt/models/proto_tree_model.cpp @@ -25,6 +25,15 @@ ProtoTreeModel::ProtoTreeModel(QObject * parent) : root_node_(0) {} +Qt::ItemFlags ProtoTreeModel::flags(const QModelIndex &index) const +{ + Qt::ItemFlags item_flags = QAbstractItemModel::flags(index); + if (rowCount(index) < 1) { + item_flags |= Qt::ItemNeverHasChildren; + } + return item_flags; +} + QModelIndex ProtoTreeModel::index(int row, int, const QModelIndex &parent) const { ProtoNode parent_node(root_node_); |