CustomSqlModel
::CustomSqlModel(QObject *parent
){
connect(timer, SIGNAL(timeout()), this, SLOT(dataChanged(const QModelIndex&, const QModelIndex&))); //Can i connect the timer to the dataChanged() slot on this way?
timer->start(1000);
//a custom slot
connect(model,
SIGNAL(dataChanged
(const QModelIndex
&,
const QModelIndex
&)),
this,
SLOT(dataChanged
(const QModelIndex &topLeft,
QModelIndex &bottomRight
)));
}
{
if (role == Qt::BackgroundColorRole)
{
int val = index.model()->data(index, Qt::DisplayRole).toInt() < 1;
if(index.column() == 8 && val )
return qVariantFromValue
(QColor(Qt
::yellow));
// Want to blink these color with a timer into the custom slot dataChanged(). return qVariantFromValue
(QColor(Qt
::grey));
}
return value;
}
{
// What to put here.
emit dataChanged(topLeft, bottomRight); //?
}