Esempio n. 1
0
void DataModel::updateComponents() {
    if(!isLoad) {
        logger.reportWarning(tr("Attempt to show data before load"));
        return;
    }

    components.cleanAll();
    components.setHeader(QString("Id,Name,Value,Unit,Description").split(','));
    for(int i=0;i<dat->componentsLength();i++) {
        Component *c = dat->componentsAt(i);
        QStringList r;
        r.append(c->Id());
        r.append(c->Name());
        r.append(QString::number(c->Value()));
        r.append(c->Unit());
        r.append(c->Description());
        components.addRow(r);
    }
}
Esempio n. 2
0
 void RegisterSubject (Component &com)
 {
     component_map_.insert (make_pair (com.Id(), &com));
 }