diff options
author | Jonas Schnelli <dev@jonasschnelli.ch> | 2019-08-29 18:35:53 +0200 |
---|---|---|
committer | Jonas Schnelli <dev@jonasschnelli.ch> | 2019-08-29 18:36:13 +0200 |
commit | bcf7004a8945a5e837483a3826a7ffeb374e9b44 (patch) | |
tree | e21bbcebbf59d9cdebf2d6dc990d5f9892e8e790 /src/qt | |
parent | d8fc9979130a268cf55b12c223b20fd7d4b9f67f (diff) | |
parent | c53667764ea65c0f8661358759b0124f808ce587 (diff) |
Merge #16707: qt: Remove obsolete QModelIndex::child()
c53667764ea65c0f8661358759b0124f808ce587 qt: Remove obsolete QModelIndex::child() (Hennadii Stepanov)
Pull request description:
The `QModelIndex::child()` member function is [obsolete](https://doc.qt.io/qt-5.12/qmodelindex-obsolete.html) since Qt 5.12.
This PR removes it, does not change behavior and keeps compatibility with [Qt 5.5.1](https://github.com/bitcoin/bitcoin/pull/15393).
Here is an excerpt from the master build log:
```
qt/receivecoinsdialog.cpp: In member function ‘void ReceiveCoinsDialog::copyColumnToClipboard(int)’:
qt/receivecoinsdialog.cpp:264:111: warning: ‘QModelIndex QModelIndex::child(int, int) const’ is deprecated: Use QAbstractItemModel::index [-Wdeprecated-declarations]
GUIUtil::setClipboard(model->getRecentRequestsTableModel()->data(firstIndex.child(firstIndex.row(), column), Qt::EditRole).toString());
^
In file included from /home/hebasto/Qt/5.13.0/gcc_64/include/QtWidgets/qabstractitemview.h:45:0,
from /home/hebasto/Qt/5.13.0/gcc_64/include/QtWidgets/qheaderview.h:44,
from /home/hebasto/Qt/5.13.0/gcc_64/include/QtWidgets/QHeaderView:1,
from ./qt/guiutil.h:12,
from ./qt/receivecoinsdialog.h:8,
from qt/receivecoinsdialog.cpp:7:
/home/hebasto/Qt/5.13.0/gcc_64/include/QtCore/qabstractitemmodel.h:457:20: note: declared here
inline QModelIndex QModelIndex::child(int arow, int acolumn) const
^~~~~~~~~~~
```
ACKs for top commit:
laanwj:
Code review ACK c53667764ea65c0f8661358759b0124f808ce587
promag:
ACK c53667764ea65c0f8661358759b0124f808ce587, just read the change.
jonasschnelli:
utACK c53667764ea65c0f8661358759b0124f808ce587
Tree-SHA512: 99fcb6ff60a6d47b925bda9f14006269eaad09ba4f7a41ac4975c6cf04bd906b58aed721cbfa0be7da8e6613d92e30d4be18b7e4d3960f026c7226558a4c3196
Diffstat (limited to 'src/qt')
-rw-r--r-- | src/qt/receivecoinsdialog.cpp | 2 | ||||
-rw-r--r-- | src/qt/recentrequeststablemodel.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/qt/receivecoinsdialog.cpp b/src/qt/receivecoinsdialog.cpp index 05157c2a4a..e8cf432131 100644 --- a/src/qt/receivecoinsdialog.cpp +++ b/src/qt/receivecoinsdialog.cpp @@ -261,7 +261,7 @@ void ReceiveCoinsDialog::copyColumnToClipboard(int column) if (!firstIndex.isValid()) { return; } - GUIUtil::setClipboard(model->getRecentRequestsTableModel()->data(firstIndex.child(firstIndex.row(), column), Qt::EditRole).toString()); + GUIUtil::setClipboard(model->getRecentRequestsTableModel()->index(firstIndex.row(), column).data(Qt::EditRole).toString()); } // context menu diff --git a/src/qt/recentrequeststablemodel.h b/src/qt/recentrequeststablemodel.h index 8a1140e952..130b709d46 100644 --- a/src/qt/recentrequeststablemodel.h +++ b/src/qt/recentrequeststablemodel.h @@ -76,7 +76,7 @@ public: QVariant data(const QModelIndex &index, int role) const; bool setData(const QModelIndex &index, const QVariant &value, int role); QVariant headerData(int section, Qt::Orientation orientation, int role) const; - QModelIndex index(int row, int column, const QModelIndex &parent) const; + QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const; bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex()); Qt::ItemFlags flags(const QModelIndex &index) const; /*@}*/ |