Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Problem with connect invocation
Forum Updated to NodeBB v4.3 + New Features

Problem with connect invocation

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 71 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • PerdrixP Offline
    PerdrixP Offline
    Perdrix
    wrote last edited by
    #1

    I have a slot called help whose signature was:

    public slots:
    	void help();
    

    I just changed it to be:

    public slots:
    	void help(bool startInBackground = false);
    

    and now I get:

    FAILED: DeepSkyStacker/CMakeFiles/DeepSkyStacker.dir/ExplorerBar.cpp.o 
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -DBOOST_CONTAINER_NO_LIB -DBOOST_CONTAINER_STATIC_LINK -DCMS_NO_REGISTER_KEYWORD -DLIBRAW_NODLL -DNOMINMAX -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DUSE_LIBTIFF_STATIC -D_CRT_SECURE_NO_DEPRECATE -I/Users/amonra/.vs/DSS/build/DeepSkyStacker/DeepSkyStacker_autogen/include -I/Users/amonra/.vs/DSS/DeepSkyStacker/. -I/Users/amonra/.vs/DSS/DeepSkyStacker/../DeepSkyStackerKernel -I/Users/amonra/.vs/DSS/DeepSkyStacker/GeneratedFiles/RelWithDebInfo -I/Users/amonra/.vs/DSS/DeepSkyStacker/GeneratedFiles -I/Users/amonra/.vs/DSS/DeepSkyStacker/../ZClass -I/Users/amonra/.vs/DSS/DeepSkyStacker/../Tools -isystem /usr/local/include -isystem /opt/Qt/6.9.1/macos/lib/QtCore.framework/Headers -iframework /opt/Qt/6.9.1/macos/lib -isystem /opt/Qt/6.9.1/macos/mkspecs/macx-clang -isystem /opt/Qt/6.9.1/macos/include -isystem /opt/Qt/6.9.1/macos/lib/QtGui.framework/Headers -isystem /opt/Qt/6.9.1/macos/lib/QtWidgets.framework/Headers -isystem /opt/Qt/6.9.1/macos/lib/QtNetwork.framework/Headers -isystem /Users/amonra/.vs/DSS/build/vcpkg_installed/x64-osx/include -isystem /Users/amonra/.vs/DSS/build/vcpkg_installed/x64-osx/include/libraw -g -Wno-switch-enum -Wno-switch -O2 -g -DNDEBUG -std=c++20 -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.5.sdk -mmacosx-version-min=13.4 -Xclang -fopenmp -Xclang -fopenmp -Winvalid-pch -Xclang -include-pch -Xclang /Users/amonra/.vs/DSS/build/DeepSkyStacker/CMakeFiles/DeepSkyStacker.dir/cmake_pch.hxx.pch -Xclang -include -Xclang /Users/amonra/.vs/DSS/build/DeepSkyStacker/CMakeFiles/DeepSkyStacker.dir/cmake_pch.hxx -MD -MT DeepSkyStacker/CMakeFiles/DeepSkyStacker.dir/ExplorerBar.cpp.o -MF DeepSkyStacker/CMakeFiles/DeepSkyStacker.dir/ExplorerBar.cpp.o.d -o DeepSkyStacker/CMakeFiles/DeepSkyStacker.dir/ExplorerBar.cpp.o -c /Users/amonra/.vs/DSS/DeepSkyStacker/ExplorerBar.cpp
    In file included from <built-in>:1:
    In file included from /Users/amonra/.vs/DSS/build/DeepSkyStacker/CMakeFiles/DeepSkyStacker.dir/cmake_pch.hxx:5:
    In file included from /Users/amonra/.vs/DSS/DeepSkyStacker/pch.h:3:
    In file included from /opt/Qt/6.9.1/macos/lib/QtWidgets.framework/Headers/QtWidgets:3:
    In file included from /opt/Qt/6.9.1/macos/lib/QtWidgets.framework/Headers/QtWidgetsDepends:3:
    In file included from /opt/Qt/6.9.1/macos/lib/QtCore.framework/Headers/QtCore:19:
    In file included from /opt/Qt/6.9.1/macos/lib/QtCore.framework/Headers/qabstractanimation.h:7:
    /opt/Qt/6.9.1/macos/lib/QtCore.framework/Headers/qobject.h:271:28: error: no matching function for call to 'makeCallableObject'
      271 |                            QtPrivate::makeCallableObject<Func1>(std::forward<Func2>(slot)),
          |                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /Users/amonra/.vs/DSS/DeepSkyStacker/ExplorerBar.cpp:92:3: note: in instantiation of function template specialization 'QObject::connect<void (QLabel::*)(const QString &), void (DeepSkyStacker::*)(bool)>' requested here
       92 |                 connect(ui->help, &QLabel::linkActivated, DeepSkyStacker::instance(), &DeepSkyStacker::help);
          |                 ^
    /opt/Qt/6.9.1/macos/lib/QtCore.framework/Headers/qobjectdefs_impl.h:604:5: note: candidate template ignored: requirement 'QtPrivate::countMatchingArguments() >= 0' was not satisfied [with Prototype = void (QLabel::*)(const QString &), Functor = void (DeepSkyStacker::*)(bool)]
      604 |     makeCallableObject(Functor &&func)
          |     ^
    1 error generated.
    

    from this line:

    		connect(ui->help, &QLabel::linkActivated, DeepSkyStacker::instance(), &DeepSkyStacker::help);
    

    so clearly I need to change it, but what to?

    If this is obvious - put it down to my not having had enough coffee yet.
    Thanks
    David

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote last edited by SGaist
      #2

      Hi,

      You are trying to connect a signal with a string parameter to a slot with a boolean one.

      If you really want to do that, you should use a lambda.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • PerdrixP Offline
        PerdrixP Offline
        Perdrix
        wrote last edited by Perdrix
        #3

        @SGaist Thank you! This seems to work (well at least it compiles)!

        		auto deepSkyStacker = DeepSkyStacker::instance();
        
        		connect(ui->help, &QLabel::linkActivated, deepSkyStacker, [=]() { deepSkyStacker->help(); });
        

        David

        1 Reply Last reply
        0
        • PerdrixP Perdrix has marked this topic as solved

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved