Re: Draggable QActions in Qt
Why ar you creating a new action in the drop event instead of reusing the original one? Are you sure beforeAction points to a valid action (can you retrieve its name) after using actionAt? To me it would seem more appropriate to use the position from the drop event and not from QCursor::pos().
Re: Draggable QActions in Qt
Hello Sir,
beforeAction always comes out to be 0.
Not able to access it.
How to get the action which has the mouse focus ? I have used actionAt , but its not working.
I am struck here & I will reuse the original action instead of newAction.
Re: Draggable QActions in Qt
Quote:
Originally Posted by
vajindarladdad
Hello Sir,
beforeAction always comes out to be 0.
Not able to access it.
Probably because of misuse of QCursor::pos()
Quote:
How to get the action which has the mouse focus ? I have used actionAt , but its not working.
The way you did it was incorrect. Don't use QCursor::pos() which is unreliable and returns the position in screen coordinates, not widget coordinates.
Re: Draggable QActions in Qt
Sir ,
Please give me a hint to access the QAction based on the mouse position.
is there any other function to access it.
Re: Draggable QActions in Qt
Probably QDropEvent::pos() and QMenu::actionAt() but I think I have already said that...
Re: Draggable QActions in Qt