[Interest] Render QQuickView into another window?

MaxEd max.savenkov at gmail.com
Fri Feb 7 19:40:47 CET 2014


This seems interesting. So, if QQuickRenderControl is public, the code 
to render QQuickWindow to other window would looks like that?

QQuickView view;
view.setSource( "form.qml" );

QWindow *pOtherWindow = QWindow::fromWinId( otherWindowId );
QOpenGLContext ctx;
ctx.makeCurrent( pOtherWindow );

QQuickRenderControl renderControl;
renderControl.initialize( &ctx );

renderControl.setWindow( &view );
renderControl.render();

I'm worried I'm trying to do the wrong thing, though. What I'm after is 
to use Qt Quick for UI alongside Allegro graphic library, i.e. render Qt 
Quick controls over 2d game scene rendered by Allegro. I had some 
success by rendering Allegro scene inside Qt's window in 
beforeRendering, as shown in "OpenGL under QML" example and QmlOgre, but 
I do not like this solution, because Allegro always creates its own 
window, and so I get two windows instead of one. Also, I would like to 
handle user input via Allegro, and it, of course, only receives events 
when they are coming through its own window. So, I would like to render 
Qt into Allegro window instead of the other way around.

07.02.2014 21:18, Gunnar Sletta пишет:
> It isn't really possible right now, but there is some progress. Have a look at the QQuickRenderControl which is part of https://codereview.qt-project.org/#change,76700
>
> The plan is to eventually make this public API.
>
> cheers,
> Gunnar
>
> On 07 Feb 2014, at 08:07, Max Savenkov <max.savenkov at gmail.com> wrote:
>
>> I want to render QQuickView contents to another, _non-Qt_ OpenGL window, preferably without showing QQuickView's own window. Is this possible in any way?
>> _______________________________________________
>> Interest mailing list
>> Interest at qt-project.org
>> http://lists.qt-project.org/mailman/listinfo/interest
>




More information about the Interest mailing list