Merged revision(s) 47339 #8dcc70cd3b from trunk:

Qt: fixed LM_CONTEXTMENU event in case of TQtCustomControl, when eg. form.PopupMenu is assigned, and control.PopupMenu=nil.
........

git-svn-id: branches/fixes_1_4@47361 -
This commit is contained in:
maxim 2015-01-12 21:48:46 +00:00
parent 811a1e1a3f
commit 0c5af88a2d

View File

@ -4226,7 +4226,10 @@ begin
MousePos := QContextMenuEvent_globalPos(QContextMenuEventH(Event))^;
Msg.Msg := LM_CONTEXTMENU;
Msg.hWnd := HWND(Self);
if FOwner <> nil then
Msg.hWnd := HWND(FOwner)
else
Msg.hWnd := HWND(Self);
if QContextMenuEvent_reason(QContextMenuEventH(Event)) = QContextMenuEventKeyboard then
begin
Msg.XPos := -1;
@ -4247,6 +4250,10 @@ begin
if Assigned(LCLObject.PopupMenu) then
QEvent_ignore(Event);
SetNoMousePropagation(QWidgetH(Sender), False);
if (FOwner <> nil) and
((FChildOfComplexWidget = ccwCustomControl) or
(FChildOfComplexWidget = ccwScrollingWinControl)) then
SetNoMousePropagation(FOwner.Widget, False);
end;
if Result and (csDesigning in LCLObject.ComponentState) then