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