mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-11 16:56:01 +02:00
Small bugfix for menus on qt interface
git-svn-id: trunk@10534 -
This commit is contained in:
parent
8e29013693
commit
eeab5cc377
@ -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);
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user