void TaskView::setData(TaskTableModel& model, size_t rowIdx) { setModel(model); _rowIdx = rowIdx; setTitle(model.title(rowIdx)); setDescription(model.description(rowIdx)); setTimeSpent(model.timeSpent(rowIdx)); setActive(model.active(rowIdx)); }
void Production::load(const YAML::Node &node) { int assigned; int spent; int amount; node["assigned"] >> assigned; node["spent"] >> spent; node["amount"] >> amount; setAssignedEngineers(assigned); setTimeSpent(spent); setAmountTotal(amount); }
void Production::load(const YAML::Node &node) { setAssignedEngineers(node["assigned"].as<int>(getAssignedEngineers())); setTimeSpent(node["spent"].as<int>(getTimeSpent())); setAmountTotal(node["amount"].as<int>(getAmountTotal())); setInfiniteAmount(node["infinite"].as<bool>(getInfiniteAmount())); setSellItems(node["sell"].as<bool>(getSellItems())); // backwards compatibility if (getAmountTotal() == INT_MAX) { setAmountTotal(999); setInfiniteAmount(true); setSellItems(true); } }
void TaskView::modelDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight) { if (topLeft.row() <= _rowIdx && _rowIdx <= bottomRight.row()) { if (topLeft.column() <= TaskTableModel::ColumnIndex_TITLE && TaskTableModel::ColumnIndex_TITLE <= bottomRight.column()) { setTitle(_model->title(_rowIdx)); } if (topLeft.column() <= TaskTableModel::ColumnIndex_DESCRIPTION && TaskTableModel::ColumnIndex_DESCRIPTION <= bottomRight.column()) { setDescription(_model->description(_rowIdx)); } if (topLeft.column() <= TaskTableModel::ColumnIndex_TIME_SPENT && TaskTableModel::ColumnIndex_TIME_SPENT <= bottomRight.column()) { setTimeSpent(_model->timeSpent(_rowIdx)); } } }
void Production::load(const YAML::Node &node) { setAssignedEngineers(node["assigned"].as<int>()); setTimeSpent(node["spent"].as<int>()); setAmountTotal(node["amount"].as<int>()); }