[Qt-interest] Runtime Error :- connect: No such slot (Update)

Samuel Gaist samuel.gaist at cinetis.ch
Sun Feb 21 12:16:27 CET 2010


On 21 févr. 10, at 11:49, Wm. G. Urquhart wrote:

> Steven Doerfler wrote:
>> Wm. G. Urquhart wrote:
>>> when I 're-wire' my connect(...) to this slot it works, however;  
>>> if I
>>> change the code to use setLegendIndex(int) the connect(...) fails!
>>>
>> Try using QObject::dumpObjectInfo to display all your signal  
>> connections
>> just after sending the signal.  Compare the working and not-working
>> connections in the output.
>>
>> Steven
>
> Hi Steven,
>
> Well I've done what you suggest (I think correctly) and this is the
> output I get from both. I don't purport to say I understand the
> differences so any help in the 'interpretation' would be appreciated.
>
> -- NON Working Version --
>
> pTest = new SignalTest() ;
> if (connect(pTest, SIGNAL(Boo(int)), this, SLOT(setLegendIndex(int)),
> Qt::ConnectionType::QueuedConnection))
> {
> 	pTest->Start() ;
> }
> QObject::dumpObjectInfo() ;
>
> -- Output ---
>
> Object::connect: No such slot MyApp::setLegendIndex(int) in  
> myapp.cpp:302
> Object::connect:  (receiver name: 'MyApp')
> OBJECT MyApp::MyApp
>   SIGNALS OUT
>         signal: destroyed(QObject*)
>         signal: destroyed()
>         signal: customContextMenuRequested(QPoint)
>         signal: iconSizeChanged(QSize)
>           --> QToolBar::mainToolBar _q_updateIconSize(QSize)
>         signal: toolButtonStyleChanged(Qt::ToolButtonStyle)
>           --> QToolBar::mainToolBar
> _q_updateToolButtonStyle(Qt::ToolButtonStyle)
>   SIGNALS IN
>           <-- QAction::action_About  actionAbout()
>           <-- QAction::action_Exit  actionExit()
>
> -- Working Version ---
>
> pTest = new SignalTest() ;
> if (connect(pTest, SIGNAL(Boo(int)), this, SLOT(typeChanged(int)),
> Qt::ConnectionType::QueuedConnection))
> {
> 	pTest->Start() ;
> }
> QObject::dumpObjectInfo() ;
>
> -- Output ---
>
> OBJECT MyApp::MyApp
>   SIGNALS OUT
>         signal: destroyed(QObject*)
>         signal: destroyed()
>         signal: customContextMenuRequested(QPoint)
> The thread 'SignalTest' (0x1094) has exited with code 0 (0x0).
>         signal: iconSizeChanged(QSize)
>           --> QToolBar::mainToolBar _q_updateIconSize(QSize)
>         signal: toolButtonStyleChanged(Qt::ToolButtonStyle)
>           --> QToolBar::mainToolBar
> _q_updateToolButtonStyle(Qt::ToolButtonStyle)
>   SIGNALS IN
>           <-- SignalTest::unnamed  typeChanged(int)
>           <-- QAction::action_About  actionAbout()
>           <-- QAction::action_Exit  actionExit()
>
> I have crippled 99% of the application by commenting out the all of  
> the
> applications connect(...)ions at start up along with other stuff, but
> still I get nothing.
>
Hello,
I might be stating the obvious but did you double check that you  
correctly declare setLegendIndex(int) as a slot in your header ?
Something like following:

class MyApp : public QObject
{
Q_OBJECT

public:
	MyApp();

public slots:
	setLegendIndex(int);
}

Hope it helps,
Samuel

>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 1587 bytes
Desc: not available
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100221/f12d6d0f/attachment.bin 


More information about the Qt-interest-old mailing list