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.
prodejna/shop/directsaleform.cpp

38 lines
759 B
C++

#include "directsaleform.h"
#include "ui_directsaleform.h"
DirectSaleForm::DirectSaleForm(QWidget *parent) :
QDialog(parent),
ui(new Ui::DirectSaleForm)
{
ui->setupUi(this);
m_shopItem = QSharedPointer<DirectSaleItem>(new DirectSaleItem);
m_binder.setData(m_shopItem.data());
m_binder.registerBinding(ui->name);
m_binder.registerBinding(ui->unitPrice);
m_binder.registerBinding(ui->count);
m_binder.bindToUi();
}
DirectSaleForm::~DirectSaleForm()
{
delete ui;
}
QSharedPointer<IShopItem> DirectSaleForm::shopItem() const
{
return m_shopItem;
}
void DirectSaleForm::on_buttonBox_rejected()
{
this->reject();
}
void DirectSaleForm::on_buttonBox_accepted()
{
m_binder.bindToData();
this->accept();
}