Results 1 to 2 of 2

Thread: Glass widget overlay on top of application

  1. #1
    Join Date
    May 2018
    Posts
    1
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Glass widget overlay on top of application

    I have a fully developed and finalized QT Application with user interface. For our users to have a simpler start into the software I would like to have a fully transparent widget on top of the application where I can give them advice on how to use it when they start the first time. I have created a custom widget by

    class GlassOverlay : public QWidget
    {
    Q_OBJECT

    public:
    GlassOverlay( QWidget* parent = 0 /*, Qt::WindowFlags f = 0*/ );
    void mousePressEvent(QMouseEvent *event);
    };

    In the constructor of GlassOverlay I defined

    this->setAttribute(Qt::WA_TransparentForMouseEvents, true );

    The Parent of the GlassOverlay instance is my MainWindow instance, and I automatically resize the GlassOverlay whenever the MainWindow resizes.

    How do I get the mouse and keyboard events through to my underlying application? WA_TransparentForMouseEvents does not seem to work properly. Probably because the events go to MainWindow and not to the childs of MainWindows. Any ideas

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Glass widget overlay on top of application

    Maybe you need the WA_ShowWithoutActivating flag as well?

    where I can give them advice on how to use it when they start the first time.
    Can't you use tool tips to accomplish the same thing? Or maybe you need a floating top-level window the can be moved away from the main window, but you can send it signals to indicate what the user has just done so you can give them instructions on the next step. This is probably very similar to what you are trying to do with the glas widget, but without all the problems with transparency and resizing.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

Similar Threads

  1. Replies: 4
    Last Post: 25th August 2015, 10:12
  2. Replies: 3
    Last Post: 11th March 2015, 03:21
  3. magnifying glass with qgraphicsview
    By pinkiP in forum Qt Programming
    Replies: 1
    Last Post: 15th November 2012, 16:47
  4. Layout (widget overlay)
    By whitefurrows in forum Qt Programming
    Replies: 3
    Last Post: 3rd July 2009, 23:54

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.