From c8ca7bf9e18317756ee72d3a39d28fa295765a4e Mon Sep 17 00:00:00 2001 From: Sergio Martins Date: Wed, 8 Sep 2021 19:35:54 +0100 Subject: [PATCH] Allow TitleBarWidget to honour the stylesheet background color --- src/private/widgets/TitleBarWidget.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/private/widgets/TitleBarWidget.cpp b/src/private/widgets/TitleBarWidget.cpp index 7c73b576..1b9a1413 100644 --- a/src/private/widgets/TitleBarWidget.cpp +++ b/src/private/widgets/TitleBarWidget.cpp @@ -236,6 +236,8 @@ void TitleBarWidget::paintEvent(QPaintEvent *) QPainter p(this); QStyleOptionDockWidget titleOpt; + titleOpt.init(this); + style()->drawPrimitive(QStyle::PE_Widget, &titleOpt, &p, this); titleOpt.title = title(); titleOpt.rect = iconRect().isEmpty() ? rect().adjusted(2, 0, -buttonAreaWidth(), 0) : rect().adjusted(iconRect().right(), 0, -buttonAreaWidth(), 0);