Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Get QML Item texture in QQuickFramebufferObject
Forum Updated to NodeBB v4.3 + New Features

Get QML Item texture in QQuickFramebufferObject

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 250 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.
  • P Offline
    P Offline
    PabloSkandal
    wrote on last edited by
    #1

    Hello,

    I have a QML item made from a QQuickFramebufferObject and I want to create another QQuickFramebufferObject that receives this QML item and applies some fancy post-processing effects. I know it's easy to apply effects with QML but I need to do it in C++ with custom OpenGL code.

    So far what I do is:

    class MyEffect: public QQuickFramebufferObject
    {
        Q_OBJECT
        Q_PROPERTY(QQuickItem* srcItem MEMBER m_ptSrcItem NOTIFY srcItemChanged)
    
        ...
    }
    

    and

    MyEffect {
        id: effect
    
        anchors.fill: parent
    
        srcItem: ShaderEffectSource {
            sourceItem: myCustomItem
            hideSource: true
        }
    }
    

    The problem is that when I try to receive the texture from the Item, I get this error "QQuickImage::textureProvider: can only be queried on the rendering thread of an exposed window" . I've been looking in the ShaderEffect source code and they seem to use QQuickItemPrivate to assign a window but I don't have access to that class.

    Any thoughts?

    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