diff --git a/mix/AppContext.cpp b/mix/AppContext.cpp index a7f1bbf3d..3cafe219e 100644 --- a/mix/AppContext.cpp +++ b/mix/AppContext.cpp @@ -84,7 +84,6 @@ void AppContext::displayMessageDialog(QString _title, QString _message) { QObject* dialogWin = m_applicationEngine.get()->rootObjects().at(0)->findChild("alertMessageDialog", Qt::FindChildrenRecursively); QObject* dialogWinComponent = m_applicationEngine.get()->rootObjects().at(0)->findChild("alertMessageDialogContent", Qt::FindChildrenRecursively); - QMetaObject::invokeMethod(dialogWin, "close"); dialogWinComponent->setProperty("source", QString("qrc:/qml/BasicMessage.qml")); dialogWin->setProperty("title", _title); dialogWin->setProperty("width", "250"); diff --git a/mix/AssemblyDebuggerCtrl.cpp b/mix/AssemblyDebuggerCtrl.cpp index 9ed46daba..3c82c5a16 100644 --- a/mix/AssemblyDebuggerCtrl.cpp +++ b/mix/AssemblyDebuggerCtrl.cpp @@ -155,7 +155,7 @@ void AssemblyDebuggerCtrl::updateGUI(bool _success, DebuggingStatusResult _reaso m_appEngine->rootContext()->setContextProperty("debugStates", QVariant::fromValue(_wStates)); m_appEngine->rootContext()->setContextProperty("humanReadableExecutionCode", QVariant::fromValue(std::get<0>(_code))); m_appEngine->rootContext()->setContextProperty("bytesCodeMapping", QVariant::fromValue(std::get<1>(_code))); - AppContext::getInstance()->appEngine()->rootContext()->setContextProperty("contractCallReturnParameters", + m_appEngine->rootContext()->setContextProperty("contractCallReturnParameters", QVariant::fromValue(new QVariableDefinitionList(_returnParam))); this->addContentOn(this); } diff --git a/mix/Extension.cpp b/mix/Extension.cpp index 8d2f7cd70..c6a41995a 100644 --- a/mix/Extension.cpp +++ b/mix/Extension.cpp @@ -65,10 +65,10 @@ void Extension::addContentOn(QObject* _view) Q_UNUSED(_view); if (m_displayBehavior == ExtensionDisplayBehavior::ModalDialog) { + QQmlComponent* component = new QQmlComponent(AppContext::getInstance()->appEngine(), QUrl(contentUrl()), _view); QObject* dialogWin = AppContext::getInstance()->appEngine()->rootObjects().at(0)->findChild("dialog", Qt::FindChildrenRecursively); QObject* dialogWinComponent = AppContext::getInstance()->appEngine()->rootObjects().at(0)->findChild("modalDialogContent", Qt::FindChildrenRecursively); - QMetaObject::invokeMethod(dialogWin, "close"); - dialogWinComponent->setProperty("source", contentUrl()); + dialogWinComponent->setProperty("sourceComponent", QVariant::fromValue(component)); dialogWin->setProperty("title", title()); QMetaObject::invokeMethod(dialogWin, "open"); } diff --git a/mix/QVariableDefinition.h b/mix/QVariableDefinition.h index ff9d864dd..907ddd6c1 100644 --- a/mix/QVariableDefinition.h +++ b/mix/QVariableDefinition.h @@ -49,7 +49,6 @@ private: class QVariableDefinitionList: public QAbstractListModel { Q_OBJECT - //Q_PROPERTY(QList def READ def) public: QVariableDefinitionList(QList _def): m_def(_def) {} @@ -57,9 +56,7 @@ public: QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override; QHash roleNames() const override; QVariableDefinition* val(int idx); - QList def() { - return m_def; - } + QList def() { return m_def; } private: QList m_def; diff --git a/mix/qml/AlertMessageDialog.qml b/mix/qml/AlertMessageDialog.qml index f89ade45f..1d48f5474 100644 --- a/mix/qml/AlertMessageDialog.qml +++ b/mix/qml/AlertMessageDialog.qml @@ -22,6 +22,9 @@ Window } function close() { - visible = false + visible = false; + alertMessageDialogContent.source = ""; + alertMessageDialogContent.sourceComponent = undefined; + alertMessageDialog.destroy(); } } diff --git a/mix/qml/Debugger.qml b/mix/qml/Debugger.qml index 364f9190d..2608a6a7c 100644 --- a/mix/qml/Debugger.qml +++ b/mix/qml/Debugger.qml @@ -8,6 +8,7 @@ import "js/Debugger.js" as Debugger Rectangle { anchors.fill: parent; color: "lightgrey" + Component.onCompleted: Debugger.init(); Rectangle { color: "transparent" id: headerInfo @@ -79,7 +80,6 @@ Rectangle { width: 200 anchors.horizontalCenter: parent.horizontalCenter id: statesList - Component.onCompleted: Debugger.init(); model: humanReadableExecutionCode delegate: renderDelegate highlight: highlightBar diff --git a/mix/qml/ModalDialog.qml b/mix/qml/ModalDialog.qml index 983420926..d5b7f3dd3 100644 --- a/mix/qml/ModalDialog.qml +++ b/mix/qml/ModalDialog.qml @@ -18,10 +18,13 @@ Window } function open() { - visible = true + visible = true; } function close() { - visible = false + visible = false; + modalDialogContent.source = ""; + modalDialogContent.sourceComponent = undefined; + modalDialog.destroy(); } } diff --git a/mix/qml/js/Debugger.js b/mix/qml/js/Debugger.js index d899b45f2..d8a5df5f3 100644 --- a/mix/qml/js/Debugger.js +++ b/mix/qml/js/Debugger.js @@ -66,8 +66,6 @@ function endOfDebug() function displayReturnValue() { - console.log("JSON.stringify(contractCallRe"); - console.log(JSON.stringify(contractCallReturnParameters)); headerReturnList.model = contractCallReturnParameters; headerReturnList.update(); }