编译错误
/usr/include/x86_64-linux-gnu/qt5/QtCore/qobject.h:314: error: static assertion failed: Signal and slot arguments are not compatible. 314 | Q_STATIC_ASSERT_X((FunctorArgumentCount >= 0), | ^~~~~~~~~~~~~~~~~ /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:367: error: request for member ‘operator()’ in ‘QtPrivate::FunctorReturnType<const char*, QtPrivate::List<> >::dummy<const char*>()’, which is of non-class type ‘const char*’ 367 | typedef decltype(dummy<Functor>().operator()((dummy<ArgList>())...)) Value; | ~~~~~~~~~~~~~~~~~~~~~~~~~~^
错误原因:
信号和插槽参数不兼容。
通俗的说,就是信号用的一种形式(如&QTimer::),槽用了另一种形式连接(SLOT)。
修改前:
connect(&timer,&QTimer::timeout,this,SLOT(timeout()));
修改后:
connect(&timer,&QTimer::timeout,this,&Http::timeout);
再次编译,错误就没有了