Skip to content

Conversation

@hebasto
Copy link
Member

@hebasto hebasto commented Aug 24, 2019

The QModelIndex::child() member function is obsolete since Qt 5.12.

This PR removes it, does not change behavior and keeps compatibility with Qt 5.5.1.

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
                    ^~~~~~~~~~~

@fanquake fanquake added the GUI label Aug 24, 2019
@DrahtBot
Copy link
Contributor

DrahtBot commented Aug 24, 2019

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #16710 (build: Enable -Wsuggest-override if available by hebasto)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

Copy link
Contributor

@promag promag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Concept ACK.

The QModelIndex::child() member function is obsolete since Qt 5.12.
@hebasto hebasto force-pushed the 20190824-qmodelindex-child branch from 45c6f3c to c536677 Compare August 25, 2019 05:31
@hebasto
Copy link
Member Author

hebasto commented Aug 25, 2019

@promag
Thank you for your review. All your comments have been addressed.

@laanwj
Copy link
Member

laanwj commented Aug 29, 2019

Code review ACK c536677

@promag
Copy link
Contributor

promag commented Aug 29, 2019

ACK c536677, just read the change.

Copy link
Contributor

@jonasschnelli jonasschnelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK c536677

jonasschnelli added a commit that referenced this pull request Aug 29, 2019
c536677 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](#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 c536677
  promag:
    ACK c536677, just read the change.
  jonasschnelli:
    utACK c536677

Tree-SHA512: 99fcb6ff60a6d47b925bda9f14006269eaad09ba4f7a41ac4975c6cf04bd906b58aed721cbfa0be7da8e6613d92e30d4be18b7e4d3960f026c7226558a4c3196
@jonasschnelli jonasschnelli merged commit c536677 into bitcoin:master Aug 29, 2019
@hebasto hebasto deleted the 20190824-qmodelindex-child branch August 29, 2019 17:41
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Aug 29, 2019
c536677 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](bitcoin#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 c536677
  promag:
    ACK c536677, just read the change.
  jonasschnelli:
    utACK c536677

Tree-SHA512: 99fcb6ff60a6d47b925bda9f14006269eaad09ba4f7a41ac4975c6cf04bd906b58aed721cbfa0be7da8e6613d92e30d4be18b7e4d3960f026c7226558a4c3196
deadalnix pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Feb 29, 2020
Summary:
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](bitcoin/bitcoin#15393).

---

This is a backport of Core [[bitcoin/bitcoin#16707 | PR16707]]

Test Plan:
   ninja check

Reviewers: O1 Bitcoin ABC, #bitcoin_abc, deadalnix

Reviewed By: O1 Bitcoin ABC, #bitcoin_abc, deadalnix

Differential Revision: https://reviews.bitcoinabc.org/D5385
ftrader pushed a commit to bitcoin-cash-node/bitcoin-cash-node that referenced this pull request Apr 16, 2020
Summary:
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](bitcoin/bitcoin#15393).

---

This is a backport of Core [[bitcoin/bitcoin#16707 | PR16707]]

Test Plan:
   ninja check

Reviewers: O1 Bitcoin ABC, #bitcoin_abc, deadalnix

Reviewed By: O1 Bitcoin ABC, #bitcoin_abc, deadalnix

Differential Revision: https://reviews.bitcoinabc.org/D5385
kwvg added a commit to kwvg/dash that referenced this pull request Nov 3, 2021
kwvg added a commit to kwvg/dash that referenced this pull request Nov 11, 2021
pravblockc pushed a commit to pravblockc/dash that referenced this pull request Nov 18, 2021
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Dec 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants