Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Draw a widget on top af everything else
QtWS25 Last Chance

Draw a widget on top af everything else

Scheduled Pinned Locked Moved Unsolved General and Desktop
widgetslayoutsdrawwindowflags
1 Posts 1 Posters 894 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    MoaMoaK
    wrote on 13 Sept 2017, 11:54 last edited by
    #1

    Hi everyone,
    I would like to draw a widget (let's call it widget A) on top of another one (widget B) (a sort of transparent bar with buttons) and that stays on top and is still attached to the main window (move with it and act like it was in a layout).
    Widget A is a QQuickWidget (but I'm not sure it's relevant here as it can also be a QWidget containing a QQuickWidget).
    The widget B which is quite complex, I haven't written it myself, and is not painted directly by qt. It's repainted frequently (like 30 times/sec) by the GPU with different context (opengl/directx/...) depending on the platform (still trying to understand how exactly it works but I can ask for detailed explanation if necessary).
    I've played with various parameters of setWindowFlags to do so but I've always been in one of three following scenarios :

    • The widget A is drawn behind the widget B so you can never see it
    • The widget A is drawn over the widget B but as soon as the widget B is redrawn, it gets over it. I can get a glimpse at the widget when resizing the window to force widgets to be redrawn but that's all. I don't think redrawing everything multiple times per second is a valuable option in term of performance.
    • The widget A is in a separate window (frameless or not) which is strictly on top of the widget B (that part is perfect, no need to redraw every so often). But as the widget is in a separate window, it doesn't stick with the main window. Like when moved on the screen, it stays in the same place.

    If you have any solution, even a dirty hack, i would be happy, because I've been stuck on that point for the last two days.

    1 Reply Last reply
    0

    1/1

    13 Sept 2017, 11:54

    • Login

    • Login or register to search.
    1 out of 1
    • First post
      1/1
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved