diff --git a/mix/TransactionListModel.cpp b/mix/TransactionListModel.cpp index dc1c0e8e4..943ffc9e0 100644 --- a/mix/TransactionListModel.cpp +++ b/mix/TransactionListModel.cpp @@ -24,7 +24,7 @@ #include #include #include -#include "libdevcore/CommonJS.h" +#include #include "TransactionListModel.h" #include "QContractDefinition.h" #include "QFunctionDefinition.h" @@ -58,7 +58,9 @@ TransactionListItem::TransactionListItem(int _index, TransactionSettings const& TransactionListModel::TransactionListModel(QObject* _parent, AppContext* _appContext): QAbstractListModel(_parent), m_appContext(_appContext) -{} +{ + qRegisterMetaType("TransactionListItem*"); +} QHash TransactionListModel::roleNames() const { @@ -143,7 +145,7 @@ QVariantList TransactionListModel::getParameters(int _index, QString const& _fun return vl; } -QObject* TransactionListModel::getItem(int _index) +TransactionListItem* TransactionListModel::getItem(int _index) { TransactionSettings const& transaction = (_index >= 0 && _index < (int)m_transactions.size()) ? m_transactions[_index] : TransactionSettings(); TransactionListItem* item = new TransactionListItem(_index, transaction, nullptr); @@ -198,5 +200,7 @@ void TransactionListModel::runTransaction(int _index) emit transactionStarted(tr); } + } } + diff --git a/mix/TransactionListModel.h b/mix/TransactionListModel.h index 9faf7d63f..0af37a467 100644 --- a/mix/TransactionListModel.h +++ b/mix/TransactionListModel.h @@ -143,7 +143,7 @@ public: /// @todo Change that to transaction item Q_INVOKABLE void edit(QObject* _data); /// @returns transaction item for a give index - Q_INVOKABLE QObject* getItem(int _index); + Q_INVOKABLE TransactionListItem* getItem(int _index); /// @returns a list of functions for current contract Q_INVOKABLE QList getFunctions(); /// @returns function parameters along with parameter values if set. @see TransactionParameterItem @@ -154,7 +154,7 @@ public: signals: /// Transaction count has changed void countChanged(); - /// Transaction has be launched + /// Transaction has been launched void transactionStarted(dev::mix::TransactionSettings); private: