[Interest] Qt 5.4 Beta with Qt3D's QGLPainter

Sean Harmer sean.harmer at kdab.com
Mon Nov 24 11:32:33 CET 2014


Hi Jonathan,

On Monday 24 Nov 2014 13:00:42 Jonathan Poncelet wrote:
> Thanks for the info. Is it possible to use the development version of Qt3D
> at the current time? I’ll probably do without widget overlaying for now,
> but I really do need the functionality of the library because with my
> current time frame I won’t be able to re-write all those bits and pieces on
> my own from scratch.

Qt3D is mostly usable but it is still under very active development. We aim to 
keep it working and the API is mostly stable. New features are still being 
added though.

It is also still more work to use that the final version will be out of the 
box as we are missing some defaults materials.

You will need to use the dev branch of Qt3D (and also qtbase and 
qtdeclarative). If you need help getting started you can find us in the #qt-3d 
channel on irc.

Cheers,

Sean


> 
> Thanks,
> 
> Jonathan
> 
> On 22 Nov 2014, at 19:14, Sean Harmer <sean.harmer at kdab.com> wrote:
> > On 20/11/2014 16:32, Jonathan Poncelet wrote:
> >> Hi all,
> >> 
> >> I’m attempting to use the QGLPainter from Qt3D with Qt 5.4’s new
> >> QOpenGLWidget - I was originally making do with QGLWidget from the
> >> previous Qt version but I was running into trouble with putting widgets,
> >> buttons, etc. on top of the GL widget, which is something I need to do.
> >> I’m fairly familiar with the Qt3D library but not so much on the
> >> in-depth side, and right now if I call begin() on a QGLPainter I create
> >> in the QOpenGLWidget’s paintGL() function, I get the following messages
> >> output before the program crashes:
> >> 
> >> Attempt to cast non-window surface
> >> Attempt to activate GL window surface on bad context
> >> 
> >> I’ve tried various things - calling begin() and passing the widget’s GL
> >> context doesn’t have any effect, and the function won’t accept the
> >> context's QSurface as it’s expecting a QGLSurface. Is there any way to
> >> get QGLPainter         working with the new QOpenGLWidget, or will I
> >> have to stick with QGLWidget?> 
> > The old Qt3D is no longer being developed or maintained so please do not
> > use it. We are busy rewriting Qt3D but in it's current state it is not
> > possible to overlay widgets over a Qt3D window. This is in the feature
> > roadmap however.
> > 
> > It sounds like you just need to use QOpenGLWidget which allows compositing
> > widgets on top of the contained OpenGL content. Alternatively if you want
> > to overlay Qt Quick 2 UI on top of GL you can use the
> > QQuickWindow::beforeRendering() signal. See the openglunderqml example to
> > see how to do this.
> > 
> > Cheers,
> > 
> > Sean

-- 
Dr Sean Harmer | sean.harmer at kdab.com | Managing Director UK
Klarälvdalens Datakonsult AB, a KDAB Group company
Tel. Sweden (HQ) +46-563-540090, USA +1-866-777-KDAB(5322)
KDAB - Qt Experts - Platform-independent software solutions



More information about the Interest mailing list