mirror of
https://github.com/qmlnet/qmlnet.git
synced 2026-05-21 06:45:32 -06:00
Let NetVariant::fromQJSValue consume all QObject derived types.
This commit is contained in:
parent
c5c2d3e3e1
commit
2dfdb9c250
1 changed files with 2 additions and 2 deletions
|
|
@ -304,12 +304,12 @@ QSharedPointer<NetVariant> NetVariant::fromQJSValue(const QJSValue& qJsValue)
|
|||
// Nothing!
|
||||
}
|
||||
else if(qJsValue.isQObject()) {
|
||||
result = QSharedPointer<NetVariant>(new NetVariant());
|
||||
QObject* qObject = qJsValue.toQObject();
|
||||
NetValueInterface* netValue = qobject_cast<NetValueInterface*>(qObject);
|
||||
if(!netValue) {
|
||||
qWarning() << "Return type must be a JS type/object, or a .NET object.";
|
||||
result->setQObject(QSharedPointer<NetQObject>(new NetQObject(qObject)));
|
||||
} else {
|
||||
result = QSharedPointer<NetVariant>(new NetVariant());
|
||||
result->setNetReference(netValue->getNetReference());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue