mirror of
https://gitlab.com/kelteseth/ScreenPlay.git
synced 2024-11-25 04:02:50 +01:00
Add SysInfo Plugin
This commit is contained in:
parent
240c4c3245
commit
758a967c04
@ -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 \
|
||||
|
34
ScreenPlaySysInfo/ScreenPlaySysInfo.pro
Normal file
34
ScreenPlaySysInfo/ScreenPlaySysInfo.pro
Normal file
@ -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
|
||||
|
2
ScreenPlaySysInfo/qmldir
Normal file
2
ScreenPlaySysInfo/qmldir
Normal file
@ -0,0 +1,2 @@
|
||||
module net.aimber.sysinfo
|
||||
plugin ScreenPlaySysInfo
|
11
ScreenPlaySysInfo/screenplaysysinfo_plugin.cpp
Normal file
11
ScreenPlaySysInfo/screenplaysysinfo_plugin.cpp
Normal file
@ -0,0 +1,11 @@
|
||||
#include "screenplaysysinfo_plugin.h"
|
||||
#include "sysinfo.h"
|
||||
|
||||
#include <qqml.h>
|
||||
|
||||
void ScreenPlaySysInfoPlugin::registerTypes(const char *uri)
|
||||
{
|
||||
// @uri net.aimber.sysinfo
|
||||
qmlRegisterType<SysInfo>(uri, 1, 0, "SysInfo");
|
||||
}
|
||||
|
12
ScreenPlaySysInfo/screenplaysysinfo_plugin.h
Normal file
12
ScreenPlaySysInfo/screenplaysysinfo_plugin.h
Normal file
@ -0,0 +1,12 @@
|
||||
#pragma once
|
||||
|
||||
#include <QQmlExtensionPlugin>
|
||||
|
||||
class ScreenPlaySysInfoPlugin : public QQmlExtensionPlugin
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid)
|
||||
|
||||
public:
|
||||
void registerTypes(const char *uri);
|
||||
};
|
15
ScreenPlaySysInfo/sysinfo.cpp
Normal file
15
ScreenPlaySysInfo/sysinfo.cpp
Normal file
@ -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()
|
||||
{
|
||||
}
|
16
ScreenPlaySysInfo/sysinfo.h
Normal file
16
ScreenPlaySysInfo/sysinfo.h
Normal file
@ -0,0 +1,16 @@
|
||||
#ifndef SYSINFO_H
|
||||
#define SYSINFO_H
|
||||
|
||||
#include <QQuickItem>
|
||||
|
||||
class SysInfo : public QQuickItem
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_DISABLE_COPY(SysInfo)
|
||||
|
||||
public:
|
||||
SysInfo(QQuickItem *parent = nullptr);
|
||||
~SysInfo();
|
||||
};
|
||||
|
||||
#endif // SYSINFO_H
|
Loading…
Reference in New Issue
Block a user