You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
780 B
C++
33 lines
780 B
C++
9 years ago
|
#include "accserviceform.h"
|
||
|
#include "ui_accserviceform.h"
|
||
|
|
||
|
AccServiceForm::AccServiceForm(QWidget *parent) :
|
||
|
AutoForm<AccService>(parent),
|
||
|
ui(new Ui::AccServiceForm)
|
||
|
{
|
||
|
ui->setupUi(this);
|
||
|
registerBinding(ui->accServiceName);
|
||
|
registerBinding(ui->price);
|
||
|
registerBinding(ui->salePossible);
|
||
|
registerBinding(ui->active);
|
||
|
|
||
|
}
|
||
|
|
||
|
AccServiceForm::~AccServiceForm()
|
||
|
{
|
||
|
delete ui;
|
||
|
}
|
||
|
|
||
|
void AccServiceForm::bindOtherToUi()
|
||
|
{
|
||
|
ui->serviceType->clear();
|
||
|
ui->serviceType->addItems(QStringList()<<tr("Car")<<tr("Tent")<<tr("Other"));
|
||
|
ui->serviceType->setCurrentIndex(this->entity()->serviceType());
|
||
|
}
|
||
|
|
||
|
bool AccServiceForm::bindOtherToData()
|
||
|
{
|
||
|
this->entity()->setServiceType((AccService::ServiceType)ui->serviceType->currentIndex());
|
||
|
return true;
|
||
|
}
|