PDA

View Full Version : QPushbutton Right Click with customcontext menu sender inaccessible.



RSK
18th January 2018, 11:41
I want to use right click of push button. I am connecting Custommenurequested signal with the slot. Signal is generated and slot is triggered. My problem is I am not able to access the sender to know which pushbutton is clicked. My connection is done in one class and event is generated in another class. My slot is present in same class where connection is done. While debugging in slot it says sender not accessible.
I tried to put the slot in the class where the signal is generated. In that case linker error says receiver not found in current object and slot is not triggered.
How this can be solved? Either access the sender from another class or connecting to slot from another class.

high_flyer
18th January 2018, 14:15
Its really hard to tell without seeing the code.

d_stranz
18th January 2018, 16:17
My problem is I am not able to access the sender to know which pushbutton is clicked.

Unfortunately, even if you do find a way for the debugger to show you the sender, I think the sender might turn out to be the context menu, not the push button that responded to the click to post the menu.

In any case, as high_flyer says, it is impossible to diagnose code problems with no code.