mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 09:19:22 +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 }
|
{ TQtAction }
|
||||||
|
|
||||||
|
{------------------------------------------------------------------------------
|
||||||
|
Method: TQtAction.Create
|
||||||
|
|
||||||
|
Contructor for the class.
|
||||||
|
------------------------------------------------------------------------------}
|
||||||
constructor TQtAction.Create(const AHandle: QActionH);
|
constructor TQtAction.Create(const AHandle: QActionH);
|
||||||
begin
|
begin
|
||||||
Handle := AHandle;
|
Handle := AHandle;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{------------------------------------------------------------------------------
|
||||||
|
Method: TQtAction.Destroy
|
||||||
|
|
||||||
|
Destructor for the class.
|
||||||
|
------------------------------------------------------------------------------}
|
||||||
destructor TQtAction.Destroy;
|
destructor TQtAction.Destroy;
|
||||||
begin
|
begin
|
||||||
inherited Destroy;
|
inherited Destroy;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{------------------------------------------------------------------------------
|
||||||
|
Method: TQtAction.SlotTriggered
|
||||||
|
|
||||||
|
Callback for menu item click
|
||||||
|
------------------------------------------------------------------------------}
|
||||||
procedure TQtAction.SlotTriggered(checked: Boolean); cdecl;
|
procedure TQtAction.SlotTriggered(checked: Boolean); cdecl;
|
||||||
begin
|
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;
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
@ -298,11 +314,17 @@ begin
|
|||||||
QAction_setCheckable(Handle, p1);
|
QAction_setCheckable(Handle, p1);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{------------------------------------------------------------------------------
|
||||||
|
Method: TQtAction.setEnabled
|
||||||
|
------------------------------------------------------------------------------}
|
||||||
procedure TQtAction.setEnabled(p1: Boolean);
|
procedure TQtAction.setEnabled(p1: Boolean);
|
||||||
begin
|
begin
|
||||||
QAction_setEnabled(Handle, p1);
|
QAction_setEnabled(Handle, p1);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{------------------------------------------------------------------------------
|
||||||
|
Method: TQtAction.setVisible
|
||||||
|
------------------------------------------------------------------------------}
|
||||||
procedure TQtAction.setVisible(p1: Boolean);
|
procedure TQtAction.setVisible(p1: Boolean);
|
||||||
begin
|
begin
|
||||||
QAction_setVisible(Handle, p1);
|
QAction_setVisible(Handle, p1);
|
||||||
|
@ -235,13 +235,18 @@ begin
|
|||||||
We can detect this menu item checking if HasParent is false }
|
We can detect this menu item checking if HasParent is false }
|
||||||
if AMenuItem.HasParent then
|
if AMenuItem.HasParent then
|
||||||
begin
|
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
|
if AMenuItem.Count > 0 then
|
||||||
begin
|
begin
|
||||||
|
// TQtMenu(AMenuItem.Handle).Free;
|
||||||
end
|
end
|
||||||
{ Here the menu item has a QActionH handle }
|
{ Here the menu item has a QActionH handle }
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
|
// TQtAction(AMenuItem.Handle).Free;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user