Show popup menu at cursor on wxQt if needed.
This commit is contained in:
parent
57349c2aaa
commit
7a0149dfcb
1 changed files with 8 additions and 1 deletions
|
|
@ -1176,7 +1176,14 @@ void wxWindowQt::DoSetToolTip( wxToolTip *tip )
|
|||
bool wxWindowQt::DoPopupMenu(wxMenu *menu, int x, int y)
|
||||
{
|
||||
menu->UpdateUI();
|
||||
menu->GetHandle()->exec( GetHandle()->mapToGlobal( QPoint( x, y ) ) );
|
||||
|
||||
QPoint pt;
|
||||
if (x == wxDefaultCoord && y == wxDefaultCoord)
|
||||
pt = QCursor::pos();
|
||||
else
|
||||
pt = GetHandle()->mapToGlobal(QPoint(x, y));
|
||||
|
||||
menu->GetHandle()->exec(pt);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue