PDA

View Full Version : How to delete reference to on_Action.... slot



davethomaspilot
7th April 2015, 21:30
Qt Designer has a nice feature that lets you set up a template for slots associated with an action. You just right mouse click on the action, then click on "Go to Slot".

It sets up a prototype for a slot, and creates an empty method named something like "on_action.." The connection between signal and slot is done automatically. Sweet!

But, what if I no longer want anything to happen on that signal? For example, I decided to use a "toggled" signal instead of the "triggered" signal. I can't figure out how to get rid the stuff associated with the triggered signal.

Deleting the proto and code for the slot result in an undefined reference at link time from a moc file. It tried rerunning qmake, but that didn't fix.

I'm thinking there's an easy way, but I can't figure it out.

Added after 44 minutes:

After deleting the proto and slot code, a clean build fixed it up.

anda_skoa
8th April 2015, 08:56
It sets up a prototype for a slot, and creates an empty method named something like "on_action.." The connection between signal and slot is done automatically. Sweet!

And it is a very bad feature since it is based on the name of the sender object.

I wouldn't recommend to do that in any real world application, explicit connects are far more robust.

Cheers,
_