
Originally Posted by
mickey
event is called when I release mouse! But If I pressed dx button for do traslation, menu mustn't appear!
Yes, we understood the problem. Here's a couple of pseudo algorithms to solve it. The choice is yours:
mousePressEvent:
pressPoint = mouse press event's position
contextMenuEvent:
if distance between context menu event's position and pressPoint is less than something
show context menu
else do nothing
mousePressEvent:
pressPoint = mouse press event's position
contextMenuEvent:
if distance between context menu event's position and pressPoint is less than something
show context menu
else do nothing
To copy to clipboard, switch view to plain text mode
or
mousePressEvent:
pressPoint = mouse press event's position
mouseReleaseEvent:
if distance between mouse release event's position and pressPoint is less than something
showContextMenu = true
else
showContextMenu = false
contextMenuEvent:
if showContextMenu
show context menu
else do nothing
mousePressEvent:
pressPoint = mouse press event's position
mouseReleaseEvent:
if distance between mouse release event's position and pressPoint is less than something
showContextMenu = true
else
showContextMenu = false
contextMenuEvent:
if showContextMenu
show context menu
else do nothing
To copy to clipboard, switch view to plain text mode
or
mousePressEvent:
showContextMenu = true
mouseMoveEvent:
showContextMenu = false
contextMenuEvent:
if showContextMenu
show context menu
else do nothing
mousePressEvent:
showContextMenu = true
mouseMoveEvent:
showContextMenu = false
contextMenuEvent:
if showContextMenu
show context menu
else do nothing
To copy to clipboard, switch view to plain text mode
or ....
Bookmarks