You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
973 B
37 lines
973 B
7 years ago
|
#include "samplecoreapp.h"
|
||
|
#include "sampleviewmodel.h"
|
||
|
#include <QtCore/QDebug>
|
||
|
#include <QtCore/QLoggingCategory>
|
||
|
#include <QtMvvmCore/QtMvvmCoreVersion>
|
||
|
#include <QtDataSync/Setup>
|
||
|
|
||
|
SampleCoreApp::SampleCoreApp(QObject *parent) :
|
||
|
CoreApp(parent)
|
||
|
{
|
||
|
QCoreApplication::setApplicationName(QStringLiteral("QtMvvmDataSyncSample"));
|
||
|
QCoreApplication::setApplicationVersion(QStringLiteral(QTMVVMCORE_VERSION_STR));
|
||
|
QCoreApplication::setOrganizationName(QStringLiteral("Skycoder42"));
|
||
|
}
|
||
|
|
||
|
void SampleCoreApp::performRegistrations()
|
||
|
{
|
||
|
qRegisterMetaType<SampleData>();
|
||
|
QLoggingCategory::setFilterRules(QStringLiteral("qtmvvm.debug=true"));
|
||
|
}
|
||
|
|
||
|
int SampleCoreApp::startApp(const QStringList &arguments)
|
||
|
{
|
||
|
auto setup = QtDataSync::DefaultSetup;
|
||
|
if(arguments.size() > 1)
|
||
|
setup = arguments.value(1);
|
||
|
|
||
|
try {
|
||
|
QtDataSync::Setup().create(setup);
|
||
|
show<SampleViewModel>();
|
||
|
return EXIT_SUCCESS;
|
||
|
} catch (QException &e) {
|
||
|
qCritical() << e.what();
|
||
|
return EXIT_FAILURE;
|
||
|
}
|
||
|
}
|