qmlfrontend/preview_acceptor.cpp
author Wuzzy <Wuzzy2@mail.ru>
Mon, 16 Sep 2019 17:33:49 +0200
changeset 15410 8504fee3b601
parent 14371 90bd2c331703
permissions -rw-r--r--
Racer: Fix weird water splashes after waypoint placement Does not affect official racer, as only waypoint placement is touched. The reason was that the air attack gear sometimes was not deleted fast enough so it might occassionally drop some air bombs (these are deleted now). Also, the airplane position was set to water level, which caused another water splash.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
14371
90bd2c331703 Add possibility to instantiate HWEngine objects from QML, reorganize work with preview
unC0Rr
parents:
diff changeset
     1
#include "preview_acceptor.h"
90bd2c331703 Add possibility to instantiate HWEngine objects from QML, reorganize work with preview
unC0Rr
parents:
diff changeset
     2
90bd2c331703 Add possibility to instantiate HWEngine objects from QML, reorganize work with preview
unC0Rr
parents:
diff changeset
     3
#include <QImage>
90bd2c331703 Add possibility to instantiate HWEngine objects from QML, reorganize work with preview
unC0Rr
parents:
diff changeset
     4
#include <QQmlEngine>
90bd2c331703 Add possibility to instantiate HWEngine objects from QML, reorganize work with preview
unC0Rr
parents:
diff changeset
     5
90bd2c331703 Add possibility to instantiate HWEngine objects from QML, reorganize work with preview
unC0Rr
parents:
diff changeset
     6
#include "preview_image_provider.h"
90bd2c331703 Add possibility to instantiate HWEngine objects from QML, reorganize work with preview
unC0Rr
parents:
diff changeset
     7
90bd2c331703 Add possibility to instantiate HWEngine objects from QML, reorganize work with preview
unC0Rr
parents:
diff changeset
     8
PreviewAcceptor::PreviewAcceptor(QQmlEngine *engine, QObject *parent)
90bd2c331703 Add possibility to instantiate HWEngine objects from QML, reorganize work with preview
unC0Rr
parents:
diff changeset
     9
    : QObject(parent), m_previewProvider(new PreviewImageProvider()) {
90bd2c331703 Add possibility to instantiate HWEngine objects from QML, reorganize work with preview
unC0Rr
parents:
diff changeset
    10
  engine->addImageProvider(QLatin1String("preview"), m_previewProvider);
90bd2c331703 Add possibility to instantiate HWEngine objects from QML, reorganize work with preview
unC0Rr
parents:
diff changeset
    11
}
90bd2c331703 Add possibility to instantiate HWEngine objects from QML, reorganize work with preview
unC0Rr
parents:
diff changeset
    12
90bd2c331703 Add possibility to instantiate HWEngine objects from QML, reorganize work with preview
unC0Rr
parents:
diff changeset
    13
void PreviewAcceptor::setImage(const QImage &preview) {
90bd2c331703 Add possibility to instantiate HWEngine objects from QML, reorganize work with preview
unC0Rr
parents:
diff changeset
    14
  m_previewProvider->setImage(preview);
90bd2c331703 Add possibility to instantiate HWEngine objects from QML, reorganize work with preview
unC0Rr
parents:
diff changeset
    15
}