Ref T442, ATC station treeview

* store expand/collapsed state
* resize
* clear
This commit is contained in:
Klaus Basan
2018-12-06 03:21:29 +01:00
parent 6116797727
commit 82324cb512
5 changed files with 150 additions and 22 deletions

View File

@@ -57,10 +57,16 @@ namespace BlackGui
void CAtcStationTreeModel::updateContainer(const CAtcStationList &stations)
{
if (stations.isEmpty())
{
CAtcStationTreeModel::clear();
return;
}
m_stations = stations.sortedByAtcSuffixSortOrderAndDistance();
m_stationsBySuffix = m_stations.splitPerSuffix();
m_suffixes = m_stations.getSuffixes();
this->clear();
QStandardItemModel::clear();
int visibleColumns = 0;
for (const QString &suffix : m_suffixes)
@@ -104,5 +110,19 @@ namespace BlackGui
}
this->setColumnCount(visibleColumns);
}
void CAtcStationTreeModel::clear()
{
m_stations.clear();
m_stationsBySuffix.clear();
m_suffixes.clear();
QStandardItemModel::clear();
}
void CAtcStationTreeModel::changedAtcStationConnectionStatus(const CAtcStation &station, bool added)
{
Q_UNUSED(station);
Q_UNUSED(added);
}
} // namespace
} // namespace