Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. General talk
  3. Brainstorm
  4. Using QWindowSurface for a heads up display
Forum Updated to NodeBB v4.3 + New Features

Using QWindowSurface for a heads up display

Scheduled Pinned Locked Moved Brainstorm
1 Posts 1 Posters 2.2k Views 1 Watching
  • 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.
  • J Offline
    J Offline
    jsprenkle
    wrote on last edited by
    #1

    Good morning,

    I'm implementing a heads up display (a "HUD") that's overlaid on a 3d rendered scene. I'd like to be able to display and interact with Qt widgets in the overlaid HUD. I need some advice/help to get moving again.

    I've been able to create a bitmap that shared between a QImage and the 3d code. I can render controls to the bitmap using the render() method on the controls and they display nicely in the HUD. I have to manually manage and repaint these controls and there's no way to use a mouse to manipulate them.

    My first attempt:
    I created a custom QWindowSurface that renders to my shared bitmap. QImage is a valid QPaintDevice.
    Then I create a tree of controls that use that surface. This doesn't seem to work.
    The methods in the Surface are never called.

    Any suggestions?

    • I'd like to be able to send mouse events to these controls so I can drag them around on the HUD.
    • I'd like them to manage their own repainting.
    • I'd like something Qt 5 compatible as I probably will switch
    • Might QGraphicsScene work for this? Can you add QWidgets to a QGraphicsScene?

    Environment:

    • Qt 4.7
    • Mingw-dtm

    Thanks

    1 Reply Last reply
    0

    • Login

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