Results 1 to 18 of 18

Thread: Click-through window

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Nov 2006
    Location
    Poland
    Posts
    35
    Thanks
    2
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11

    Lightbulb Re: Click-through window

    If anyone needs the same effect on X11, here is the code:

    Qt Code:
    1. #include <QX11Info>
    2. #include <X11/Xlib.h>
    3. #include <X11/extensions/shape.h>
    4.  
    5. MyWidget::MyWidget() : QWidget()
    6. {
    7. QRegion region;
    8. XShapeCombineRegion( QX11Info::display(), winId(), ShapeInput, 0, 0, region.handle(), ShapeSet );
    9. }
    To copy to clipboard, switch view to plain text mode 
    You need link X11 extensions library. You may add this to your .pro file:
    LIBS += -lXext

    Note that window's decoration will still be clickable, so you will probably have to get rid of it.

  2. #2
    Join Date
    Mar 2006
    Location
    belgium
    Posts
    14
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Click-through window

    window masks are different from the OP's question, see http://doc.qt.io/qt-5/qwidget.html#setMask-1
    when you click within the region, the event is not passed on to the underlying window

Similar Threads

  1. How to get mouse click events outside the Qt window?
    By montylee in forum Qt Programming
    Replies: 11
    Last Post: 13th July 2015, 21:55
  2. Replies: 0
    Last Post: 2nd January 2010, 08:58
  3. QWT right click window.. (Context Menu)
    By maveric in forum Qt Programming
    Replies: 4
    Last Post: 25th May 2008, 08:07
  4. close window when click on a label
    By sabeesh in forum Qt Programming
    Replies: 3
    Last Post: 29th October 2007, 07:35
  5. QTextBrowser - click on link - closes window
    By bruccutler in forum Newbie
    Replies: 2
    Last Post: 19th June 2007, 20:39

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.