Pass index.parent() as parent parameter for rowCount
Signed-off-by: TheLastRar <TheLastRar@users.noreply.github.com>
This commit is contained in:
parent
ac993aa31f
commit
aef5349aee
@ -613,7 +613,7 @@ QVariant PackProfile::data(const QModelIndex &index, int role) const
|
|||||||
|
|
||||||
bool PackProfile::setData(const QModelIndex& index, const QVariant& value, int role)
|
bool PackProfile::setData(const QModelIndex& index, const QVariant& value, int role)
|
||||||
{
|
{
|
||||||
if (!index.isValid() || index.row() < 0 || index.row() >= rowCount(index))
|
if (!index.isValid() || index.row() < 0 || index.row() >= rowCount(index.parent()))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -421,7 +421,7 @@ int AccountList::columnCount(const QModelIndex &parent) const
|
|||||||
|
|
||||||
Qt::ItemFlags AccountList::flags(const QModelIndex &index) const
|
Qt::ItemFlags AccountList::flags(const QModelIndex &index) const
|
||||||
{
|
{
|
||||||
if (index.row() < 0 || index.row() >= rowCount(index) || !index.isValid())
|
if (index.row() < 0 || index.row() >= rowCount(index.parent()) || !index.isValid())
|
||||||
{
|
{
|
||||||
return Qt::NoItemFlags;
|
return Qt::NoItemFlags;
|
||||||
}
|
}
|
||||||
|
@ -426,7 +426,7 @@ QVariant ResourceFolderModel::data(const QModelIndex& index, int role) const
|
|||||||
bool ResourceFolderModel::setData(const QModelIndex& index, const QVariant& value, int role)
|
bool ResourceFolderModel::setData(const QModelIndex& index, const QVariant& value, int role)
|
||||||
{
|
{
|
||||||
int row = index.row();
|
int row = index.row();
|
||||||
if (row < 0 || row >= rowCount(index) || !index.isValid())
|
if (row < 0 || row >= rowCount(index.parent()) || !index.isValid())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (role == Qt::CheckStateRole)
|
if (role == Qt::CheckStateRole)
|
||||||
|
Loading…
Reference in New Issue
Block a user