Results 1 to 5 of 5

Thread: setting QToolbar "hover" event

  1. #1
    Join Date
    May 2007
    Location
    Lublin, Poland
    Posts
    345
    Thanks
    40
    Thanked 8 Times in 4 Posts
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default setting QToolbar "hover" event

    Hi guys,

    I would like to change toolbar's actions(buttons) background to red when action(button) gets mouseOver event. How to do this using style sheets?

    QToolbar:: /*???*/
    {
    background: red;
    }

    Thanks.
    Qt allows you to use everything you want
    wysota
    --------------------------------------------------------------------------------
    #if defined(Q_OS_UNIX) && defined(QT_DEBUG)
    abort(); // trap; generates core dump
    #else
    exit(1); // goodbye cruel world
    #endif

  2. #2
    Join Date
    Jun 2006
    Location
    Vietnam
    Posts
    59
    Thanks
    17
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: setting QToolbar "hover" event

    Implement 2 functions: enterEvent & leaveEvent.

  3. #3
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: setting QToolbar "hover" event

    Its
    QToolBar:hover
    {
    }

    You can refer the Stylesheet example in QtDemo->Widgets

  4. The following user says thank you to aamer4yu for this useful post:

    maverick_pol (5th April 2008)

  5. #4
    Join Date
    May 2007
    Location
    Lublin, Poland
    Posts
    345
    Thanks
    40
    Thanked 8 Times in 4 Posts
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: setting QToolbar "hover" event

    QToolBar:hover, as predicted, works on the "toolbar" background not for the actions(actions' buttons). So this is not really what I need.

    Kacper
    Qt allows you to use everything you want
    wysota
    --------------------------------------------------------------------------------
    #if defined(Q_OS_UNIX) && defined(QT_DEBUG)
    abort(); // trap; generates core dump
    #else
    exit(1); // goodbye cruel world
    #endif

  6. #5
    Join Date
    Oct 2007
    Posts
    78
    Thanks
    1
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: setting QToolbar "hover" event

    It would appear

    Qt Code:
    1. QToolButton:hover{}
    To copy to clipboard, switch view to plain text mode 

    or whatever button type you are using would be what you need for your style sheet.

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.