Files
VX5_KRO_GearPump/scene/DlgQrcodeFormat.cpp
T

34 lines
949 B
C++

#include "DlgQrcodeFormat.h"
#include "ui_DlgQrcodeFormat.h"
DlgQrcodeFormat::DlgQrcodeFormat(QWidget *parent) :
QDialog(parent),
ui(new Ui::DlgQrcodeFormat)
{
ui->setupUi(this);
setViewModel(m_vm);
}
DlgQrcodeFormat::~DlgQrcodeFormat()
{
delete ui;
}
void DlgQrcodeFormat::setViewModel(DlgQrcodeFormatVM vm)
{
m_vm = vm;
ui->comboBoxType->setCurrentIndex(int(vm.type));
ui->comboBoxInkColor->setCurrentIndex(int(vm.inkType));
ui->comboBox_DMType->setCurrentIndex(int(vm.size));
ui->comboBox_QRCodeLevel->setCurrentIndex(int(vm.level));
}
DlgQrcodeFormatVM DlgQrcodeFormat::viewModel()
{
m_vm.type = QRCodeType(ui->comboBoxType->currentIndex());
m_vm.inkType = InkType(ui->comboBoxInkColor->currentIndex());
m_vm.level = QRCodeLevel(ui->comboBox_QRCodeLevel->currentIndex());
m_vm.size = QRCodeSize(ui->comboBox_DMType->currentIndex());
return m_vm;
}