Results 1 to 3 of 3

Thread: QToolButton outside of QToolBar

  1. #1
    Join Date
    Dec 2009
    Posts
    49
    Thanks
    3
    Thanked 2 Times in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default QToolButton outside of QToolBar

    I'm stuck with Qt 4.8.6 for now.

    I'm using QToolButton controls without placing them inside a QToolBar. This seems to work well, except for one thing: icons for the "active" (hover) state are not shown. In other words, the icon of the QToolButton doesn't change when the mouse cursor is hovering above it. It works fine if I place the QToolButton inside a QToolBar, but in my case the styling of the QToolBar is undesirable and it doesn't look like I'm fully able to cancel it.

    Any help would be very much appreciated!

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    4,481
    Thanks
    252
    Thanked 711 Times in 701 Posts
    Qt products
    Qt5
    Platforms
    Windows Android

    Default Re: QToolButton outside of QToolBar

    The toolbar most likely has a slot that is connected to the QAction::hover() signal, and it is in this slot where the button's state icons are changed.

  3. #3
    Join Date
    Dec 2009
    Posts
    49
    Thanks
    3
    Thanked 2 Times in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QToolButton outside of QToolBar

    Thanks for your answer. This is intriguing! Does that mean I could somehow connect the QAction's hover signal to the QToolButton and manually change the its icon?


    Added after 7 minutes:


    It seems like enabling autoraise on the QToolButton solves the problem!
    Last edited by dictoon; 15th February 2016 at 22:23.

Similar Threads

  1. Replies: 2
    Last Post: 10th October 2013, 15:08
  2. Unable to add QToolButton to QToolbar on QWidget
    By rawfool in forum Qt Programming
    Replies: 0
    Last Post: 17th August 2012, 10:52
  3. Hiding a QToolButton in a QToolBar
    By elcuco in forum Qt Programming
    Replies: 3
    Last Post: 24th November 2009, 20:35
  4. drag and drop QToolButton in QToolBar
    By NBilal in forum Qt Programming
    Replies: 1
    Last Post: 28th December 2008, 20:11
  5. Need help with QToolButton
    By Seema Rao in forum Qt Programming
    Replies: 2
    Last Post: 22nd April 2006, 14:55

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.