PDA

View Full Version : QDockWidget styling



tipote
11th May 2010, 09:36
Dear Qt enthusiasts,

I am writing an application for visualization of audio signals, in "real-time". The interface is built with a central visualization widget, and additional visualization widgets are inside QDockWidgets.

I have customized the QDockWidget titlebar with a QComboBox for select the visualization plugin, and a QToolButton to display a settings dialog, in addition to the standards undock&close buttons.

Now my problem is that this custom titlebar does not melt smoothly with the QDockWidget frame, which seems to come from the global Qt style. On Linux it's particularly visible: the Oxygen style adds a frame with rounded corners, and an extra space on the right of the titlebar. You can see what it gives in the attached screenshot.

So how can I define my own QDockWidget border ? QSS does not seem to help here (QWidget{border:none} or QFrame{border:none} have no effect on QDockWidgets). Is there another way to achieve that ?

Thank you very much for your help.

Timothée

tipote
12th May 2010, 13:02
Well, replying to myself:

Looks like there is no control on this, at least with the Oxygen style. In kdebase/workspace/kstyles/oxygen/oxygenstyle.h I can find that the QDockWidget decorations are drawn using an event filter (eventFilterDockWidget), and I can't think of an easy way to tweak that. Qt docs and some web pages mention Proxy Styles, but this technique does only apply to built-in styles, and the Oxygen one, for example, is a plugin, so that won't work either.

I guess I'll abandon QDockwidgets and their nice features (dockable - obviously - but floatable at the same time, nice animations when they are moved with the mouse, etc.), and use a bunch of QSplitter's instead, to reproduce similar layouts...

junix
28th May 2010, 22:13
Hi tipote,

How could you use this widgets style?
It's nice.
Congratulations.