I would like to add a button to QDockWidget's title bar. I know there is a setTitleBarWidget() function but with it I need to rewrite all the style for the title bar. The default style (like "Dock 2" in the picture), with close button, colors, etc, suit me very well. How can I add a button without overriding the default QDockWidget's title bar style ?
self.dockWidgetWord.setTitleBarWidget(widgetContainer)
style = ? # is the something I can put here ?
self.dockWidgetWord.setStyle(style)
I also tried to create a widget as child of the one returned by titleBarWidget() but it does not work either.