I am writing Qt event record software. I want to create a single slot that can record the sending object and the signal type.
connect(myButton, SIGNAL(clicked()), this, SLOT(mySlot()));
connect(myMenuAction, SIGNAL(triggered()), this, SLOT(mySlot()));
void mySlot()
{
QString senderName
= sender
()->objectName
();
QString signalName
= ?
// is it clicked or triggered? }
connect(myButton, SIGNAL(clicked()), this, SLOT(mySlot()));
connect(myMenuAction, SIGNAL(triggered()), this, SLOT(mySlot()));
void mySlot()
{
QString senderName = sender()->objectName();
QString signalName = ? // is it clicked or triggered?
}
To copy to clipboard, switch view to plain text mode
Thanks.
Bookmarks