property-dialog: hide a section if it's empty
This commit is contained in:
parent
44d04e98e5
commit
b50b69e9b8
|
@ -20,9 +20,13 @@ protected:
|
|||
{
|
||||
QTreeView::rowsInserted(parent, start, end);
|
||||
if (!parent.isValid()) {
|
||||
// we are inserting a section group
|
||||
for (int row = start; row <= end; ++row) {
|
||||
setupSection(row);
|
||||
}
|
||||
} else {
|
||||
// we are inserting a property
|
||||
setRowHidden(parent.row(), QModelIndex(), false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -41,6 +45,7 @@ private:
|
|||
{
|
||||
expand(model()->index(row, 0));
|
||||
setFirstColumnSpanned(row, QModelIndex(), true);
|
||||
setRowHidden(row, QModelIndex(), !model()->hasChildren(model()->index(row, 0)));
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user