Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. General talk
  3. Qt 6
  4. QRhi software-rendering example
Forum Updated to NodeBB v4.3 + New Features

QRhi software-rendering example

Scheduled Pinned Locked Moved Unsolved Qt 6
2 Posts 2 Posters 766 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.
  • S Offline
    S Offline
    skinkie
    wrote on last edited by
    #1

    I am trying to find a working example where QSGRendererInterface::Software independent of any OpenGL requirement would work for offscreen rendering.

    m_renderControl = new QQuickRenderControl();
    m_quickWindow = new QQuickWindow(m_renderControl);
    m_quickWindow->setGraphicsApi(QSGRendererInterface::Software);
    
    QImage qimage = QImage(1920, 1080, QImage::Format_ARGB32);
    QQuickRenderTarget renderTarget = QQuickRenderTarget::fromPaintDevice(&qimage);
    m_quickWindow->setRenderTarget(renderTarget);
    
    m_renderControl->beginFrame();
    m_renderControl->render();
    m_renderControl->endFrame();
    

    I end up with:

    QQuickRenderControl: No QRhi in beginFrame()
    QQuickRenderControl: No QRhi in endFrame()
    
    1 Reply Last reply
    0
    • S skinkie referenced this topic on
    • Q Offline
      Q Offline
      QKelteseth
      wrote last edited by
      #2

      So the solution here is not to use QRhi but the OpenGL api and setting

      QCoreApplication::setAttribute(Qt::AA_UseSoftwareOpenGL);
      

      to force LLVMPipe OpenGL software rendering

      https://doc.qt.io/qt-6/qtquick-rendercontrol-rendercontrol-rhi-example.html

      image.png

      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