Monday, 15 April 2013

c++ - QMetaObject::connectSlotsByName: No matching signal -



c++ - QMetaObject::connectSlotsByName: No matching signal -

i set qt menu, automatically connected action function on_actionopen_triggered(). later want pass filename string function in order phone call function manually in special condition. changed function signature on_actionopen_triggered( const char *filename_in ). after alter programme running well, there complain in terminal,

qmetaobject::connectslotsbyname: no matching signal on_actionopen_triggered(const char*)

i wondering happened, , how can add together arguments menu action functions.

thank you.

qt autoconnection mechanism can't find suitable signal slot. menu item there's no signal match slot 1 argument, , signal must not have fewer arguments slot.

you can alter slot's name won't seek find matching signal, , utilize qobject::connect straight instead of qmetaobject::connectslotsbyname. you'll have assign default value argument filename_in if want connect work triggeredsignal.

c++ qt signals-slots

No comments:

Post a Comment