qt: use QMenu->exec instead of QMenu->popup to simulate win32 behavior

git-svn-id: trunk@29781 -
This commit is contained in:
paul 2011-03-10 06:47:44 +00:00
parent 13cb137a99
commit 5bb62f9253
2 changed files with 9 additions and 2 deletions

View File

@ -1353,6 +1353,7 @@ type
function getText: WideString; override;
function getVisible: Boolean; override;
procedure PopUp(pos: PQtPoint; at: QActionH = nil);
procedure Exec(pos: PQtPoint; at: QActionH = nil);
procedure removeActionGroup;
procedure setChecked(p1: Boolean);
procedure setCheckable(p1: Boolean);
@ -10878,7 +10879,12 @@ end;
procedure TQtMenu.PopUp(pos: PQtPoint; at: QActionH);
begin
QMenu_Popup(QMenuH(Widget), pos, at);
QMenu_popup(QMenuH(Widget), pos, at);
end;
procedure TQtMenu.Exec(pos: PQtPoint; at: QActionH);
begin
QMenu_exec(QMenuH(Widget), pos, at);
end;
function TQtMenu.actionHandle: QActionH;

View File

@ -473,7 +473,8 @@ begin
else
TQtMenu(APopupMenu.Handle).trackButton := QtRightButton;
TQtMenu(APopupMenu.Handle).PopUp(@Point);
// for win32 compatibility do a blocking call
TQtMenu(APopupMenu.Handle).Exec(@Point);
end;
end.