Add .clang-format

This commit is contained in:
Fabien Freling 2019-07-16 13:31:07 +02:00
parent 90526946e6
commit 20041deef5
6 changed files with 158 additions and 143 deletions

View file

@ -1,22 +1,21 @@
#include "oimageprovider.h"
#include "oboy.h"
OImageProvider::OImageProvider(QQmlApplicationEngine &engine)
: QQuickImageProvider(QQuickImageProvider::Image)
, _engine(engine)
OImageProvider::OImageProvider(QQmlApplicationEngine& engine)
: QQuickImageProvider(QQuickImageProvider::Image)
, _engine(engine)
{}
QImage
OImageProvider::requestImage(const QString& id, QSize* size, const QSize& requestedSize)
{
QList<QObject*> roots = _engine.rootObjects();
OBoy* oboy = roots[0]->findChild<OBoy*>("qml_oboy");
if (!oboy) {
qFatal("Cannot find oboy instance.");
}
Q_ASSERT(oboy->loaded());
}
QImage OImageProvider::requestImage(const QString &id, QSize *size, const QSize &requestedSize)
{
QList<QObject*> roots = _engine.rootObjects();
OBoy *oboy = roots[0]->findChild<OBoy*>("qml_oboy");
if (!oboy) {
qFatal("Cannot find oboy instance.");
}
Q_ASSERT(oboy->loaded());
QImage img = oboy->backgroundMap(0);
return img;
QImage img = oboy->backgroundMap(0);
return img;
}