Build issue with Qt 5.2.1 #14078

issue laanwj openend this issue on August 27, 2018
  1. laanwj commented at 10:23 am on August 27, 2018: member

    It is no longer possible to build the GUI with Qt 5.2.1, which is on Ubuntu Trusty:

     0  CXX      qt/test/qt_test_test_bitcoin_qt-util.o
     1qt/test/util.cpp: In function void ConfirmMessage(QString*, int):
     2qt/test/util.cpp:21:24: error: no matching function for call to QTimer::singleShot(int&, FunctionCallback<ConfirmMessage(QString*, int)::__lambda0>*, void (Callback::*)())
     3     }), &Callback::call);
     4                        ^
     5qt/test/util.cpp:21:24: note: candidates are:
     6In file included from /usr/include/qt5/QtCore/QTimer:1:0,
     7                 from qt/test/util.cpp:5:
     8/usr/include/qt5/QtCore/qtimer.h:81:17: note: static void QTimer::singleShot(int, const QObject*, const char*)
     9     static void singleShot(int msec, const QObject *receiver, const char *member);
    10                 ^
    11/usr/include/qt5/QtCore/qtimer.h:81:17: note:   no known conversion for argument 3 from void (Callback::*)() to const char*
    12/usr/include/qt5/QtCore/qtimer.h:82:17: note: static void QTimer::singleShot(int, Qt::TimerType, const QObject*, const char*)
    13     static void singleShot(int msec, Qt::TimerType timerType, const QObject *receiver, const char *member);
    14                 ^
    15/usr/include/qt5/QtCore/qtimer.h:82:17: note:   candidate expects 4 arguments, 3 provided
    

    Not a high-priority issue, but I think we either need to fix this or add minimum Qt version check (to what?).

  2. laanwj added the label GUI on Aug 27, 2018
  3. laanwj renamed this:
    Build issue with Qt
    Build issue with Qt 5.2.1
    on Aug 27, 2018
  4. fanquake commented at 10:30 am on August 27, 2018: member

    From memory there is a qt5.2 workaround in the tests somewhere? However this may be related to the recent compile time changes.

    On Mon, 27 Aug 2018 at 18:23, Wladimir J. van der Laan < notifications@github.com> wrote:

    It is no longer possible to build the GUI with Qt 5.2.1, which is on Ubuntu Trusty:

    CXX qt/test/qt_test_test_bitcoin_qt-util.o qt/test/util.cpp: In function ‘void ConfirmMessage(QString*, int)’: qt/test/util.cpp:21:24: error: no matching function for call to ‘QTimer::singleShot(int&, FunctionCallback<ConfirmMessage(QString*, int)::__lambda0>, void (Callback::)())’ }), &Callback::call); ^ qt/test/util.cpp:21:24: note: candidates are: In file included from /usr/include/qt5/QtCore/QTimer:1:0, from qt/test/util.cpp:5: /usr/include/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/qt5/QtCore/qtimer.h:81:17: note: no known conversion for argument 3 from ‘void (Callback::)()’ to ‘const char’ /usr/include/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/qt5/QtCore/qtimer.h:82:17: note: candidate expects 4 arguments, 3 provided

    Not a high-priority issue, but I think we either need to fix this or add minimum Qt version check (to what?).

    — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/bitcoin/bitcoin/issues/14078, or mute the thread https://github.com/notifications/unsubscribe-auth/AA0t8jxekQ_jo2GDicGRRiL8H3JTc2Dwks5uU8ingaJpZM4WNiyw .

  5. laanwj commented at 10:59 am on August 27, 2018: member

    I can only find that there’s a qt 5.3 workaround in nested RPC tests:

    0src/qt/test/rpcnestedtests.cpp:#if QT_VERSION >= 0x050300
    
  6. MarcoFalke added this to the milestone 0.18.0 on Aug 27, 2018
  7. MarcoFalke commented at 12:15 pm on August 27, 2018: member
    This is only on master (due to the change to the new connect syntax). cc @promag
  8. ryanofsky commented at 6:19 pm on August 28, 2018: member
    The code was only changed to use QTimer::singleShot for compatibility with Qt4. Since compatibility is no longer needed, probably a good way to fix the issue and simplify the code is just to revert #10098.
  9. promag commented at 6:31 pm on August 28, 2018: member
    I’ll fix it unless someone is already on it.
  10. MarcoFalke added the label Tests on Aug 28, 2018
  11. laanwj commented at 7:01 pm on August 28, 2018: member
    @ryanofsky makes sense! @promag thanks, but I think it makes sense if I do it, as I have the trusty VM to test with
  12. laanwj commented at 7:22 pm on August 28, 2018: member

    reverting got past the first error, but there’s more, unfortunately,

     0qt/bitcoin.cpp: In member function void BitcoinApplication::initializeResult(bool):
     1qt/bitcoin.cpp:509:71: error: no matching function for call to QTimer::singleShot(int, PaymentServer*&, void (PaymentServer::*)())
     2         QTimer::singleShot(100, paymentServer, &PaymentServer::uiReady);
     3                                                                       ^
     4qt/bitcoin.cpp:509:71: note: candidates are:
     5In file included from /usr/include/qt5/QtCore/QTimer:1:0,
     6                 from qt/bitcoin.cpp:51:
     7/usr/include/qt5/QtCore/qtimer.h:81:17: note: static void QTimer::singleShot(int, const QObject*, const char*)
     8     static void singleShot(int msec, const QObject *receiver, const char *member);
     9                 ^
    10/usr/include/qt5/QtCore/qtimer.h:81:17: note:   no known conversion for argument 3 from void (PaymentServer::*)() to const char*
    11/usr/include/qt5/QtCore/qtimer.h:82:17: note: static void QTimer::singleShot(int, Qt::TimerType, const QObject*, const char*)
    12     static void singleShot(int msec, Qt::TimerType timerType, const QObject *receiver, const char *member);
    13                 ^
    14/usr/include/qt5/QtCore/qtimer.h:82:17: note:   candidate expects 4 arguments, 3 provided
    
  13. ryanofsky commented at 7:34 pm on August 28, 2018: member

    Probably you need to make the same change in the other places: avoid QTimer::singleShot by instantiating a QTimer and calling QObject::connect on it. You could wrap this up in a convenience function if it’s a repeating pattern.

    Another option would be to go back to using the SLOT macro, but this might be less desirable long term.

  14. laanwj commented at 7:35 pm on August 28, 2018: member

    If this affects all uses of singleShot, that’s quite a lot:

    0src/qt/bitcoin.cpp:        QTimer::singleShot(100, paymentServer, &PaymentServer::uiReady);
    1src/qt/bitcoingui.cpp:                QTimer::singleShot(0, this, &BitcoinGUI::hide);
    2src/qt/bitcoingui.cpp:                QTimer::singleShot(0, this, &BitcoinGUI::show);
    3src/qt/optionsdialog.cpp:        QTimer::singleShot(10000, this, &OptionsDialog::clearStatusLabel);
    4src/qt/test/util.cpp:    QTimer::singleShot(msec, makeCallback([text](Callback* callback) {
    5src/qt/test/wallettests.cpp:    QTimer::singleShot(0, makeCallback([text, cancel](Callback* callback) {
    

    Not sure that’s worth it.

    Looks like the QTimer::singleShot(int msec, const QObject *receiver, PointerToMemberFunction method) function was introduced in Qt 5.4.

    According to wikipedia, Qt 5.4 was released on 10 December 2014. It isn’t even under official support anymore.

  15. promag commented at 7:50 pm on August 28, 2018: member
    Ref #13478.
  16. promag commented at 7:52 pm on August 28, 2018: member
    Since this is master only, can we bump Qt to 5.5? Trusty EOL is April 2019.
  17. laanwj commented at 8:00 pm on August 28, 2018: member
    sounds good to me yes, let’s move discussion to #13478
  18. MarcoFalke closed this on Nov 14, 2018

  19. 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-12-18 15:12 UTC

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