diff --git a/lcl/interfaces/qt/qtobjects.pas b/lcl/interfaces/qt/qtobjects.pas index f65e53f60e..5469a19e75 100644 --- a/lcl/interfaces/qt/qtobjects.pas +++ b/lcl/interfaces/qt/qtobjects.pas @@ -779,7 +779,7 @@ type destructor Destroy; override; procedure ReloadPaletteBegin; // used in QEventPaletteChange ! procedure ReloadPaletteEnd; // used in QEventPaletteChange ! - procedure setColor(const AColor: PQColor); overload; + procedure setColor(const AColor: PQColor); procedure setTextColor(const AColor: PQColor); property Handle: QPaletteH read FHandle; property CurrentColor: TQColor read FCurrentColor; diff --git a/lcl/interfaces/qt/qtwinapi.inc b/lcl/interfaces/qt/qtwinapi.inc index deae74ab25..17abb2b9b6 100644 --- a/lcl/interfaces/qt/qtwinapi.inc +++ b/lcl/interfaces/qt/qtwinapi.inc @@ -2412,7 +2412,14 @@ begin begin AWidget := HwndFromWidgetH(QtDC.Parent); if (AWidget <> 0) and Assigned(TQtWidget(AWidget).LCLObject) then + begin ATransparent := not (csOpaque in TQtWidget(AWidget).LCLObject.ControlStyle); + // issue #26607 + if ATransparent and (TQtWidget(AWidget).LCLObject is TCustomPanel) and + (TQtWidget(AWidget).LCLObject.Color <> clDefault) and + not TCustomPanel(TQtWidget(AWidget).LCLObject).ParentColor then + ATransparent := False; + end; end; case Style of