45 lines
1.3 KiB
C++
Raw Normal View History

2017-07-21 18:21:34 +02:00
/******************************************************************************
* QSkinny - Copyright (C) 2016 Uwe Rathmann
* This file may be used under the terms of the 3-clause BSD License
*****************************************************************************/
#include "Image.h"
2017-07-21 18:21:34 +02:00
#include <SkinnyShapeProvider.h>
#include <SkinnyShortcut.h>
#include <QskGraphicImageProvider.h>
2018-10-04 10:34:44 +02:00
#include <QskQml.h>
2017-07-21 18:21:34 +02:00
#include <QskObjectCounter.h>
#include <QGuiApplication>
2018-08-03 08:15:28 +02:00
#include <QQmlApplicationEngine>
2017-07-21 18:21:34 +02:00
int main( int argc, char* argv[] )
{
#ifdef ITEM_STATISTICS
QskObjectCounter counter( true );
#endif
const char providerId[] = "shapes";
2018-10-04 10:34:44 +02:00
QskQml::registerTypes();
qmlRegisterType< Image >( "Images", 1, 0, "Image" );
2017-07-21 18:21:34 +02:00
Qsk::addGraphicProvider( providerId, new SkinnyShapeProvider() );
QGuiApplication app( argc, argv );
SkinnyShortcut::enable( SkinnyShortcut::Quit |
SkinnyShortcut::DebugShortcuts );
// image provider that falls back to the graphic provider
QskGraphicImageProvider* imageProvider =
new QskGraphicImageProvider( providerId, QQuickImageProvider::Texture );
QQmlApplicationEngine engine( QUrl( "qrc:/qml/images.qml" ) );
engine.addImageProvider( imageProvider->graphicProviderId(), imageProvider );
return app.exec();
}