Results 1 to 7 of 7

Thread: Hide the border of a tool bar?

  1. #1
    Join Date
    Jan 2006
    Posts
    105
    Thanks
    38
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Hide the border of a tool bar?

    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
    Last edited by Dark_Tower; 15th April 2006 at 12:37.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Hide the border of a tool bar?

    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.

  3. #3
    Join Date
    Mar 2006
    Location
    Mountain View, California
    Posts
    489
    Thanks
    3
    Thanked 74 Times in 54 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Hide the border of a tool bar?

    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.

  4. #4
    Join Date
    Jan 2006
    Posts
    105
    Thanks
    38
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Hide the border of a tool bar?

    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...
    Last edited by Dark_Tower; 16th April 2006 at 08:51.

  5. The following user says thank you to Dark_Tower for this useful post:

    patrick772goh (22nd August 2007)

  6. #5
    Join Date
    Jul 2007
    Posts
    9
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Hide the border of a tool bar?

    I am also wish to hide the border of the toolbar. Can you help me? Thanks.

  7. #6
    Join Date
    Nov 2006
    Posts
    29
    Thanks
    3
    Thanked 3 Times in 3 Posts

    Default Re: Hide the border of a tool bar?

    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)

  8. The following user says thank you to Erlendhg for this useful post:

    patrick772goh (22nd August 2007)

  9. #7
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Hide the border of a tool bar?

    The buttons on a toolbar are QToolButtons

  10. The following user says thank you to wysota for this useful post:

    patrick772goh (22nd August 2007)

Similar Threads

  1. Tool for web application?
    By cool_qt in forum General Programming
    Replies: 3
    Last Post: 9th December 2008, 09:21
  2. tool buttons on top of label
    By McKee in forum Qt Programming
    Replies: 5
    Last Post: 2nd November 2008, 16:07

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.