Written by marcelpetrick
on February 4, 2020
Bruh, wait, what?
After rebasing a bigger feature and solving all obvious conflicts, the new build threw an error like “no type names Car”. And I am currently not working in the automotive industry!
Issue was that a commit, on which was rebased, changed ‘old’ Qt4-signal-slot-syntax (with SIGNAL/SLOT keywords; the string-based connect) to the ‘new’ Qt5-version (typed and verifyable from the compiler). And one of the slots had a default parameter. This is not allowed, except you squish a lambda as intermediate layer.
1 2 3 4 5 6 7 8 |
// old version // connect( _model.get(), &AnalysisModel::signalImageChanged, // this, &ImageScene::slotImageChanged ); // ImageScene::slotImageChanged's second parameter has a default value. // Using Qt5-connects does just work with an intermediate lambda. connect( _model.get(), &AnalysisModel::signalImageChanged, this, [=](ImagePoolItem item){ ImageScene::slotImageChanged(item); } ); |
A bit more insight: Qt-docs.
edit: One of the earlier error-messags also hinted out what could be the culprit, but “no type named Car” is more funny 😉
1 |
qobject.h:239:9: error: static assertion failed: The slot requires more arguments than the signal provides. |