qmlfrontend/preview_acceptor.cpp
author unC0Rr
Wed, 28 Aug 2024 13:36:52 +0200
changeset 16019 eb015d6b4a2a
parent 14371 90bd2c331703
permissions -rw-r--r--
Avoid creating unused string that is quite costly to produce

#include "preview_acceptor.h"

#include <QImage>
#include <QQmlEngine>

#include "preview_image_provider.h"

PreviewAcceptor::PreviewAcceptor(QQmlEngine *engine, QObject *parent)
    : QObject(parent), m_previewProvider(new PreviewImageProvider()) {
  engine->addImageProvider(QLatin1String("preview"), m_previewProvider);
}

void PreviewAcceptor::setImage(const QImage &preview) {
  m_previewProvider->setImage(preview);
}