Fix compile errors with Qt 5.3.2 and Boost 1.55.0 #10039

pull ryanofsky wants to merge 2 commits into bitcoin:master from ryanofsky:pr/jessie changing 1 files +6 −3
  1. ryanofsky commented at 4:53 pm on March 20, 2017: member
    Both errors were introduced in #9974 and reported by @paveljanik
  2. Avoid scoped_connection compile error with boost 1.55.0
    Construct scoped_connection directly instead of relying on copy initialization
    and move constructor. Avoids the following compile error in debian jessie:
    
    ```
    In file included from /usr/include/boost/signals2/signal.hpp:21:0,
                     from ./util.h:29,
                     from ./dbwrapper.h:11,
                     from ./txdb.h:10,
                     from ./test/test_bitcoin.h:11,
                     from qt/test/wallettests.cpp:11:
    /usr/include/boost/signals2/connection.hpp: In function ‘uint256 {anonymous}::SendCoins(CWallet&, SendCoinsDialog&, const CBitcoinAddress&, CAmount)’:
    /usr/include/boost/signals2/connection.hpp:234:7: error: ‘boost::signals2::scoped_connection::scoped_connection(const boost::signals2::scoped_connection&)’ is private
           scoped_connection(const scoped_connection &other);
           ^
    qt/test/wallettests.cpp:47:6: error: within this context
         });
          ^
    ```
    
    Error reported by Pavel Janík <Pavel@Janik.cz> in
    https://github.com/bitcoin/bitcoin/pull/9974#issuecomment-287550034
    d5046e72f4
  3. Avoid QTimer::singleShot compile error with Qt 5.3.2
    Construct QTimer object directly, instead of relying on QTimer::singleShot
    overloads accepting lambdas, which weren't introduced until Qt 5.4.
    
    Avoids the following compile error in debian jessie:
    
    ```
    qt/test/wallettests.cpp: In function ‘void {anonymous}::ConfirmSend()’:
    qt/test/wallettests.cpp:34:6: error: no matching function for call to ‘QTimer::singleShot(int, Qt::TimerType, {anonymous}::ConfirmSend()::<lambda()>)’
         });
          ^
    qt/test/wallettests.cpp:34:6: note: candidates are:
    In file included from /usr/include/x86_64-linux-gnu/qt5/QtCore/QTimer:1:0,
                     from ./qt/sendcoinsdialog.h:13,
                     from qt/test/wallettests.cpp:7:
    /usr/include/x86_64-linux-gnu/qt5/QtCore/qtimer.h:81:17: note: static void QTimer::singleShot(int, const QObject*, const char*)
         static void singleShot(int msec, const QObject *receiver, const char *member);
                     ^
    /usr/include/x86_64-linux-gnu/qt5/QtCore/qtimer.h:81:17: note:   no known conversion for argument 2 from ‘Qt::TimerType’ to ‘const QObject*’
    /usr/include/x86_64-linux-gnu/qt5/QtCore/qtimer.h:82:17: note: static void QTimer::singleShot(int, Qt::TimerType, const QObject*, const char*)
         static void singleShot(int msec, Qt::TimerType timerType, const QObject *receiver, const char *member);
                     ^
    /usr/include/x86_64-linux-gnu/qt5/QtCore/qtimer.h:82:17: note:   candidate expects 4 arguments, 3 provided
    ```
    
    Error reported by Pavel Janík <Pavel@Janik.cz> in
    https://github.com/bitcoin/bitcoin/pull/9974#issuecomment-287574436
    b5bec4e330
  4. paveljanik commented at 5:19 pm on March 20, 2017: contributor
    Going to test this. Thanks!
  5. paveljanik commented at 7:51 pm on March 20, 2017: contributor

    Compiles OK on Debian Jessie and openSUSE (gcc 4.8.5, 5.3.1 and 6.2.1).

    ACK https://github.com/bitcoin/bitcoin/pull/10039/commits/b5bec4e330fc7201d989663b4dbc6a1e620dd0f9

  6. fanquake added the label Bug on Mar 21, 2017
  7. laanwj merged this on Mar 21, 2017
  8. laanwj closed this on Mar 21, 2017

  9. laanwj referenced this in commit 919aaf6508 on Mar 21, 2017
  10. pstratem commented at 0:15 am on March 26, 2017: contributor

    This change breaks compiling on debian 8.7 with qt4 ( 4:4.8.6+git64-g5dc8b2b+dfsg-3+deb8u1 ).

    I suspect one version works in qt4 and the other in qt5.

  11. pstratem commented at 11:58 pm on March 26, 2017: contributor
    @ryanofsky ping
  12. jonasschnelli commented at 6:24 am on March 27, 2017: contributor
    Maybe it’s time to think about dropping support to compile against Qt4? We already dropped support during runtime…
  13. laanwj commented at 7:11 am on March 27, 2017: member

    Maybe it’s time to think about dropping support to compile against Qt4? We already dropped support during runtime…

    The issue for discussion that is #8263

  14. ryanofsky referenced this in commit bdc43f6ad1 on Mar 27, 2017
  15. ryanofsky referenced this in commit 7ea41c7ef3 on Mar 27, 2017
  16. ryanofsky referenced this in commit e9a64615c8 on Mar 27, 2017
  17. in src/qt/test/wallettests.cpp:27 in b5bec4e330
    21@@ -22,7 +22,9 @@ namespace
    22 //! Press "Yes" button in modal send confirmation dialog.
    23 void ConfirmSend()
    24 {
    25-    QTimer::singleShot(0, Qt::PreciseTimer, []() {
    26+    QTimer* timer = new QTimer;
    27+    timer->setSingleShot(true);
    28+    QObject::connect(timer, &QTimer::timeout, []() {
    


    gmaxwell commented at 7:25 pm on April 1, 2017:

    This fails to compile for me on debian testing with qt/test/wallettests.cpp:36:6: error: no matching function for call to ‘QObject::connect(QTimer*&, void (QTimer::*)(), {anonymous}::ConfirmSend()::<lambda()>)’ });

    (edit, actually reverting this commit by itself and it fails elsewhere with qt/test/wallettests.cpp:25:27: error: ‘PreciseTimer’ is not a member of ‘Qt’ QTimer::singleShot(0, Qt::PreciseTimer, {)


    ryanofsky commented at 10:23 pm on April 1, 2017:
    #10098 fixes this
  18. practicalswift referenced this in commit f68fe68ca9 on Apr 27, 2017
  19. HashUnlimited referenced this in commit 2665d3967d on Feb 28, 2018
  20. PastaPastaPasta referenced this in commit 070b209c50 on Mar 14, 2019
  21. PastaPastaPasta referenced this in commit d00c42e845 on May 20, 2019
  22. PastaPastaPasta referenced this in commit 2c833eff3e on May 21, 2019
  23. PastaPastaPasta referenced this in commit 5cd8e7d8a1 on May 21, 2019
  24. barrystyle referenced this in commit 7afd0b315d on Jan 22, 2020
  25. DrahtBot locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-11-17 12:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me