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. QGraphicsView/QGraphicsScene with custom DirectX viewport
Forum Updated to NodeBB v4.3 + New Features

QGraphicsView/QGraphicsScene with custom DirectX viewport

Scheduled Pinned Locked Moved General and Desktop
2 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.
  • M Offline
    M Offline
    M Tims
    wrote on last edited by
    #1

    Hello,

    I am trying to set up DirectX rendering within Qt using a custom QWidget as the viewport for my QGraphicsView. To do this, I am setting up the DirectX device to render on the QGraphicsView::winId() - the HWND. I am also assigning a custom QGraphicsScene to the view, and I am overriding the QGraphicsScene::drawBackgound() routine to paint custom items to the scene.

    The problem I am facing seems to look like the QGraphicsScene's QPainter is drawing over the top of the DirectX device's rendering on the assigned HWND. I see a flickering effect where I see the two conflicting with each other when I resize my window (or the drawBackground() routine is called due to an update). Some sort of window composition problem maybe...

    Has anyone successfully been able to render with a DirectX device in conjunction with a QGraphicsView/QGraphicsScene where they can behave properly within the same window? If so, or you know how to do so, are there any steps that I am missing? Would you be willing to share some sample source code? I could share what I have so far if I could get someone to help troubleshoot.

    Background info: I'm developing an SDK which will allow the user to choose whether to render using OpenGL or DirectX. We want to give users the ability have that option. I have OpenGL working, of course, because the QGLWidget handles it correctly out of the box. I also want the user to have the flexibility to overlay items of top of the QGraphicsScene. This is why I'm attempting with the QGraphicsView/QGraphicsScene approach.

    Thanks all, and I appreciate any help that I can get.

    1 Reply Last reply
    0
    • M Offline
      M Offline
      M Tims
      wrote on last edited by
      #2

      Any advice?

      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