PDA

View Full Version : Override QSplitter to draw new handle



grogan
21st September 2006, 13:41
Hi,
Using Qt4.1 is there a quick/easy way to override the drawing of a QSplitter handle. I would like to get rid of those little dots. I tried overriding the paintEvent which did not work, then I got to thinking that maybe I need to create a new QSplitterHandle and override it's paint event but that just seems like a lot of hard work for what I want to do.

Many thanks

jpn
21st September 2006, 13:51
Maybe a custom style overriding QStyle::drawControl(QStyle::CE_Splitter)?

grogan
26th September 2006, 02:24
Thanks for that, it worked but a little too well. I have three splitters on my GUI and would like to control the display of each individually. Any ideas on a per splitter basis?

Thanks

jpn
26th September 2006, 05:21
Well, you may install styles for individual widgets instead of the whole application. ;)

Resources:

QApplication::setStyle()
QWidget::setStyle()
ProxyStyle (http://wiki.qtcentre.org/index.php?title=QStyle) in QtCentre Wiki

grogan
27th September 2006, 03:40
Hi All,
I ended creating a specialised QSplitterHandle and overrode it's paintEvent.

Job done,

Thanks for your suggestions.

Best Regards,