Results 1 to 3 of 3

Thread: QDockWidget styling

  1. #1
    Join Date
    Jun 2009
    Posts
    4
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Question QDockWidget styling

    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
    Attached Images Attached Images
    Last edited by tipote; 11th May 2010 at 11:14. Reason: Remove forgotten draft sentence...

  2. #2
    Join Date
    Jun 2009
    Posts
    4
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QDockWidget styling

    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...

  3. #3
    Join Date
    Oct 2009
    Location
    Rio de Janeiro - Brazil
    Posts
    19
    Thanks
    4
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QDockWidget styling

    Hi tipote,

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

Similar Threads

  1. Styling QComboBox
    By martinn in forum Qt Programming
    Replies: 1
    Last Post: 2nd March 2010, 21:55
  2. Styling QDockWidget's titlebar buttons
    By THRESHE in forum Qt Programming
    Replies: 7
    Last Post: 16th July 2008, 13:30
  3. Styling a QTabWidget
    By chuckshaw in forum Qt Programming
    Replies: 1
    Last Post: 18th February 2008, 21:17
  4. QComboBox styling
    By Oleg in forum Qt Programming
    Replies: 3
    Last Post: 26th November 2007, 00:48
  5. Styling a QComboBox
    By Enygma in forum Qt Programming
    Replies: 6
    Last Post: 23rd August 2007, 11:22

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.