From 3241c30faf3b4b46432c2abb97245cc0c09dc113 Mon Sep 17 00:00:00 2001 From: zeljko Date: Sun, 18 Jan 2015 16:01:18 +0000 Subject: [PATCH] Qt: added cdPostPaint for TListView when ViewStyle <> vsReport. part of issue #27315 git-svn-id: trunk@47414 - --- lcl/interfaces/qt/qtwidgets.pas | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lcl/interfaces/qt/qtwidgets.pas b/lcl/interfaces/qt/qtwidgets.pas index 54b790b03a..aa89df031c 100644 --- a/lcl/interfaces/qt/qtwidgets.pas +++ b/lcl/interfaces/qt/qtwidgets.pas @@ -12216,6 +12216,7 @@ var TmpDC1, TmpDC2: HDC; SkipDefault: Boolean; Item: QListWidgetItemH; + APaintResult: TCustomDrawResult; begin if (ViewStyle >= 0) and not (FChildOfComplexWidget = ccwComboBox) then begin @@ -12278,10 +12279,17 @@ begin // here we do only OnCustomDrawItem and OnCustomDrawSubItem // OnCustomDraw is done inside itemViewportEventFilter. - SkipDefault := cdrSkipDefault in TCustomListViewAccess(LCLObject).IntfCustomDraw(ATarget, cdPrePaint, ItemIndex, SubItemIndex, ACustomState, @R); + + APaintResult := TCustomListViewAccess(LCLObject).IntfCustomDraw(ATarget, cdPrePaint, ItemIndex, SubItemIndex, ACustomState, @R); + SkipDefault := cdrSkipDefault in APaintResult; if not SkipDefault then // do default paint by unknown magic QAbstractItemDelegate_paint(FOldDelegate, painter, Option, index); + + // issue #27315 + if cdrNotifyPostpaint in APaintResult then + TCustomListViewAccess(LCLObject).IntfCustomDraw(ATarget, cdPostPaint, ItemIndex, SubItemIndex, ACustomState, @R); + finally TCustomListView(LCLObject).Canvas.Handle := TmpDC2; TQtDeviceContext(TmpDC1).Free;