mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 23:05:36 +08:00
Ref T472, isEmpty for category tree
This commit is contained in:
committed by
Mat Sutcliffe
parent
001d90bd6b
commit
ac7958367b
@@ -39,7 +39,7 @@ namespace BlackGui
|
||||
{
|
||||
if (!this->categoryModel()) { return; }
|
||||
this->categoryModel()->updateContainer(categories);
|
||||
this->expandAll();
|
||||
if (!this->isEmpty()) { this->expandAll(); }
|
||||
}
|
||||
|
||||
void CAircraftCategoryTreeView::clear()
|
||||
@@ -55,12 +55,18 @@ namespace BlackGui
|
||||
|
||||
void CAircraftCategoryTreeView::fullResizeToContents()
|
||||
{
|
||||
for (int c = 0; c < this->model()->columnCount(); c++)
|
||||
if (this->isEmpty()) { return; }
|
||||
for (int c = 0; c < this->categoryModel()->columnCount(); c++)
|
||||
{
|
||||
this->resizeColumnToContents(c);
|
||||
}
|
||||
}
|
||||
|
||||
bool CAircraftCategoryTreeView::isEmpty() const
|
||||
{
|
||||
return this->categoryModel()->rowCount() < 1;
|
||||
}
|
||||
|
||||
const CAircraftCategoryTreeModel *CAircraftCategoryTreeView::categoryModel() const
|
||||
{
|
||||
return qobject_cast<const CAircraftCategoryTreeModel *>(this->model());
|
||||
|
||||
@@ -52,6 +52,9 @@ namespace BlackGui
|
||||
//! Resize all columns
|
||||
void fullResizeToContents();
|
||||
|
||||
//! Empty data
|
||||
bool isEmpty() const;
|
||||
|
||||
private:
|
||||
//! Used model
|
||||
const Models::CAircraftCategoryTreeModel *categoryModel() const;
|
||||
|
||||
Reference in New Issue
Block a user