diff --git a/lcl/interfaces/qt/qtwidgets.pas b/lcl/interfaces/qt/qtwidgets.pas index 7ac8e643d9..dcbe61d8fd 100644 --- a/lcl/interfaces/qt/qtwidgets.pas +++ b/lcl/interfaces/qt/qtwidgets.pas @@ -820,6 +820,7 @@ type procedure modelIndex(retval: QModelIndexH; row, column: Integer; parent: QModelIndexH = nil); function visualRect(Index: QModelIndexH): TRect; + procedure SetColor(const Value: PQColor); override; procedure setEditTriggers(ATriggers: QAbstractItemViewEditTriggers); procedure setSelectionMode(AMode: QAbstractItemViewSelectionMode); procedure setSelectionBehavior(ABehavior: QAbstractItemViewSelectionBehavior); @@ -8469,6 +8470,19 @@ begin QAbstractItemView_visualRect(QAbstractItemViewH(Widget), @Result, Index); end; +procedure TQtAbstractItemView.SetColor(const Value: PQColor); +var + Palette: QPaletteH; +begin + Palette := QPalette_create(QWidget_palette(Widget)); + try + QPalette_setColor(Palette, QPaletteBase, Value); + QWidget_setPalette(Widget, Palette); + finally + QPalette_destroy(Palette); + end; +end; + procedure TQtAbstractItemView.setEditTriggers( ATriggers: QAbstractItemViewEditTriggers); begin