コード例 #1
0
ファイル: walletview.cpp プロジェクト: a7853z/bitcoin-abc
void WalletView::processNewTransaction(const QModelIndex &parent, int start,
                                       int /*end*/) {
    // Prevent balloon-spam when initial block download is in progress
    if (!walletModel || !clientModel || clientModel->inInitialBlockDownload())
        return;

    TransactionTableModel *ttm = walletModel->getTransactionTableModel();
    if (!ttm || ttm->processingQueuedTransactions()) return;

    QString date = ttm->index(start, TransactionTableModel::Date, parent)
                       .data()
                       .toString();
    qint64 amount = ttm->index(start, TransactionTableModel::Amount, parent)
                        .data(Qt::EditRole)
                        .toULongLong();
    QString type = ttm->index(start, TransactionTableModel::Type, parent)
                       .data()
                       .toString();
    QModelIndex index = ttm->index(start, 0, parent);
    QString address =
        ttm->data(index, TransactionTableModel::AddressRole).toString();
    QString label =
        ttm->data(index, TransactionTableModel::LabelRole).toString();

    Q_EMIT incomingTransaction(date,
                               walletModel->getOptionsModel()->getDisplayUnit(),
                               Amount(amount), type, address, label);
}
コード例 #2
0
void WalletView::processNewTransaction(const QModelIndex& parent, int start, int /*end*/)
{
    // Prevent balloon-spam when initial block download is in progress
    if (!walletModel || !clientModel )
        return;

    TransactionTableModel *ttm = walletModel->getTransactionTableModel();

    QString date = ttm->index(start, TransactionTableModel::Date, parent).data().toString();
    qint64 amount = ttm->index(start, TransactionTableModel::Amount, parent).data(Qt::EditRole).toULongLong();
    QString type = ttm->index(start, TransactionTableModel::Type, parent).data().toString();
    QString address = ttm->index(start, TransactionTableModel::ToAddress, parent).data().toString();

    emit incomingTransaction(date, walletModel->getOptionsModel()->getDisplayUnit(), amount, type, address);
}