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.

29 lines
626 B
C++

#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->show();
connect(wizard, &QDialog::accepted, [this, data](){
CampShopItemPtr item(new CampShopItem);
item->setUnitPrice(data->totalPrice());
emit itemPrepared(item, 1);
});
}