[Qt-interest] Runtime Error :- connect: No such slot ...

KC Jones kc at asperasoft.com
Fri Feb 19 02:17:27 CET 2010


For muti threaded apps, all connections are queued by default.
And for queued connections you need to be sure that all your types are
registered.

So I *think* you need to register the size_t type with:
qRegisterMetaType("size_t");

On Thu, Feb 18, 2010 at 12:47 PM, Wm. G. Urquhart <wgu at wurquhart.co.uk>wrote:

> Hi All,
>
> I have a class derived from QThread that contains some signals, but when
> I try to connect these signals to the UI I get a runtime error telling
> me that the SLOT to which I want to connect said signals to does not exist.
>
> In the UI header file I have
>
> private slots:
> void loadComplete(size_t) ;
>
> and in the UI .cpp I have :
>
> void MyApp::loadComplete(size_t count)
> {
>        ui->statusBar->showMessage(tr("Loaded %1 rows. Done.").arg(count),
> 5000) ;
> }
>
> And this is the line I use to try to connect:
>
> connect(sqlLoader, SIGNAL(loadEnded(size_t)), this,
> SLOT(loadComplete(size_t))) ;
>
> Both of the applicable headers are MOC processed and both contain the
> Q_OBJECT macro, which leaves me seriously confused.
>
> Can anyone shed some light on this please?
>
> --
> Thanks.
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100218/aaa0d3a4/attachment.html 


More information about the Qt-interest-old mailing list