[Qt] fix RecentRequestsTableModel function ambiuguity
- fixes a compiler ambiguity error with ::createIndex() called in RecentRequestsTableModel::index() - also add some Q_UNUSED() macros
This commit is contained in:
parent
69127034c3
commit
7df07b3f45
2 changed files with 14 additions and 6 deletions
|
@ -3,13 +3,16 @@
|
||||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
|
|
||||||
#include "recentrequeststablemodel.h"
|
#include "recentrequeststablemodel.h"
|
||||||
#include "guiutil.h"
|
|
||||||
#include "bitcoinunits.h"
|
#include "bitcoinunits.h"
|
||||||
|
#include "guiutil.h"
|
||||||
#include "optionsmodel.h"
|
#include "optionsmodel.h"
|
||||||
|
|
||||||
RecentRequestsTableModel::RecentRequestsTableModel(CWallet *wallet, WalletModel *parent):
|
RecentRequestsTableModel::RecentRequestsTableModel(CWallet *wallet, WalletModel *parent) :
|
||||||
walletModel(parent)
|
walletModel(parent)
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(wallet);
|
||||||
|
|
||||||
/* These columns must match the indices in the ColumnIndex enumeration */
|
/* These columns must match the indices in the ColumnIndex enumeration */
|
||||||
columns << tr("Date") << tr("Label") << tr("Message") << tr("Amount");
|
columns << tr("Date") << tr("Label") << tr("Message") << tr("Amount");
|
||||||
}
|
}
|
||||||
|
@ -22,12 +25,14 @@ RecentRequestsTableModel::~RecentRequestsTableModel()
|
||||||
int RecentRequestsTableModel::rowCount(const QModelIndex &parent) const
|
int RecentRequestsTableModel::rowCount(const QModelIndex &parent) const
|
||||||
{
|
{
|
||||||
Q_UNUSED(parent);
|
Q_UNUSED(parent);
|
||||||
|
|
||||||
return list.length();
|
return list.length();
|
||||||
}
|
}
|
||||||
|
|
||||||
int RecentRequestsTableModel::columnCount(const QModelIndex &parent) const
|
int RecentRequestsTableModel::columnCount(const QModelIndex &parent) const
|
||||||
{
|
{
|
||||||
Q_UNUSED(parent);
|
Q_UNUSED(parent);
|
||||||
|
|
||||||
return columns.length();
|
return columns.length();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -88,12 +93,15 @@ QVariant RecentRequestsTableModel::headerData(int section, Qt::Orientation orien
|
||||||
|
|
||||||
QModelIndex RecentRequestsTableModel::index(int row, int column, const QModelIndex &parent) const
|
QModelIndex RecentRequestsTableModel::index(int row, int column, const QModelIndex &parent) const
|
||||||
{
|
{
|
||||||
return createIndex(row, column, 0);
|
Q_UNUSED(parent);
|
||||||
|
|
||||||
|
return createIndex(row, column);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool RecentRequestsTableModel::removeRows(int row, int count, const QModelIndex &parent)
|
bool RecentRequestsTableModel::removeRows(int row, int count, const QModelIndex &parent)
|
||||||
{
|
{
|
||||||
Q_UNUSED(parent);
|
Q_UNUSED(parent);
|
||||||
|
|
||||||
if(count > 0 && row >= 0 && (row+count) <= list.size())
|
if(count > 0 && row >= 0 && (row+count) <= list.size())
|
||||||
{
|
{
|
||||||
beginRemoveRows(parent, row, row + count - 1);
|
beginRemoveRows(parent, row, row + count - 1);
|
||||||
|
|
|
@ -5,12 +5,12 @@
|
||||||
#ifndef RECENTREQUESTSTABLEMODEL_H
|
#ifndef RECENTREQUESTSTABLEMODEL_H
|
||||||
#define RECENTREQUESTSTABLEMODEL_H
|
#define RECENTREQUESTSTABLEMODEL_H
|
||||||
|
|
||||||
|
#include "walletmodel.h"
|
||||||
|
|
||||||
#include <QAbstractTableModel>
|
#include <QAbstractTableModel>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
#include <QDateTime>
|
#include <QDateTime>
|
||||||
|
|
||||||
#include "walletmodel.h"
|
|
||||||
|
|
||||||
class CWallet;
|
class CWallet;
|
||||||
|
|
||||||
struct RecentRequestEntry
|
struct RecentRequestEntry
|
||||||
|
@ -27,7 +27,7 @@ class RecentRequestsTableModel: public QAbstractTableModel
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit RecentRequestsTableModel(CWallet *wallet, WalletModel *parent = 0);
|
explicit RecentRequestsTableModel(CWallet *wallet, WalletModel *parent);
|
||||||
~RecentRequestsTableModel();
|
~RecentRequestsTableModel();
|
||||||
|
|
||||||
enum ColumnIndex {
|
enum ColumnIndex {
|
||||||
|
|
Loading…
Reference in a new issue