mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-08 21:19:17 +02:00
Qt,Qt5,Qt6: fixed menuitem radio items behaviour. issue #41577
This commit is contained in:
parent
a3dc9a9061
commit
b066b08122
@ -16165,7 +16165,7 @@ begin
|
||||
for i := 0 to FActions.Count - 1 do
|
||||
begin
|
||||
Group := TQtActionGroup(FActions.Items[i]);
|
||||
if Group.GroupIndex = AItem.GroupIndex then
|
||||
if (Group.GroupIndex = AItem.GroupIndex) and (Group.Exclusive = AItem.RadioItem) then
|
||||
begin
|
||||
QAction_setEnabled(TQtMenu(AItem.Handle).actionHandle, AItem.Enabled);
|
||||
QAction_setVisible(TQtMenu(AItem.Handle).actionHandle, AItem.Visible);
|
||||
|
@ -115,14 +115,6 @@ begin
|
||||
begin
|
||||
Result.setText(AMenuItem.Caption{%H-});
|
||||
Result.setEnabled(AMenuItem.Enabled);
|
||||
|
||||
{issue #37741}
|
||||
if AMenuItem.RadioItem and (AMenuItem.Count = 0) and (AMenuItem.GroupIndex = 0) then
|
||||
begin
|
||||
if AMenuItem.GroupIndex = 0 then
|
||||
AMenuItem.GroupIndex := 1;
|
||||
end;
|
||||
|
||||
Result.setCheckable(AMenuItem.RadioItem or AMenuItem.ShowAlwaysCheckable);
|
||||
Result.BeginUpdate;
|
||||
Result.setChecked(AMenuItem.Checked);
|
||||
|
@ -16686,7 +16686,7 @@ begin
|
||||
for i := 0 to FActions.Count - 1 do
|
||||
begin
|
||||
Group := TQtActionGroup(FActions.Items[i]);
|
||||
if Group.GroupIndex = AItem.GroupIndex then
|
||||
if (Group.GroupIndex = AItem.GroupIndex) and (Group.Exclusive = AItem.RadioItem) then
|
||||
begin
|
||||
QAction_setEnabled(TQtMenu(AItem.Handle).actionHandle, AItem.Enabled);
|
||||
QAction_setVisible(TQtMenu(AItem.Handle).actionHandle, AItem.Visible);
|
||||
|
@ -114,14 +114,6 @@ begin
|
||||
begin
|
||||
Result.setText(AMenuItem.Caption{%H-});
|
||||
Result.setEnabled(AMenuItem.Enabled);
|
||||
|
||||
{issue #37741}
|
||||
if AMenuItem.RadioItem and (AMenuItem.Count = 0) and (AMenuItem.GroupIndex = 0) then
|
||||
begin
|
||||
if AMenuItem.GroupIndex = 0 then
|
||||
AMenuItem.GroupIndex := 1;
|
||||
end;
|
||||
|
||||
Result.setCheckable(AMenuItem.RadioItem or AMenuItem.ShowAlwaysCheckable);
|
||||
Result.BeginUpdate;
|
||||
Result.setChecked(AMenuItem.Checked);
|
||||
|
@ -16595,7 +16595,7 @@ begin
|
||||
for i := 0 to FActions.Count - 1 do
|
||||
begin
|
||||
Group := TQtActionGroup(FActions.Items[i]);
|
||||
if Group.GroupIndex = AItem.GroupIndex then
|
||||
if (Group.GroupIndex = AItem.GroupIndex) and (Group.Exclusive = AItem.RadioItem) then
|
||||
begin
|
||||
QAction_setEnabled(TQtMenu(AItem.Handle).actionHandle, AItem.Enabled);
|
||||
QAction_setVisible(TQtMenu(AItem.Handle).actionHandle, AItem.Visible);
|
||||
|
@ -114,14 +114,6 @@ begin
|
||||
begin
|
||||
Result.setText(AMenuItem.Caption{%H-});
|
||||
Result.setEnabled(AMenuItem.Enabled);
|
||||
|
||||
{issue #37741}
|
||||
if AMenuItem.RadioItem and (AMenuItem.Count = 0) and (AMenuItem.GroupIndex = 0) then
|
||||
begin
|
||||
if AMenuItem.GroupIndex = 0 then
|
||||
AMenuItem.GroupIndex := 1;
|
||||
end;
|
||||
|
||||
Result.setCheckable(AMenuItem.RadioItem or AMenuItem.ShowAlwaysCheckable);
|
||||
Result.BeginUpdate;
|
||||
Result.setChecked(AMenuItem.Checked);
|
||||
|
Loading…
Reference in New Issue
Block a user