qmlfrontend/preview_acceptor.h
author unC0Rr
Tue, 04 Feb 2025 17:31:55 +0100
branchqmlrenderer
changeset 16116 8da5a118120b
parent 14392 90bd2c331703
permissions -rw-r--r--
Modernize approach for building qmlfrontend
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
14392
90bd2c331703 Add possibility to instantiate HWEngine objects from QML, reorganize work with preview
unC0Rr
parents:
diff changeset
     1
#ifndef PREVIEW_ACCEPTOR_H
90bd2c331703 Add possibility to instantiate HWEngine objects from QML, reorganize work with preview
unC0Rr
parents:
diff changeset
     2
#define PREVIEW_ACCEPTOR_H
90bd2c331703 Add possibility to instantiate HWEngine objects from QML, reorganize work with preview
unC0Rr
parents:
diff changeset
     3
90bd2c331703 Add possibility to instantiate HWEngine objects from QML, reorganize work with preview
unC0Rr
parents:
diff changeset
     4
#include <QObject>
16116
8da5a118120b Modernize approach for building qmlfrontend
unC0Rr
parents: 14392
diff changeset
     5
#include <QtQmlIntegration>
14392
90bd2c331703 Add possibility to instantiate HWEngine objects from QML, reorganize work with preview
unC0Rr
parents:
diff changeset
     6
90bd2c331703 Add possibility to instantiate HWEngine objects from QML, reorganize work with preview
unC0Rr
parents:
diff changeset
     7
class QQmlEngine;
90bd2c331703 Add possibility to instantiate HWEngine objects from QML, reorganize work with preview
unC0Rr
parents:
diff changeset
     8
class PreviewImageProvider;
16116
8da5a118120b Modernize approach for building qmlfrontend
unC0Rr
parents: 14392
diff changeset
     9
class QJSEngine;
14392
90bd2c331703 Add possibility to instantiate HWEngine objects from QML, reorganize work with preview
unC0Rr
parents:
diff changeset
    10
90bd2c331703 Add possibility to instantiate HWEngine objects from QML, reorganize work with preview
unC0Rr
parents:
diff changeset
    11
class PreviewAcceptor : public QObject {
90bd2c331703 Add possibility to instantiate HWEngine objects from QML, reorganize work with preview
unC0Rr
parents:
diff changeset
    12
  Q_OBJECT
16116
8da5a118120b Modernize approach for building qmlfrontend
unC0Rr
parents: 14392
diff changeset
    13
8da5a118120b Modernize approach for building qmlfrontend
unC0Rr
parents: 14392
diff changeset
    14
  QML_ELEMENT
8da5a118120b Modernize approach for building qmlfrontend
unC0Rr
parents: 14392
diff changeset
    15
  QML_SINGLETON
8da5a118120b Modernize approach for building qmlfrontend
unC0Rr
parents: 14392
diff changeset
    16
14392
90bd2c331703 Add possibility to instantiate HWEngine objects from QML, reorganize work with preview
unC0Rr
parents:
diff changeset
    17
 public:
16116
8da5a118120b Modernize approach for building qmlfrontend
unC0Rr
parents: 14392
diff changeset
    18
  static PreviewAcceptor *create(QQmlEngine *engine, QJSEngine *jsEngine);
14392
90bd2c331703 Add possibility to instantiate HWEngine objects from QML, reorganize work with preview
unC0Rr
parents:
diff changeset
    19
  explicit PreviewAcceptor(QQmlEngine *engine, QObject *parent = nullptr);
90bd2c331703 Add possibility to instantiate HWEngine objects from QML, reorganize work with preview
unC0Rr
parents:
diff changeset
    20
16116
8da5a118120b Modernize approach for building qmlfrontend
unC0Rr
parents: 14392
diff changeset
    21
 public Q_SLOTS:
14392
90bd2c331703 Add possibility to instantiate HWEngine objects from QML, reorganize work with preview
unC0Rr
parents:
diff changeset
    22
  void setImage(const QImage &preview);
90bd2c331703 Add possibility to instantiate HWEngine objects from QML, reorganize work with preview
unC0Rr
parents:
diff changeset
    23
90bd2c331703 Add possibility to instantiate HWEngine objects from QML, reorganize work with preview
unC0Rr
parents:
diff changeset
    24
 private:
90bd2c331703 Add possibility to instantiate HWEngine objects from QML, reorganize work with preview
unC0Rr
parents:
diff changeset
    25
  PreviewImageProvider *m_previewProvider;
90bd2c331703 Add possibility to instantiate HWEngine objects from QML, reorganize work with preview
unC0Rr
parents:
diff changeset
    26
};
90bd2c331703 Add possibility to instantiate HWEngine objects from QML, reorganize work with preview
unC0Rr
parents:
diff changeset
    27
90bd2c331703 Add possibility to instantiate HWEngine objects from QML, reorganize work with preview
unC0Rr
parents:
diff changeset
    28
#endif  // PREVIEW_ACCEPTOR_H