diff --git a/lcl/interfaces/qt/qtobjects.pas b/lcl/interfaces/qt/qtobjects.pas index e559b824eb..fbefc57ffe 100644 --- a/lcl/interfaces/qt/qtobjects.pas +++ b/lcl/interfaces/qt/qtobjects.pas @@ -257,19 +257,35 @@ uses qtwidgets; { TQtAction } +{------------------------------------------------------------------------------ + Method: TQtAction.Create + + Contructor for the class. + ------------------------------------------------------------------------------} constructor TQtAction.Create(const AHandle: QActionH); begin Handle := AHandle; end; +{------------------------------------------------------------------------------ + Method: TQtAction.Destroy + + Destructor for the class. + ------------------------------------------------------------------------------} destructor TQtAction.Destroy; begin inherited Destroy; end; +{------------------------------------------------------------------------------ + Method: TQtAction.SlotTriggered + + Callback for menu item click + ------------------------------------------------------------------------------} procedure TQtAction.SlotTriggered(checked: Boolean); cdecl; begin - if Assigned(MenuItem) and Assigned(MenuItem.OnClick) then MenuItem.OnClick(Self); + if Assigned(MenuItem) and Assigned(MenuItem.OnClick) then + MenuItem.OnClick(Self.MenuItem); end; {------------------------------------------------------------------------------ @@ -298,11 +314,17 @@ begin QAction_setCheckable(Handle, p1); end; +{------------------------------------------------------------------------------ + Method: TQtAction.setEnabled + ------------------------------------------------------------------------------} procedure TQtAction.setEnabled(p1: Boolean); begin QAction_setEnabled(Handle, p1); end; +{------------------------------------------------------------------------------ + Method: TQtAction.setVisible + ------------------------------------------------------------------------------} procedure TQtAction.setVisible(p1: Boolean); begin QAction_setVisible(Handle, p1); diff --git a/lcl/interfaces/qt/qtwsmenus.pp b/lcl/interfaces/qt/qtwsmenus.pp index 8c42efe51c..d3b767a6ee 100644 --- a/lcl/interfaces/qt/qtwsmenus.pp +++ b/lcl/interfaces/qt/qtwsmenus.pp @@ -235,13 +235,18 @@ begin We can detect this menu item checking if HasParent is false } if AMenuItem.HasParent then begin - { Here the menu item has a QMenuH handle } + { Here the menu item has a QMenuH handle + + Obs: Commented because they cause access violations inside Qt + library on the Virtual Magnifying Glass } if AMenuItem.Count > 0 then begin +// TQtMenu(AMenuItem.Handle).Free; end { Here the menu item has a QActionH handle } else begin +// TQtAction(AMenuItem.Handle).Free; end; end; end;