mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 20:50:34 +01:00
Added count() method to ElementsCollectionItem class and its subclasses.
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/branches/0.3@1216 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -615,6 +615,17 @@ bool ElementsCategory::isEmpty() {
|
||||
return(categories().count() || elements().count());
|
||||
}
|
||||
|
||||
/**
|
||||
@return the count of categories and elements within this collection
|
||||
*/
|
||||
int ElementsCategory::count() {
|
||||
int items_count = elements().count();
|
||||
foreach(ElementsCategory *category, categories()) {
|
||||
items_count += category -> count();
|
||||
}
|
||||
return(items_count);
|
||||
}
|
||||
|
||||
/**
|
||||
Methode permettant d'obtenir le nom affichable de cette categorie.
|
||||
@return Le nom affichable de la categorie
|
||||
|
||||
Reference in New Issue
Block a user