diff --git a/ScreenPlay.pro b/ScreenPlay.pro index 8b1e5814..675818af 100644 --- a/ScreenPlay.pro +++ b/ScreenPlay.pro @@ -2,6 +2,7 @@ TEMPLATE = subdirs SUBDIRS = \ ScreenPlay/ScreenPlay.pro \ ScreenPlaySDK/Screenplaysdk.pro \ + ScreenPlaySysInfo/ScreenPlaySysInfo.pro \ ScreenPlayWindow/ScreenPlayWindow.pro \ ScreenPlay/ThirdParty/qt-google-analytics/qt-google-analytics.pro \ ScreenPlay/ThirdParty/stomt-qt-sdk/sdk/stomt-qt-sdk.pro \ diff --git a/ScreenPlaySysInfo/ScreenPlaySysInfo.pro b/ScreenPlaySysInfo/ScreenPlaySysInfo.pro new file mode 100644 index 00000000..77fdc807 --- /dev/null +++ b/ScreenPlaySysInfo/ScreenPlaySysInfo.pro @@ -0,0 +1,34 @@ +TEMPLATE = lib +TARGET = ScreenPlaySysInfo +QT += qml quick +CONFIG += plugin c++11 + +TARGET = $$qtLibraryTarget($$TARGET) +uri = net.aimber.sysinfo + +# Input +SOURCES += \ + screenplaysysinfo_plugin.cpp \ + sysinfo.cpp + +HEADERS += \ + screenplaysysinfo_plugin.h \ + sysinfo.h + +DISTFILES = qmldir + +!equals(_PRO_FILE_PWD_, $$OUT_PWD) { + copy_qmldir.target = $$OUT_PWD/qmldir + copy_qmldir.depends = $$_PRO_FILE_PWD_/qmldir + copy_qmldir.commands = $(COPY_FILE) \"$$replace(copy_qmldir.depends, /, $$QMAKE_DIR_SEP)\" \"$$replace(copy_qmldir.target, /, $$QMAKE_DIR_SEP)\" + QMAKE_EXTRA_TARGETS += copy_qmldir + PRE_TARGETDEPS += $$copy_qmldir.target +} + +qmldir.files = qmldir + +installPath = $$[QT_INSTALL_QML]/$$replace(uri, \\., /) +qmldir.path = $$installPath +target.path = $$installPath +INSTALLS += target qmldir + diff --git a/ScreenPlaySysInfo/qmldir b/ScreenPlaySysInfo/qmldir new file mode 100644 index 00000000..91ce4148 --- /dev/null +++ b/ScreenPlaySysInfo/qmldir @@ -0,0 +1,2 @@ +module net.aimber.sysinfo +plugin ScreenPlaySysInfo diff --git a/ScreenPlaySysInfo/screenplaysysinfo_plugin.cpp b/ScreenPlaySysInfo/screenplaysysinfo_plugin.cpp new file mode 100644 index 00000000..e75e0bb5 --- /dev/null +++ b/ScreenPlaySysInfo/screenplaysysinfo_plugin.cpp @@ -0,0 +1,11 @@ +#include "screenplaysysinfo_plugin.h" +#include "sysinfo.h" + +#include + +void ScreenPlaySysInfoPlugin::registerTypes(const char *uri) +{ + // @uri net.aimber.sysinfo + qmlRegisterType(uri, 1, 0, "SysInfo"); +} + diff --git a/ScreenPlaySysInfo/screenplaysysinfo_plugin.h b/ScreenPlaySysInfo/screenplaysysinfo_plugin.h new file mode 100644 index 00000000..8e604f44 --- /dev/null +++ b/ScreenPlaySysInfo/screenplaysysinfo_plugin.h @@ -0,0 +1,12 @@ +#pragma once + +#include + +class ScreenPlaySysInfoPlugin : public QQmlExtensionPlugin +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid) + +public: + void registerTypes(const char *uri); +}; diff --git a/ScreenPlaySysInfo/sysinfo.cpp b/ScreenPlaySysInfo/sysinfo.cpp new file mode 100644 index 00000000..b1dc6f68 --- /dev/null +++ b/ScreenPlaySysInfo/sysinfo.cpp @@ -0,0 +1,15 @@ +#include "sysinfo.h" + +SysInfo::SysInfo(QQuickItem *parent): + QQuickItem(parent) +{ + // By default, QQuickItem does not draw anything. If you subclass + // QQuickItem to create a visual item, you will need to uncomment the + // following line and re-implement updatePaintNode() + + // setFlag(ItemHasContents, true); +} + +SysInfo::~SysInfo() +{ +} diff --git a/ScreenPlaySysInfo/sysinfo.h b/ScreenPlaySysInfo/sysinfo.h new file mode 100644 index 00000000..cf22e58a --- /dev/null +++ b/ScreenPlaySysInfo/sysinfo.h @@ -0,0 +1,16 @@ +#ifndef SYSINFO_H +#define SYSINFO_H + +#include + +class SysInfo : public QQuickItem +{ + Q_OBJECT + Q_DISABLE_COPY(SysInfo) + +public: + SysInfo(QQuickItem *parent = nullptr); + ~SysInfo(); +}; + +#endif // SYSINFO_H