src/EditProductTab6.cpp

changeset 476
29487eac1183
parent 464
1fed3ff9a64e
child 478
a3653722b0d6
equal deleted inserted replaced
475:895c5ae1dab1 476:29487eac1183
1057 1057
1058 item = new QTableWidgetItem(QString("%1").arg(product->yeasts.at(product->yeasts_row).attenuation, 2, 'f', 1, '0')); 1058 item = new QTableWidgetItem(QString("%1").arg(product->yeasts.at(product->yeasts_row).attenuation, 2, 'f', 1, '0'));
1059 item->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter); 1059 item->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter);
1060 ui->yeastsTable->setItem(product->yeasts_row, 8, item); 1060 ui->yeastsTable->setItem(product->yeasts_row, 8, item);
1061 1061
1062 if (product->yeasts.at(product->yeasts_row).use != YEAST_USE_BOTTLE && product->yeasts.at(product->yeasts_row).sta1) {
1063 QWidget *pWidget = new QWidget();
1064 QLabel *label = new QLabel;
1065 label->setPixmap(QPixmap(":icons/silk/tick.png"));
1066 QHBoxLayout *pLayout = new QHBoxLayout(pWidget);
1067 pLayout->addWidget(label);
1068 pLayout->setAlignment(Qt::AlignCenter);
1069 pLayout->setContentsMargins(0, 0, 0, 0);
1070 pWidget->setLayout(pLayout);
1071 ui->yeastsTable->setCellWidget(product->yeasts_row, 9, pWidget);
1072 } else {
1073 ui->yeastsTable->removeCellWidget(product->yeasts_row, 9);
1074 }
1075
1062 if (product->yeasts.at(product->yeasts_row).form == YEAST_FORMS_LIQUID) 1076 if (product->yeasts.at(product->yeasts_row).form == YEAST_FORMS_LIQUID)
1063 item = new QTableWidgetItem(QString("%1 pack").arg(product->yeasts.at(product->yeasts_row).amount, 1, 'f', 0, '0')); 1077 item = new QTableWidgetItem(QString("%1 pack").arg(product->yeasts.at(product->yeasts_row).amount, 1, 'f', 0, '0'));
1064 else if (product->yeasts.at(product->yeasts_row).form == YEAST_FORMS_DRY || product->yeasts.at(product->yeasts_row).form == YEAST_FORMS_DRIED) 1078 else if (product->yeasts.at(product->yeasts_row).form == YEAST_FORMS_DRY || product->yeasts.at(product->yeasts_row).form == YEAST_FORMS_DRIED)
1065 item = new QTableWidgetItem(QString("%1 gr").arg(product->yeasts.at(product->yeasts_row).amount * 1000.0, 3, 'f', 2, '0')); 1079 item = new QTableWidgetItem(QString("%1 gr").arg(product->yeasts.at(product->yeasts_row).amount * 1000.0, 3, 'f', 2, '0'));
1066 else 1080 else
1067 item = new QTableWidgetItem(QString("%1 ml").arg(product->yeasts.at(product->yeasts_row).amount * 1000.0, 3, 'f', 2, '0')); 1081 item = new QTableWidgetItem(QString("%1 ml").arg(product->yeasts.at(product->yeasts_row).amount * 1000.0, 3, 'f', 2, '0'));
1068 item->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter); 1082 item->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter);
1069 ui->yeastsTable->setItem(product->yeasts_row, 9, item); 1083 ui->yeastsTable->setItem(product->yeasts_row, 10, item);
1070 1084
1071 /* 1085 /*
1072 * If there is no need for a starter, wipe it. 1086 * If there is no need for a starter, wipe it.
1073 */ 1087 */
1074 bool maybe_starter = false; 1088 bool maybe_starter = false;

mercurial