mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-26 09:48:45 -05:00
Merge pull request #841 from srcejon/fix_table_clear_assertion
Fix assertion when removing all elements from model
This commit is contained in:
commit
cd0fc3dfd1
@ -378,14 +378,17 @@ public:
|
||||
}
|
||||
|
||||
void removeAllAirports() {
|
||||
beginRemoveRows(QModelIndex(), 0, m_airports.count());
|
||||
m_airports.clear();
|
||||
m_airportDataFreq.clear();
|
||||
m_airportDataFreqRows.clear();
|
||||
m_showFreq.clear();
|
||||
m_azimuth.clear();
|
||||
m_elevation.clear();
|
||||
endRemoveRows();
|
||||
if (m_airports.count() > 0)
|
||||
{
|
||||
beginRemoveRows(QModelIndex(), 0, m_airports.count() - 1);
|
||||
m_airports.clear();
|
||||
m_airportDataFreq.clear();
|
||||
m_airportDataFreqRows.clear();
|
||||
m_showFreq.clear();
|
||||
m_azimuth.clear();
|
||||
m_elevation.clear();
|
||||
endRemoveRows();
|
||||
}
|
||||
}
|
||||
|
||||
int rowCount(const QModelIndex &parent = QModelIndex()) const override {
|
||||
|
@ -143,12 +143,15 @@ public:
|
||||
}
|
||||
|
||||
void removeAllVORs() {
|
||||
beginRemoveRows(QModelIndex(), 0, m_vors.count());
|
||||
m_vors.clear();
|
||||
m_selected.clear();
|
||||
m_radials.clear();
|
||||
m_vorGUIs.clear();
|
||||
endRemoveRows();
|
||||
if (m_vors.count() > 0)
|
||||
{
|
||||
beginRemoveRows(QModelIndex(), 0, m_vors.count() - 1);
|
||||
m_vors.clear();
|
||||
m_selected.clear();
|
||||
m_radials.clear();
|
||||
m_vorGUIs.clear();
|
||||
endRemoveRows();
|
||||
}
|
||||
}
|
||||
|
||||
QHash<int, QByteArray> roleNames() const {
|
||||
|
@ -351,10 +351,13 @@ public:
|
||||
|
||||
void removeAll()
|
||||
{
|
||||
beginRemoveRows(QModelIndex(), 0, m_items.count());
|
||||
m_items.clear();
|
||||
m_selected.clear();
|
||||
endRemoveRows();
|
||||
if (m_items.count() > 0)
|
||||
{
|
||||
beginRemoveRows(QModelIndex(), 0, m_items.count());
|
||||
m_items.clear();
|
||||
m_selected.clear();
|
||||
endRemoveRows();
|
||||
}
|
||||
}
|
||||
|
||||
void setDisplayNames(bool displayNames)
|
||||
|
@ -144,12 +144,15 @@ public:
|
||||
}
|
||||
|
||||
void removeAllVORs() {
|
||||
beginRemoveRows(QModelIndex(), 0, m_vors.count());
|
||||
m_vors.clear();
|
||||
m_selected.clear();
|
||||
m_radials.clear();
|
||||
m_vorGUIs.clear();
|
||||
endRemoveRows();
|
||||
if (m_vors.count() > 0)
|
||||
{
|
||||
beginRemoveRows(QModelIndex(), 0, m_vors.count() - 1);
|
||||
m_vors.clear();
|
||||
m_selected.clear();
|
||||
m_radials.clear();
|
||||
m_vorGUIs.clear();
|
||||
endRemoveRows();
|
||||
}
|
||||
}
|
||||
|
||||
QHash<int, QByteArray> roleNames() const {
|
||||
|
Loading…
Reference in New Issue
Block a user