add input demo
This commit is contained in:
22
doric-Qt/example/doric/shader/DoricInputNode.cpp
Normal file
22
doric-Qt/example/doric/shader/DoricInputNode.cpp
Normal file
@@ -0,0 +1,22 @@
|
||||
#include "DoricInputNode.h"
|
||||
|
||||
QQuickItem *DoricInputNode::build() {
|
||||
QQmlComponent component(getContext()->getQmlEngine());
|
||||
|
||||
const QUrl url(QStringLiteral("qrc:/doric/qml/input.qml"));
|
||||
component.loadUrl(url);
|
||||
|
||||
if (component.isError()) {
|
||||
qCritical() << component.errorString();
|
||||
}
|
||||
|
||||
QQuickItem *item = qobject_cast<QQuickItem *>(component.create());
|
||||
this->createLayouts(item);
|
||||
|
||||
item->setProperty("wrapper", QString::number((qint64)this));
|
||||
return item;
|
||||
}
|
||||
|
||||
void DoricInputNode::blend(QQuickItem *view, QString name, QJsonValue prop) {
|
||||
{ DoricViewNode::blend(view, name, prop); }
|
||||
}
|
17
doric-Qt/example/doric/shader/DoricInputNode.h
Normal file
17
doric-Qt/example/doric/shader/DoricInputNode.h
Normal file
@@ -0,0 +1,17 @@
|
||||
#ifndef DORICINPUTNODE_H
|
||||
#define DORICINPUTNODE_H
|
||||
|
||||
#include "DoricExport.h"
|
||||
|
||||
#include "DoricViewNode.h"
|
||||
|
||||
class DORIC_EXPORT DoricInputNode : public DoricViewNode {
|
||||
public:
|
||||
using DoricViewNode::DoricViewNode;
|
||||
|
||||
QQuickItem *build() override;
|
||||
|
||||
virtual void blend(QQuickItem *view, QString name, QJsonValue prop) override;
|
||||
};
|
||||
|
||||
#endif // DORICINPUTNODE_H
|
Reference in New Issue
Block a user