showing items after 10 or so items in the model data

This commit is contained in:
talksik
2024-02-08 14:40:23 -08:00
parent f347a5d936
commit 705dc359b0
3 changed files with 30 additions and 31 deletions
+7 -4
View File
@@ -18,9 +18,6 @@ NetworksModel::NetworksModel(QObject *parent)
:
QAbstractListModel(parent)
{
QList<Network> networks;
networks.append(Network("Gita test"));
this->m_networks = networks;
}
int NetworksModel::rowCount(const QModelIndex &parent) const
@@ -47,12 +44,18 @@ QVariant NetworksModel::data(const QModelIndex &index, int role) const
void NetworksModel::scan()
{
beginInsertRows(QModelIndex(), this->rowCount(), this->rowCount());
QList<Network> networks = this->m_networkScanner.scanForNetworks();
for (const Network& network: networks)
{
qDebug() << "Got network: " << network.name() << Qt::endl;
this->m_networks << network;
}
this->m_networks = networks;
qDebug() << "now have " << this->m_networks.size() << Qt::endl;
endInsertRows();
}
QHash<int, QByteArray> NetworksModel::roleNames() const