Qt,Qt5,Qt6: fixed widget palette dangling pointers.

(cherry picked from commit b2dc565bb3)
This commit is contained in:
Željan Rikalo 2024-01-18 22:20:03 +01:00
parent 9835b964fb
commit 1f724b1393
3 changed files with 15 additions and 6 deletions

View File

@ -2552,8 +2552,11 @@ begin
begin
// DebugLn('QEventEnabledChange: ',dbgsName(LCLObject),' enabled ',dbgs(getEnabled));
if not getEnabled then
Palette.setTextColor(@Palette.DisabledTextColor)
else
begin
BeginUpdate;
Palette.setTextColor(@Palette.DisabledTextColor);
EndUpdate;
end else
begin
setInitialColor;
setInitialFontColor;

View File

@ -2664,8 +2664,11 @@ begin
begin
// DebugLn('QEventEnabledChange: ',dbgsName(LCLObject),' enabled ',dbgs(getEnabled));
if not getEnabled then
Palette.setTextColor(@Palette.DisabledTextColor)
else
begin
BeginUpdate;
Palette.setTextColor(@Palette.DisabledTextColor);
EndUpdate;
end else
begin
setInitialColor;
setInitialFontColor;

View File

@ -2662,8 +2662,11 @@ begin
begin
// DebugLn('QEventEnabledChange: ',dbgsName(LCLObject),' enabled ',dbgs(getEnabled));
if not getEnabled then
Palette.setTextColor(@Palette.DisabledTextColor)
else
begin
BeginUpdate;
Palette.setTextColor(@Palette.DisabledTextColor);
EndUpdate;
end else
begin
setInitialColor;
setInitialFontColor;