Qt: fire OnClose() after OnClick() event. fixes

git-svn-id: trunk@23386 -
This commit is contained in:
zeljko 2010-01-05 13:35:12 +00:00
parent ac0a784f15
commit 3b893a0a99
2 changed files with 10 additions and 5 deletions
lcl/interfaces/qt

View File

@ -8457,9 +8457,14 @@ begin
end;
procedure TQtMenu.SlotAboutToHide; cdecl;
var
Event: QLCLMessageEventH;
begin
if FMenuItem.Menu is TPopupMenu then
DoPopupClose;
begin
Event := QLCLMessageEvent_create(LCLQt_PopupMenuClose);
QCoreApplication_postEvent(Widget, Event);
end;
end;
procedure TQtMenu.DoPopupClose;

View File

@ -259,7 +259,7 @@ begin
{$ifdef VerboseQt}
WriteLn('[TQtWSMenuItem.SetVisible] SetShortCut: ' + AMenuItem.Caption + ' Visible: ', Visible);
{$endif}
if not WSCheckMenuItem(AMenuItem, 'SetEnable') then
if not WSCheckMenuItem(AMenuItem, 'SetVisible') then
Exit;
TQtMenu(AMenuItem.Handle).setVisible(Visible);
@ -274,7 +274,7 @@ class function TQtWSMenuItem.SetCheck(const AMenuItem: TMenuItem; const Checked:
begin
Result := False;
if not WSCheckMenuItem(AMenuItem, 'SetEnable') then
if not WSCheckMenuItem(AMenuItem, 'SetCheck') then
Exit;
TQtMenu(AMenuItem.Handle).setChecked(Checked);
@ -308,7 +308,7 @@ class function TQtWSMenuItem.SetRadioItem(const AMenuItem: TMenuItem; const Radi
begin
Result := False;
if not WSCheckMenuItem(AMenuItem, 'SetEnable') then
if not WSCheckMenuItem(AMenuItem, 'SetRadioItem') then
Exit;
TQtMenu(AMenuItem.Handle).setCheckable(RadioItem);
@ -324,7 +324,7 @@ end;
------------------------------------------------------------------------------}
class function TQtWSMenuItem.SetRightJustify(const AMenuItem: TMenuItem; const Justified: boolean): boolean;
begin
if not WSCheckMenuItem(AMenuItem, 'SetEnable') then
if not WSCheckMenuItem(AMenuItem, 'SetRightJustify') then
Exit;
// what should be done here? maybe this?