#include <iostream>
#include <QApplication>
#include <QQuickView>
#include <QQmlContext>
#include <QIcon>
#include <cvb/ui/image_view_item.hpp>
#include <cvb/image.hpp>
int main(int argc, char* argv[])
{
try
{
QApplication app(argc, argv);
Cvb::UI::ImageViewItem::Register();
QQuickView view;
view.setResizeMode(QQuickView::SizeRootObjectToView);
view.setIcon(QIcon(":/qttutorial.png"));
auto context = view.rootContext();
Cvb::UI::ImageController imageController;
context->setContextProperty("mainImage", &imageController);
view.setSource(QUrl::fromLocalFile("../main.qml"));
imageController.Refresh(image);
view.resize(640, 480);
view.show();
return app.exec();
}
catch (const std::exception& error)
{
std::cout << error.what() << std::endl;
}
}
static std::unique_ptr< Image > Load(const String &fileName)
std::shared_ptr< Image > ImagePtr