Hi,
I have this problem with this function:
void ImageLandmarkProxyModel
::countRowsInserted(const QModelIndex &parent,
int start,
int end
) const {
const int idImageColumn=sourceModel()->column(
ImageLandmarkTableModel::IdImage);
const int idPointColumn=sourceModel()->column(
ImageLandmarkTableModel::IdPoint);
qDebug()<<"Rows inserted";
for(int i=start;i<=end;i++)
{
QModelIndex col1
=sourceModel
()->index
(i, idImageColumn
);
QModelIndex col2
=sourceModel
()->index
(i, idPointColumn
);
bool ok;
int id=col1.data().toInt(&ok);
Q_ASSERT(ok);
if(m_rowCount.contains(id)){
m_rowCount[id]=1;
// m_rowCount[id]=m_rowCount.value(id)+1;
}
else{
// m_rowCount.insert(id, col2.data().isNull() ? 0 : 1);
}
}
qDebug()<<m_rowCount;
}
void ImageLandmarkProxyModel::countRowsInserted(const QModelIndex &parent, int start, int end) const
{
const int idImageColumn=sourceModel()->column(
ImageLandmarkTableModel::IdImage);
const int idPointColumn=sourceModel()->column(
ImageLandmarkTableModel::IdPoint);
qDebug()<<"Rows inserted";
for(int i=start;i<=end;i++)
{
QModelIndex col1=sourceModel()->index(i, idImageColumn);
QModelIndex col2=sourceModel()->index(i, idPointColumn);
bool ok;
int id=col1.data().toInt(&ok);
Q_ASSERT(ok);
if(m_rowCount.contains(id)){
m_rowCount[id]=1;
// m_rowCount[id]=m_rowCount.value(id)+1;
}
else{
// m_rowCount.insert(id, col2.data().isNull() ? 0 : 1);
}
}
qDebug()<<m_rowCount;
}
To copy to clipboard, switch view to plain text mode
src\imagelandmarkproxymodel.cpp:101: error: non-lvalue in assignment
in line: m_rowCount[id]=1;
m_rowCount is a QMap<int,int>
Thanks
Bookmarks