#include "campseller.h" #include "campwizard.h" #include "campservice.h" #include "data/camp-data.h" #include "campshopitem.h" CampSeller::CampSeller(QObject *parent) :ISeller(parent) { } void CampSeller::prepareItem() { CampWizard *wizard = new CampWizard(); wizard->setAttribute(Qt::WA_DeleteOnClose); CampService srv; CampDataPtr data = srv.create(); wizard->setData(data); wizard->setNewRecord(true); wizard->show(); connect(wizard, &QDialog::accepted, [this, data](){ SettingsService settSrv("CAMP"); CampSettingsPtr settings = settSrv.loadSettings(); CampShopItemPtr item(new CampShopItem); item->setUnitPrice(data->totalPrice()); item->setId(data->id()); item->setVatType(settings->vatType()); emit itemPrepared(item, 1); }); }