-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
59 lines (51 loc) · 2.17 KB
/
main.cpp
File metadata and controls
59 lines (51 loc) · 2.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <QQmlContext>
#include "Bio2DImageView.h"
#include "BioImage.h"
#include "Anisotropy.h"
#include "BioImageProvider.h"
#include "BioImageManager.h"
#include <QImage>
#include <QRgb>
#include <QApplication>
#include <QQuickView>
#include <QQmlDebuggingEnabler>
#include "DataModel.h"
int main(int argc, char *argv[])
{
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QQmlDebuggingEnabler enabler;
QApplication app(argc, argv);
QApplication::setApplicationName("Anisotropy");
QApplication::setOrganizationName("CellphyLab");
QApplication::setOrganizationDomain("CellphyLab.com");
qmlRegisterType<zeroth::BioImage>("BioImages", 1, 0, "BioImage");
// qmlRegisterType<Bio2DImageView>("BioImages", 1,0, "BioImage2DViewer");
qmlRegisterType<Anisotropy>("BioImages", 1,0, "Anisotropy");
qmlRegisterType<zeroth::Histogram>("BioImages", 1,0, "Histogram");
qmlRegisterType<DataModel>("BioImages", 1, 0, "DataModel");
/*QQmlApplicationEngine engine;
engine.addImageProvider("Bi", new BioImageProvider);
engine.rootContext()->setContextProperty("app", &app);
engine.rootContext()->setContextProperty("Manager", &BioImageManager::instance());
const QUrl url(QStringLiteral("qrc:/main.qml"));
QObject::connect(&engine, &QQmlApplicationEngine::objectCreated,
&app, [url](QObject *obj, const QUrl &objUrl) {
if (!obj && url == objUrl)
QCoreApplication::exit(-1);
}, Qt::QueuedConnection);
engine.load(url);*/
QQuickView qmlView;
qmlView.engine()->addImageProvider("Bi", new BioImageProvider);
qmlView.engine()->rootContext()->setContextProperty("app", &app);
qmlView.engine()->rootContext()->setContextProperty("qmlWindow", &qmlView);
qmlView.engine()->rootContext()->setContextProperty("Manager", &BioImageManager::instance());
qmlView.setResizeMode(QQuickView::SizeRootObjectToView);
qmlView.setSource(QUrl("qrc:/main.qml"));
qmlView.setMinimumSize(QSize(1366, 768));
qmlView.showMaximized();
qmlView.show();
return app.exec();
// img.save("C:/Code/test_tiff_2.tif");
}