Qt,Qt5: Fixed menu radio items. issue #37741

This commit is contained in:
Željan Rikalo 2021-08-28 20:03:54 +02:00
parent fcf361530d
commit 52f2a8b88f
2 changed files with 16 additions and 0 deletions

View File

@ -115,6 +115,14 @@ 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);

View File

@ -114,6 +114,14 @@ begin
begin
Result.setText(GetUtf8String(AMenuItem.Caption));
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);