From 9faf79f661175b781b12aea4a25dc8f3b5b278dd Mon Sep 17 00:00:00 2001 From: zeljko Date: Sun, 10 Nov 2019 13:41:10 +0000 Subject: [PATCH] Qt: implemented selected text in teEdit git-svn-id: trunk@62224 - --- lcl/interfaces/qt/qtthemes.pas | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lcl/interfaces/qt/qtthemes.pas b/lcl/interfaces/qt/qtthemes.pas index f4b4b46cce..91f84c7d49 100644 --- a/lcl/interfaces/qt/qtthemes.pas +++ b/lcl/interfaces/qt/qtthemes.pas @@ -568,7 +568,7 @@ var Context: TQtDeviceContext; Widget: QWidgetH; W: WideString; - TextRect: TRect; + TextRect, SelRect: TRect; AOldMode: Integer; ATextPalette: Cardinal; AQColor: TQColor; @@ -709,6 +709,13 @@ begin begin if IsDisabled(Details) then QPalette_setCurrentColorGroup(Palette, QPaletteDisabled); + if GetControlState(Details) and QStyleState_Selected <> 0 then + begin + Context.font.Metrics.boundingRect(@SelRect, @R, DTFlagsToQtFlags(Flags), @W); + ColorRefToTQColor(ColorToRGB(clHighlight), AQColor); + QPainter_fillRect(Context.Widget, @SelRect, PQColor(@AQColor)); + ATextPalette := QPaletteHighlightedText; + end; end; QStyle_drawItemText(Style, Context.Widget, @R,