2026年6月22日 :大量更新
This commit is contained in:
@@ -419,17 +419,17 @@ QString ItemUtils::generateTxtFromDateItemModel(const DateItemModel &model, cons
|
||||
QString ItemUtils::generateTxtFromBarcodeViewModel(const BarcodeViewModel &vm, const std::array<int, 2> counterValues, const QDateTime &time)
|
||||
{
|
||||
QString txt = vm.contentPattern;
|
||||
auto pos = vm.contentPattern.indexOf("{t}");
|
||||
auto pos = txt.indexOf("{t}");
|
||||
if(pos != -1) {
|
||||
txt.replace(pos, 3, generateTxtFromDateItemModel(vm.dateViewModel, time));
|
||||
txt = txt.replace(pos, 3, generateTxtFromDateItemModel(vm.dateViewModel, time));
|
||||
}
|
||||
|
||||
pos = vm.contentPattern.indexOf("{c}");
|
||||
pos = txt.indexOf("{c}");
|
||||
if(pos != -1) {
|
||||
auto cntValue = vm.counterViewModel.counterType == COUNTER_TYPE_1 ? counterValues[0] : counterValues[1];
|
||||
auto valueStr = QString("%1").arg(cntValue, 10, QChar('0'));;
|
||||
auto valueStr = QString("%1").arg(cntValue, 8, 10, QLatin1Char('0'));
|
||||
valueStr = valueStr.right(vm.counterViewModel.digitalNum);
|
||||
txt.replace(pos, 3, valueStr);
|
||||
txt = txt.replace(pos, 3, valueStr);
|
||||
}
|
||||
|
||||
return txt;
|
||||
|
||||
Reference in New Issue
Block a user