2026年5月23日暂存
This commit is contained in:
+17
-3
@@ -87,7 +87,16 @@ BarcodeEditor::~BarcodeEditor()
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void BarcodeEditor::bindViewModel(const BarcodeViewModel& vm)
|
||||
void BarcodeEditor::bindSysPara(SysPara *sysPara)
|
||||
{
|
||||
if (!sysPara) {
|
||||
qWarning() << "BarcodeEditor::bindSysPara: null pointer passed, ignored";
|
||||
return;
|
||||
}
|
||||
m_sysPara = sysPara;
|
||||
}
|
||||
|
||||
void BarcodeEditor::bindViewModel(const BarcodeViewModel &vm)
|
||||
{
|
||||
m_vm = vm;
|
||||
|
||||
@@ -221,7 +230,7 @@ BarcodeViewModel BarcodeEditor::viewModel()
|
||||
|
||||
void BarcodeEditor::restoreViewModel()
|
||||
{
|
||||
m_vm.generalSettingsVM = ItemGeneralSettingsVM();
|
||||
m_vm.generalSettingsVM = TextItemModel();
|
||||
m_vm.contentPattern = "";
|
||||
m_vm.counterViewModel = CounterViewModel();
|
||||
m_vm.dateViewModel = DateItemModel::createDefaultReplaceModel();
|
||||
@@ -238,7 +247,12 @@ void BarcodeEditor::applyCounterConfigToSysPara()
|
||||
{
|
||||
if(!m_vm.contentPattern.contains("{c}"))
|
||||
return;
|
||||
|
||||
|
||||
if (!m_sysPara) {
|
||||
qWarning() << "BarcodeEditor::applyCounterConfigToSysPara: m_sysPara is null, skipping";
|
||||
return;
|
||||
}
|
||||
|
||||
CounterEditorVM cnt = m_counterEditor->viewModel();
|
||||
if(cnt.counterType == COUNTER_TYPE_1) {
|
||||
m_sysPara->para.cnt1StartValue = cnt.counter1.startValue;
|
||||
|
||||
Reference in New Issue
Block a user