add switch bridge
This commit is contained in:
12
doric-Qt/example/doric/utils/DoricSwitchBridge.cpp
Normal file
12
doric-Qt/example/doric/utils/DoricSwitchBridge.cpp
Normal file
@@ -0,0 +1,12 @@
|
||||
#include "DoricSwitchBridge.h"
|
||||
|
||||
#include "shader/DoricSwitchNode.h"
|
||||
|
||||
DoricSwitchBridge::DoricSwitchBridge(QObject *parent) : QObject(parent) {}
|
||||
|
||||
void DoricSwitchBridge::onSwitch(QString pointer, bool checked) {
|
||||
QObject *object = (QObject *)(pointer.toULongLong());
|
||||
DoricSwitchNode *switchNode = dynamic_cast<DoricSwitchNode *>(object);
|
||||
|
||||
switchNode->onSwitch(checked);
|
||||
}
|
19
doric-Qt/example/doric/utils/DoricSwitchBridge.h
Normal file
19
doric-Qt/example/doric/utils/DoricSwitchBridge.h
Normal file
@@ -0,0 +1,19 @@
|
||||
#ifndef DORICSWITCHBRIDGE_H
|
||||
#define DORICSWITCHBRIDGE_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QVariant>
|
||||
|
||||
#include "DoricExport.h"
|
||||
|
||||
class DORIC_EXPORT DoricSwitchBridge : public QObject {
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit DoricSwitchBridge(QObject *parent = nullptr);
|
||||
|
||||
Q_INVOKABLE
|
||||
void onSwitch(QString pointer, bool checked);
|
||||
signals:
|
||||
};
|
||||
|
||||
#endif // DORICSWITCHBRIDGE_H
|
Reference in New Issue
Block a user