Qt,Qt5: Fixed AV when chaning tabcontrol options. issue #37178

git-svn-id: trunk@63343 -
This commit is contained in:
zeljko 2020-06-11 10:28:20 +00:00
parent 8c58a18ea5
commit e43d67d3bc
2 changed files with 14 additions and 4 deletions

View File

@ -540,7 +540,12 @@ end;
class procedure TQtWSCustomTabControl.UpdateProperties(const ATabControl: TCustomTabControl);
begin
TQtTabWidget(ATabControl.Handle).setTabsClosable(nboShowCloseButtons in ATabControl.Options);
TQtTabWidget(ATabControl.Handle).SwitchTabsByKeyboard := nboKeyboardTabSwitch in ATabControl.Options;
if not WSCheckHandleAllocated(ATabControl, 'UpdateProperties') then
Exit;
if TQtWidget(ATabControl.Handle).ChildOfComplexWidget <> ccwTTabControl then
begin
TQtTabWidget(ATabControl.Handle).setTabsClosable(nboShowCloseButtons in ATabControl.Options);
TQtTabWidget(ATabControl.Handle).SwitchTabsByKeyboard := nboKeyboardTabSwitch in ATabControl.Options;
end;
end;

View File

@ -539,7 +539,12 @@ end;
class procedure TQtWSCustomTabControl.UpdateProperties(const ATabControl: TCustomTabControl);
begin
TQtTabWidget(ATabControl.Handle).setTabsClosable(nboShowCloseButtons in ATabControl.Options);
TQtTabWidget(ATabControl.Handle).SwitchTabsByKeyboard := nboKeyboardTabSwitch in ATabControl.Options;
if not WSCheckHandleAllocated(ATabControl, 'UpdateProperties') then
Exit;
if TQtWidget(ATabControl.Handle).ChildOfComplexWidget <> ccwTTabControl then
begin
TQtTabWidget(ATabControl.Handle).setTabsClosable(nboShowCloseButtons in ATabControl.Options);
TQtTabWidget(ATabControl.Handle).SwitchTabsByKeyboard := nboKeyboardTabSwitch in ATabControl.Options;
end;
end;