mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-17 19:05:31 +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; }
|
if (!this->categoryModel()) { return; }
|
||||||
this->categoryModel()->updateContainer(categories);
|
this->categoryModel()->updateContainer(categories);
|
||||||
this->expandAll();
|
if (!this->isEmpty()) { this->expandAll(); }
|
||||||
}
|
}
|
||||||
|
|
||||||
void CAircraftCategoryTreeView::clear()
|
void CAircraftCategoryTreeView::clear()
|
||||||
@@ -55,12 +55,18 @@ namespace BlackGui
|
|||||||
|
|
||||||
void CAircraftCategoryTreeView::fullResizeToContents()
|
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);
|
this->resizeColumnToContents(c);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool CAircraftCategoryTreeView::isEmpty() const
|
||||||
|
{
|
||||||
|
return this->categoryModel()->rowCount() < 1;
|
||||||
|
}
|
||||||
|
|
||||||
const CAircraftCategoryTreeModel *CAircraftCategoryTreeView::categoryModel() const
|
const CAircraftCategoryTreeModel *CAircraftCategoryTreeView::categoryModel() const
|
||||||
{
|
{
|
||||||
return qobject_cast<const CAircraftCategoryTreeModel *>(this->model());
|
return qobject_cast<const CAircraftCategoryTreeModel *>(this->model());
|
||||||
|
|||||||
@@ -52,6 +52,9 @@ namespace BlackGui
|
|||||||
//! Resize all columns
|
//! Resize all columns
|
||||||
void fullResizeToContents();
|
void fullResizeToContents();
|
||||||
|
|
||||||
|
//! Empty data
|
||||||
|
bool isEmpty() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
//! Used model
|
//! Used model
|
||||||
const Models::CAircraftCategoryTreeModel *categoryModel() const;
|
const Models::CAircraftCategoryTreeModel *categoryModel() const;
|
||||||
|
|||||||
Reference in New Issue
Block a user