{
m_backend = backend;
- connect(m_backend, SIGNAL(matchListChanged()),
- this, SLOT(onMatchListChanged()));
+ connect(m_backend, SIGNAL(updateFinished()),
+ this, SLOT(onUpdateFinished()));
}
int MatchDayModel::rowCount(const QModelIndex&) const
int MatchDayModel::columnCount(const QModelIndex&) const
{
- return 10;
+ return 11;
}
QVariant MatchDayModel::data(const QModelIndex& index, int role) const
case Qt::BackgroundRole:
return QBrush(QColor(20, 20, 20, 100));
break;
+
case Qt::DecorationRole:
switch (index.column()) {
case AwayIcon:
s.setHeight(25);
switch (index.column()) {
case Spacer:
- s.setWidth(3);
- break;
+ case Spacer2:
+ s.setWidth(2);
+ break;
case MatchState:
s.setWidth(15);
break;
}
-// only adds for now
-void MatchDayModel::onMatchListChanged(void)
+void MatchDayModel::onUpdateFinished(void)
{
//remove all rows
- //qDebug() << "beginRemoveRows: " << 0 << ", " << rowCount(QModelIndex()) - 1;
+ qDebug() << "beginRemoveRows: " << 0 << ", " << rowCount(QModelIndex()) - 1;
beginRemoveRows(QModelIndex(),
0,
m_lastRowCount);
endRemoveRows();
//add rows
- //qDebug() << "beginInsertRows: " << 0 << ", " << m_backend->matchList().count() - 1;
+ qDebug() << "beginInsertRows: " << 0 << ", " << m_backend->matchList().count() - 1;
beginInsertRows(QModelIndex(),
0,
m_backend->matchList().count() - 1);
m_lastRowCount = m_backend->matchList().count() - 1;
// invalidate complete data
- //qDebug() << "rowCount @ emit dataChanged: " << rowCount(QModelIndex());
+ qDebug() << "rowCount @ emit dataChanged: " << rowCount(QModelIndex());
emit dataChanged(index(0, 0),
index(rowCount(QModelIndex()) - 1, columnCount(QModelIndex()) - 1));