0

I realise this question has been asked before, though my circumstances are slightly different and I have found none of the other answers helpful, I am new to QTCreator.

I am trying to build a project with QTCreator, that builds fine on OSX but when building it with Ubuntu I get this error:

QMetaObject::connectSlotsByName: No matching signal for on_actionWrite_Device_triggered()

The project still builds and partly works, but will not write to an external device (the point of the program).

Can anyone give a walkthrough of what I need to do, previous answers have said about explicitly connecting things, but not gone into details about how to do this. Any tips on searching through the project to find where to make this fix (I didn't write the original program).

Any help is appreciated Tom

holmeswatson
  • 969
  • 3
  • 14
  • 39
  • Please actually read the post before saying it is a duplicate. I had already read the Q you linked to, it was a different situation and the answer was not helpful to me. – holmeswatson Jun 24 '14 at 10:23
  • Asking the same question will not help. If it has no answer for you, it has no answer for you. Raise a bounty on it and you get your answer there for reputation. We do not need many questions for the same stuff. This question is being asked again, again, and again. – László Papp Jun 24 '14 at 10:24
  • 1
    Just because it is the same error, does not mean it is the same cause and they should therefore not be grouped together. In your link, they have added a parameter so of course they couldn't match. But all I have done is switch platforms (no change to the project code) so obv something else is going wrong here. – holmeswatson Jun 24 '14 at 10:27
  • This is being asked again, again, and again. There were other two links mentioned in the other two posts. We have three threads already for the same error message and you created a fourth. There might be even more... Please use the search and comment options before posting a new question. – László Papp Jun 24 '14 at 10:29
  • As I have already said, none of these other posts have this error occurring after a switch in platform, so this issue has not been address. It seems like you have more of a problem in reading previous questions than you are accusing me of having. – holmeswatson Jun 24 '14 at 10:34
  • If you really feel that your situation is totally different from the other questions and its answers at least provide which of these answers you tried and/or how they don't qualify for your issue. Which version of QtCore are you using on both platforms? – rene Jun 24 '14 at 11:00
  • 2
    This may not be a duplicate, but it lacks the information to diagnose the problem. Also, do you really get the error when *building*? That is a runtime message, not a build time message. – hyde Jun 24 '14 at 12:09
  • @rene: even in that case, he should leave a comment in the other thread which is supposed to answer this generic error. – László Papp Jun 26 '14 at 01:26
  • I have post new Answer at https://stackoverflow.com/questions/24355023/qmetaobjectconnectslotsbyname-no-matching-signal/49892587#49892587 Please go through once. – AB Bolim Apr 18 '18 at 06:26

2 Answers2

15

Check out this: http://qt-project.org/doc/qt-4.8/qmetaobject.html#connectSlotsByName

The Method connectSlotsByName tries to connect slots to signals using the following form:

void on_<object name>_<signal name>(<signal parameters>);

Object name and signal name are separated by an underscore. I'm not sure but it may be a problem that the object name itself (actionWrite_Device) contains an underscore and therefore it is not clear what the signal name is (it could be either device_triggered or triggered). The same holds for the object name. This ambiguity might cause the trouble.

a_guest
  • 34,165
  • 12
  • 64
  • 118
  • I have post new Answer at https://stackoverflow.com/questions/24355023/qmetaobjectconnectslotsbyname-no-matching-signal/49892587#49892587 Please go through once. – AB Bolim Apr 18 '18 at 06:27
0

If this works on one platform, but does not on another, then a possible reason is you don't have a clean build on one of the platforms.

To have clean build, first of all clean all extra files from source directory (for example using version control tools to remove all unversioned files). This is important, because compiler will look for some files preferentially under source directory, and if there are stale generated source files (moc_*.*, ui_*.h, etc) there, they will be used instead of the right ones in build directory. Then make sure you have shadow builds enabled in Qt Creator for the project and the build, and do a clean build.

Or just get a fresh checkout/clone from version control to a clean directory.


Another possible reason is use of #ifdef resulting in different build result on different platforms. Or the project's .pro file may also have conditional sections, resulting in different files being built on different platforms, or different compile commands being used.

Leon
  • 31,443
  • 4
  • 72
  • 97
hyde
  • 60,639
  • 21
  • 115
  • 176
  • I have post new Answer at https://stackoverflow.com/questions/24355023/qmetaobjectconnectslotsbyname-no-matching-signal/49892587#49892587 Please go through once. – AB Bolim Apr 18 '18 at 06:27