PDA

View Full Version : Hide the border of a tool bar?



Dark_Tower
15th April 2006, 12:33
Hi, I need to hide the border of a tool bar and only show its actions because I have only 4 actions in the tool bar and it ocupies all the avaiable space. I've tried not using the tool bar and use flat buttons but the problem is that when the mouse is under the buttons its border is not painted (differing with the QActions in a tool bar). Anybody knows if it's possible in a simple way? I know that a possible solution could be reimplementig the paintEvent of the tool bar but it's a bit "hard"... ;)

PD: I also want to know if it's possible to center the actions in the tool bar

wysota
15th April 2006, 23:27
But which "border" do you mean? The handle or "separators" around the actions (the ones above and below actions for a horizontal orientation of a toolbar)? I don't think you'll be able to get rid of them without reimplementing some stuff.

Brandybuck
16th April 2006, 01:09
If you don't want the toolbar functionality, and just a place to put toolbuttons, you might want to consider just a plain widget, and use a layout to put it where you want.

Dark_Tower
16th April 2006, 08:40
Ok I will take in account, thanks wysota and Brandybuck. All that I want is have a button that acts like an action in a tool bar: if the mouse is not under the button, its border is hidden. And when the mouse is under the button, the border is shown (it's not the "flat" property). But I don't know if it's possible...

patrick772goh
20th August 2007, 08:02
I am also wish to hide the border of the toolbar. Can you help me? Thanks.

Erlendhg
20th August 2007, 13:11
Isn't that the QToolButton::setAutoRaise(true) call you are looking for?
It makes QToolButtons act just like buttons on a toolbar (the "border" is hidden, but when the mouse hovers the button, the border is drawn, and you get a "raise" effect) :)

wysota
20th August 2007, 14:04
The buttons on a toolbar are QToolButtons :)