|
|
|
#include "view/MainWindow.h"
|
|
|
|
|
|
|
|
#include <QApplication>
|
|
|
|
#include <QJsonDocument>
|
|
|
|
#include <QJsonObject>
|
|
|
|
#include <QJsonArray>
|
|
|
|
#include <QFile>
|
|
|
|
#include <QVector>
|
|
|
|
|
|
|
|
#include "parser/JsonParser.h"
|
|
|
|
#include "viewmodel/table/LogTableModel.h"
|
|
|
|
#include "viewmodel/displayString/SimpleDisplayProviderCreator.h"
|
|
|
|
#include "provider/NetworkProvider.h"
|
|
|
|
|
|
|
|
int main(int argc, char* argv[])
|
|
|
|
{
|
|
|
|
QApplication a(argc, argv);
|
|
|
|
MainWindow w;
|
|
|
|
|
|
|
|
DataProvider_ptr testProvider =
|
|
|
|
std::make_shared<NetworkProvider>(QHostAddress::LocalHost, 12345);
|
|
|
|
auto warehouse = std::make_shared<LogWarehouse>();
|
|
|
|
|
|
|
|
QObject::connect(dynamic_cast<QObject*>(testProvider.get()),
|
|
|
|
SIGNAL(provided(const Log_ptr)),
|
|
|
|
warehouse.get(),
|
|
|
|
SLOT(addData(const Log_ptr)),
|
|
|
|
Qt::DirectConnection);
|
|
|
|
|
|
|
|
auto model = new LogTableModel(warehouse);
|
|
|
|
model->setDisplayProviderCreator(std::make_shared<SimpleDisplayProviderCreator>());
|
|
|
|
w.setTable(model);
|
|
|
|
w.show();
|
|
|
|
|
|
|
|
return a.exec();
|
|
|
|
}
|