PDA

View Full Version : How to create a QToolBar without a border?



dave
26th July 2010, 21:56
Hi all

Is it possible to create a QToolBar without a border and without using styles?

Lykurg
26th July 2010, 22:04
What border do you mean? Generally, you can subclass QToolBar and do the background painting yourself.

dave
26th July 2010, 22:13
What border do you mean?
like this: http://imgur.com/SkazA.jpg



Generally, you can subclass QToolBar and do the background painting yourself. Well, yes. I was looking for an easier way :).

Lykurg
26th July 2010, 22:18
What style do you use? You also can modify your style which is maybe easier by reacting on QStyle::PE_PanelToolBar. See also QProxyStyle.

dave
27th July 2010, 12:28
I'm dumb. Forgot all about stylesheets. So I finally went and used this:
tb->setStyleSheet("QToolBar { border: 0px }");. Works great.

Lykurg
27th July 2010, 12:37
Ok, I misunderstand your fist question, because I thought you don't want to use style sheets. :o

dave
27th July 2010, 16:31
Yes, I was pretty confused myself. I thought you could only change the look of a widget by subclassing QStyle.