Commit 6306f597 authored by Richard Lin's avatar Richard Lin
Browse files

Finish: pulgin

parent 11c0659b
#include "scenemanager.h"
sceneManager::sceneManager(QObject *parent) : QObject(parent)
{
}
#ifndef SCENEMANAGER_H
#define SCENEMANAGER_H
#include <QObject>
class sceneManager : public QObject
{
Q_OBJECT
public:
explicit sceneManager(QObject *parent = nullptr);
signals:
public slots:
};
#endif // SCENEMANAGER_H
\ No newline at end of file
<!DOCTYPE RCC>
<RCC version="1.0"/>
QT+= network widgets
TEMPLATE = lib
CONFIG += plugin
TARGET = $$qtLibraryTarget(TritonScene)
DESTDIR = ../../ScenePlugin
CONFIG += c++11
INCLUDEPATH += $$PWD\
HEADERS += \
$$PWD/plugin.h
SOURCES += \
$$PWD/plugin.cpp
RESOURCES += \
res.qrc
DISTFILES += \
meta-data.json
#interface:
include(../../Interface/Interface.pri)
import QtQuick 2.0
Item {
width: 1920
height: 720
Image {
id: bg
anchors.fill: parent
source: ":/img/main.png"
}
}
{
"name" : "Triton",
"version" : 1,
"type" : "scenePlugin",
"entryPath" : ":/content/tritonScene.qml"
}
#if _MSC_VER >= 1600
#pragma execution_character_set("utf-8")
#endif
#include <QImage>
#include "plugin.h"
Plugin::Plugin(QObject *parent) : iPlugin(parent)
{
initialRes();
_snapShot = new QImage(":/content/img/snapshot.png","PNG");
}
Plugin::~Plugin(){
cleanUpRes();
delete _snapShot;
}
void Plugin::initialRes(void){
Q_INIT_RESOURCE(res);
}
void Plugin::cleanUpRes(void){
Q_CLEANUP_RESOURCE(res);
}
QImage* Plugin::snapShot(void) const{
return _snapShot;
}
#ifndef PLUGIN
#define PLUGIN
/*!
* \brief The TritonScene Plugin
* TritonScene is a demo scene plugin, reuse some design of triton-ui cluster
*/
#include <QObject>
#include "iplugin.h"
/*!
* \brief The Plugin class
* The Plugin class is a decorator of the scene plugin,
* provide a handler for complex interactivities
*/
class Plugin : public iPlugin
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "com.tqc.instrumentCluster.tritonScene" FILE "meta-data.json")
Q_INTERFACES(iPlugin)
public:
/*!
* Constructor
*/
explicit Plugin(QObject *parent = 0);
~Plugin();
public slots:
virtual void initialRes(void);
virtual void cleanUpRes(void);
virtual QImage *snapShot(void) const;
private:
QImage* _snapShot;
};
#endif // PLUGIN
<RCC>
<qresource prefix="/">
<file>content/img/main.png</file>
<file>content/img/snapshot.png</file>
<file>content/TritonScene.qml</file>
</qresource>
</RCC>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment