QVariant serviceData( int column ) const { HostService hs = hostServiceByColumn( column ); if( hs.isRecord() ) return hs.enabled() ? "Enabled" : "Disabled"; return "No Service"; }
QVariant ServiceItem::modelData( const QModelIndex & i, int role ) { int col = i.column(); if( col == 0 && role == Qt::CheckStateRole ) return toggle ? Qt::Checked : Qt::Unchecked; if( col == 0 && role == Qt::DisplayRole ) return name; if( col == 1 && role == Qt::CheckStateRole ) return (hs.isRecord() && hs.enabled()) ? Qt::Checked : Qt::Unchecked; return QVariant(); }