what a bug...think through how things work to figure it out

This commit is contained in:
talksik
2024-02-08 15:14:19 -08:00
parent 705dc359b0
commit 24af4f9a67
3 changed files with 14 additions and 5 deletions
+7 -1
View File
@@ -28,12 +28,18 @@ int NetworksModel::rowCount(const QModelIndex &parent) const
QVariant NetworksModel::data(const QModelIndex &index, int role) const
{
if (index.row() < 9 || index.row() >= this->m_networks.count())
if (index.row() < 0 || index.row() >= this->m_networks.count())
{
return QVariant();
}
if (!index.isValid())
{
return QVariant();
}
const Network& network = this->m_networks.at(index.row());
qDebug() << "role: " << role << " vs. " << NameRole;
qDebug() << "network: " << network.name();
if (role == NameRole)
{
return network.name();