mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-23 00:39:44 +02:00
Qt,Qt5,Qt6: fixed menuitem radio items behaviour. issue #41577
(cherry picked from commit b066b08122
)
Co-authored-by: zeljan1 <zeljko@holobit.hr>
This commit is contained in:
parent
937bfffe9d
commit
1cb679ef87
@ -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);
|
||||
|
@ -16758,7 +16758,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);
|
||||
|
@ -16667,7 +16667,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