[Interest] Qt5.6 Qt3D* module names?

Sean Harmer sean.harmer at kdab.com
Mon Dec 21 14:24:17 CET 2015


On Monday 21 December 2015 13:05:19 Brett wrote:
> Looks like “3drenderer” is now “3drender”.

Yes that is correct.

> I changed that and lots of
> errors. Appears lots of changes to the underlying method names, classes,
> etc.

The modules now match between C++ and QML in terms of namespaces. So whereas 
before all C++ classes were in the Qt3D namespace, they are now in Qt3DCore, 
Qt3DRender, Qt3DInput or Qt3DLogic. The corresponding QML imports are 
Qt3D.Core, Qt3D.Render, Qt3D.Input and Qt3D.Logic.

If you are using C++, the easiest way to adapt is to remove any Qt3D:: 
namespace prefixes and add using Qt3DCore etc to those compilation units.

If you are using QML, just search/replace Qt3D.Renderer/Qt3D.Render.

The other main location of API changes from 5.5 is in the Qt3DCore::QTransform 
(Transform in qml) component. Instead of building your transform up from a 
list of "sub" transforms the QTransform component itself now does much more.

If wanting to apply transforms in the common scale, rotate, translate (SRT) 
ordering (i.e. an simple affine transformation) then you can directly set the 
scale/scale3d, rotation, and translation properties. There are helpers on 
QTransform (invokable from qml) to help you construct rotation quaternions.

If you want to do something more complex, such as rotating about a point or 
some other combination of affine transformations (which at the end of the day 
still results in another affine transformation) then you can set the matrix 
property of Qt3DCore::QTransform.

How you do this again depends upon your needs. If rotating about a point, 
there is another invokable helper on Qt3DCore::QTransform. If you want 
something else then you can build up your own QMatrix4x4 for the matrix 
property as shown in many of the examples. This last option is completely 
analogous to the older api that is now removed but saves creating a lot of 
QObjects.

In the majority of cases the new transform API results in far less code being 
required and also opens the door for some other features we'd like to add in 
next year (updates to frontend transformations from the backend aspects).

There's also a bunch of other new stuff in 5.6 such as a mostly complete input 
aspect (remaining missing bits will come with 5.7); thanks to Laszlo, we now 
have much better support for lights; we now support instanced rendering for 
drawing potentially many 10's of thousands of copies of a mesh. Plus the usual 
pile of bug fixes.

This is still a tech preview although we don't expect the API to change much 
at all between 5.6 and 5.7. The main points being worked on are the top level 
"entry points" and convenience classes.

> Is there an upgrade guide for Qt3d and all the changes somewhere?

The above or git log :)

If you have any more questions, feel free to fire them here.

Cheers,

Sean

> 
> > On Dec 21, 2015, at 12:50 PM, Brett (Gmail) <brettbibby at gmail.com> wrote:
> > 
> > Hi,
> > Did the module names change for Qt3d in 5.6?
> > 
> > My 5.5 project has:
> > 
> > QT += core gui sql 3dcore 3drenderer 3dinput
> > 
> > But now I’m getting "Unknown module(s) in QT: 3drenderer” type of errors
> > when I try to compile. I see the frameworks in clang_64/lib so they got
> > installed but not getting found.
> > 
> > Thanks,
> > Brett

--
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