forked from qt-creator/qt-creator
CMake: Fix warnings about cmake configuration model
The index was handled wrongly. Change-Id: I8a98c7a16e32798a9b7662c6c5c1683d248580da Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
@@ -44,17 +44,12 @@ ConfigModel::ConfigModel(QObject *parent) : QAbstractTableModel(parent)
|
||||
|
||||
int ConfigModel::rowCount(const QModelIndex &parent) const
|
||||
{
|
||||
QTC_ASSERT(parent.model() == nullptr || parent.model() == this, return 0);
|
||||
if (parent.isValid())
|
||||
return 0;
|
||||
return m_configuration.count();
|
||||
return parent.isValid() ? 0 : m_configuration.count();
|
||||
}
|
||||
|
||||
int ConfigModel::columnCount(const QModelIndex &parent) const
|
||||
{
|
||||
QTC_ASSERT(!parent.isValid(), return 0);
|
||||
QTC_ASSERT(parent.model() == nullptr, return 0);
|
||||
return 3;
|
||||
return parent.isValid() ? 0 : 3;
|
||||
}
|
||||
|
||||
Qt::ItemFlags ConfigModel::flags(const QModelIndex &index) const
|
||||
|
Reference in New Issue
Block a user