From bf0aed0fe78a4014f96b75d7d61d94573c389046 Mon Sep 17 00:00:00 2001 From: san Date: Wed, 9 Dec 2009 15:14:35 +0000 Subject: [PATCH] Draw custom QDockWidget title bar widgets using the style --- src/Style/Style_Salome.cxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Style/Style_Salome.cxx b/src/Style/Style_Salome.cxx index a9446c7c4..4bd429fb8 100644 --- a/src/Style/Style_Salome.cxx +++ b/src/Style/Style_Salome.cxx @@ -673,7 +673,11 @@ void Style_Salome::drawControl( ControlElement ce, const QStyleOption* opt, bool floating = false; int menuOffset = 0; //used to center text when floated QColor inactiveCaptionTextColor = opt->palette.color( QPalette::HighlightedText ); - const QDockWidget *dockWidget = qobject_cast(w); + QDockWidget* dockWidget = qobject_cast(const_cast(w)); + // A little trick to handle custom title bar widgets here, of course if + // the parent is QDockWidget + if (w && !dockWidget) + dockWidget = qobject_cast(w->parentWidget()); //Titlebar gradient if (dockWidget) { if ( dockWidget->isFloating() && dwOpt->movable) { -- 2.39.2