[Qt-interest] Runtime Error :- connect: No such slot ...
Sean Harmer
sean.harmer at maps-technology.com
Fri Feb 19 15:09:06 CET 2010
Hi,
On Friday 19 February 2010 13:44:53 Wm. G. Urquhart wrote:
> Sean Harmer wrote:
> > Look into the generated moc_sigtest.cpp file and check that the code
> > implementing the slot call is actually being generated by moc. If the
> > example works but your app doesn't work even with the same receiver then
> > your app (or the app's build system) must be doing something
> > differently.
>
> This I've done and I see this in the generated moc file from the not
> working version :
>
> case 0: setLegend((*reinterpret_cast< const QString(*)>(_a[1]))); break;
>
> And I see this :
>
> case 0: setLegend((*reinterpret_cast< const QString(*)>(_a[1]))); break;
>
> from the working version.
>
> > Are you able to call the setLegend() function directly or do you get a
> > linker error when you try it? Just wondering if you are picking up a
> > stale include file from somewhere.
>
> Yes, I can by adding :
>
> if (connect(...))
> ...
> else
> {
> setLegend(tr("Set Legend")) ;
> }
>
> to the code and with the connect failing I see this text appear in a
> QMessageBox as directed.
>
> The only thing that I can see here between the two projects is that the
> working SigTest is derived from QDialog whereas MyApp is derived from
> QMainWindow, or am I just getting desperate?
>
> I really don't see this being a Qtism I suspect the fault is between the
> seat and the keyboard but for the life of me I can't see where or why.
We all have days like that, sometimes a fresh pair of eyes helps. Are you able
to tarball up your app and mail it to me rather than dealing with small
examples which do work as expected? If so I can take a look if you like.
Cheers,
Sean
More information about the Qt-interest-old
mailing list