qmlfrontend/preview_acceptor.h
author unC0Rr
Tue, 04 Feb 2025 17:31:55 +0100
branchqmlrenderer
changeset 16087 8da5a118120b
parent 14371 90bd2c331703
permissions -rw-r--r--
Modernize approach for building qmlfrontend

#ifndef PREVIEW_ACCEPTOR_H
#define PREVIEW_ACCEPTOR_H

#include <QObject>
#include <QtQmlIntegration>

class QQmlEngine;
class PreviewImageProvider;
class QJSEngine;

class PreviewAcceptor : public QObject {
  Q_OBJECT

  QML_ELEMENT
  QML_SINGLETON

 public:
  static PreviewAcceptor *create(QQmlEngine *engine, QJSEngine *jsEngine);
  explicit PreviewAcceptor(QQmlEngine *engine, QObject *parent = nullptr);

 public Q_SLOTS:
  void setImage(const QImage &preview);

 private:
  PreviewImageProvider *m_previewProvider;
};

#endif  // PREVIEW_ACCEPTOR_H