Hi,
My program has been working perfectly with all versions of Qt up to 4.5.2, however with Qt 4.5.3 I have big problems with rows updating in my QTableView.
I'm really stuck because the code has been working fine for so long, I cant narrow down what the problem is 
For example here is my model's data function, column 3 updates randomly, not when the models data actually changes, for example if i click around and resize the tableview it forces the value to update.
{
// Data for table view
if(!index.isValid())
{
}
if(index.row() >= jobs.size() || index.row() < 0)
{
}
if (role == Qt::DisplayRole)
{
...
else if(index.column() == 4)
{
return QString::number(jobs.
at(index.
row()).
getTotalSegments() - jobs.
at(index.
row()).
getIncompleteSegments()) + " of " + QString::number(jobs.
at(index.
row()).
getTotalSegments());
}
}
}
QVariant dlQueueModel::data(const QModelIndex &index, int role) const
{
// Data for table view
if(!index.isValid())
{
return QVariant();
}
if(index.row() >= jobs.size() || index.row() < 0)
{
return QVariant();
}
if (role == Qt::DisplayRole)
{
...
else if(index.column() == 4)
{
return QString::number(jobs.at(index.row()).getTotalSegments() - jobs.at(index.row()).getIncompleteSegments()) +
" of " + QString::number(jobs.at(index.row()).getTotalSegments());
}
}
return QVariant();
}
To copy to clipboard, switch view to plain text mode
When I update the data I call this function:
void dlQueueModel::itemChanged(int aX, int aY, int bX, int bY)
{
// Let the model know its data has changed
emit dataChanged(createIndex(aX, aY), createIndex(bX, bY));
}
void dlQueueModel::itemChanged(int aX, int aY, int bX, int bY)
{
// Let the model know its data has changed
emit dataChanged(createIndex(aX, aY), createIndex(bX, bY));
}
To copy to clipboard, switch view to plain text mode
Does anyone know of anything QTableView related that changed in 4.5.3 that could be causing these issues?
Thanks and sorry for the vagueness!
Bookmarks