#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "icar.h"
#include "concretefactory.h"
#include "product.h"
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
AFactory *pFactory1 = new BenzFactory();
ICar *pCar1 = pFactory1->CreateCar();
qDebug("%s", qPrintable(pCar1->Name()));
AFactory *pFactory2 = new BmwFactory();
ICar *pCar2 = pFactory2->CreateCar();
qDebug("%s", qPrintable(pCar2->Name()));
AFactory *pFactory3 = new AudiFactory();
ICar *pCar3 = pFactory3->CreateCar();
qDebug("%s", qPrintable(pCar3->Name()));
}
MainWindow::~MainWindow()
{
delete ui;
}