flib:
- Ability to pass raw data via IPC
qmlfrontend:
- Pass message received by callback through event loop to handle it in main thread
- Get preview image from engine on button click and render it in Image object
#ifndef HWENGINE_H
#define HWENGINE_H
#include <QObject>
#include <QByteArray>
#include <QVector>
#include <QPixmap>
#include "flib.h"
class QQmlEngine;
class HWEngine : public QObject
{
Q_OBJECT
public:
explicit HWEngine(QQmlEngine * engine, QObject *parent = 0);
~HWEngine();
static void exposeToQML();
Q_INVOKABLE void run();
signals:
void previewImageChanged();
public slots:
private:
QList<QByteArray> m_argsList;
QVector<const char *> m_args;
QQmlEngine * m_engine;
static void engineMessageCallback(void *context, const char * msg, quint32 len);
void sendIPC(const QByteArray &b);
private slots:
void engineMessageHandler(const QByteArray &msg);
};
#endif // HWENGINE_H