[Qt-interest] Runtime Error :- connect: No such slot (Update)
Wm. G. Urquhart
wgu at wurquhart.co.uk
Sun Feb 21 11:49:58 CET 2010
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.
More information about the Qt-interest-old
mailing list