Results 1 to 2 of 2

Thread: Child widgets disturb style sheet

  1. #1
    Join Date
    Jan 2009
    Location
    Germany
    Posts
    387
    Thanks
    101
    Thanked 15 Times in 15 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Child widgets disturb style sheet

    Hello,

    Take a QFrame, define the rigth styles for it and then you get a nice visual effect, when the mouse hovers over the frame.

    Qt Code:
    1. border-width: 1px;
    2. border-style: solid;
    3. }
    4.  
    5. QFrame:hover {
    6. border-width: 2px;
    7. }
    To copy to clipboard, switch view to plain text mode 

    The problem is, if you fill the QFrame with some children widgets that cover the frame, the mouse will not trigger the QFrame:hover style. Any ideas what I can do about this?

  2. #2
    Join Date
    Oct 2008
    Location
    Beijing China
    Posts
    77
    Thanks
    21
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Child widgets disturb style sheet

    I don't think the parent can receive the hover event when any child responses it. So the frame won't change.

    Install an event filter might be useful, i suppose.

Similar Threads

  1. QToolButton and Style sheet
    By desch in forum Qt Programming
    Replies: 8
    Last Post: 1st December 2007, 08:38
  2. Qt 4.3 Style sheet, new features
    By Angelo Moriconi in forum Qt Programming
    Replies: 2
    Last Post: 12th June 2007, 15:22

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
  •  
Qt is a trademark of The Qt Company.