Results 1 to 4 of 4

Thread: Ignore all events from a widgets

  1. #1
    Join Date
    Jan 2007
    Location
    Paris
    Posts
    459
    Thanks
    98
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4 Qt5

    Default Ignore all events from a widgets

    Hey there,

    I have a parent widget containing a layout of widgets and a big raised transparent widget above everything : covering the entire area of the parent.

    Since this widget occupies the entire area the mouse events aren't propagated to the underneath widgets anymore.

    Since I'm only using the paintEvent of the raised widget, Is there a way to ignore every other single event and propagate them to the other widgets, without implementing a tedious filtering process.

  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: Ignore all events from a widgets

    I don't think you want to ignore every event... But if you do, reimplement event() for the widget and return false from it. What is the point of having such a transparent widget anyway? Maybe there are better ways to obtain the goal you want...

  3. #3
    Join Date
    Jan 2007
    Location
    Paris
    Posts
    459
    Thanks
    98
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4 Qt5

    Default Re: Ignore all events from a widgets

    I'm using a clipPath on my main widget in order to display a rounded shaped list.

    like this :
    Qt Code:
    1. QRectF maskRect(rect().x(), rect().y(), rect().width(), rect().height() - 1);
    2.  
    3. setMask(QRegion(ZePainterController::get()->DrawRoundRect(maskRect, 2000 / maskRect.width(), 2000 / maskRect.height()).toFillPolygon().toPolygon()));
    To copy to clipboard, switch view to plain text mode 

    Problem is, it only takes a QRegion and QRegion isn't float based so the border is innacurate, as shown on the attached screen.



    So I thought I would use a raised widget just to display that border above the rest.

    It was yesterday night and I guess I was a bit tired . Maybe I could use some kind of graphic item insted ?

  4. #4
    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: Ignore all events from a widgets

    Why not use stylesheets?

Similar Threads

  1. Qt3 - Multiple transparent widgets
    By bythesea in forum Qt Programming
    Replies: 4
    Last Post: 11th September 2009, 11:24
  2. widgets behind hidden widgets not working
    By bpetty in forum Newbie
    Replies: 13
    Last Post: 7th September 2007, 20:23
  3. Performance in hiding/showing widgets
    By Paalrammer in forum Newbie
    Replies: 12
    Last Post: 14th February 2007, 18:57
  4. Ignore mouse events out of tree view
    By krishna.bv in forum Qt Programming
    Replies: 3
    Last Post: 27th December 2006, 11:24
  5. QStackerWidget and mouse events
    By high_flyer in forum Qt Programming
    Replies: 3
    Last Post: 25th April 2006, 19:25

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.