Browse Source

Merge branch 'mix' of https://github.com/arkpar/cpp-ethereum into mix_pf

Conflicts:
	mix/TransactionListModel.cpp
cl-refactor
arkpar 10 years ago
parent
commit
9aafafec0e
  1. 10
      mix/TransactionListModel.cpp
  2. 4
      mix/TransactionListModel.h

10
mix/TransactionListModel.cpp

@ -24,7 +24,7 @@
#include <QQmlEngine>
#include <QTextDocument>
#include <QAbstractListModel>
#include "libdevcore/CommonJS.h"
#include <libdevcore/CommonJS.h>
#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*>("TransactionListItem*");
}
QHash<int, QByteArray> 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);
}
}
}

4
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<QString> 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:

Loading…
Cancel
Save