[Development] Moving math3d classes from GUI to CORE

Konstantin Shegunov kshegunov at gmail.com
Thu Jan 23 13:37:36 CET 2020


Hi.

On Thu, Jan 23, 2020 at 10:56 AM Jaroslaw Kobus <Jaroslaw.Kobus at qt.io>
wrote:

> one of the tasks planned for Qt 6 is to move the math3D classes from QtGui
> to QtCore (https://bugreports.qt.io/browse/QTBUG-46653).
>

Why? My personal experience leads me to believe that the transformations
and such aren't really suited for general-purpose work (i.e. gui
unrelated), so I really don't see the point of going through the motions.
This is what we also advise people in the forums - if you want to do math
on vectors (unrelated to the painting), do it manually/pull a dep or w/e.

These may be interesting for you to take a look at:
https://bugreports.qt.io/browse/QTBUG-75146, which triggered:
https://bugreports.qt.io/browse/QTBUG-75879
leading to:
https://codereview.qt-project.org/c/qt/qtbase/+/261770 and
https://codereview.qt-project.org/c/qt/qtbase/+/261715
none of which seem to be possible, or wanted.


> 1. QMatrix4x4 class (to be moved into Core) uses QTransform class (which
> is currently a part of Gui lib, inside paining dir):

2. Old QMatrix class, which is to be ultimately deprecated in Qt 5.15, is a
> field member of:


I'll pass here, I don't have an opinion on that.


> 3. QMatrix inside QVariant / QMetaType. If we are going to remove QMatrix
> type in Qt 6, we need to remove it from QMetaType::Type enum (current value
> = 79). Then we create a gap at position 79. We may adjust the values for
> other types (like instead of 80 for QTransform we move it to 79, and so
> on). However, I wonder whether it is going to work in cases like data
> streaming (e.g. someone stored the variant using Qt 5.15 and now he want to
> read it in Qt 6). Or should we just leave the gap at 79?
>

I'd say leave the gap, seems more prudent. My concern you spelled
explicitly already - if indeed someone uses a stream that comes from Qt 5.x
but is read in Qt 6.x then reordering the types means breaking the stream
for no obvious reason.


> 4. Where to place math3d classes? Currently they are in gui/math3d. Should
> they go to corelib/math3d, or should they be added into some already
> existing dir, like corelib/tools?
>

I think it's best to leave them in the gui module.
<https://lists.qt-project.org/listinfo/development>

Kind regards,
Konstantin.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20200123/c8e894f8/attachment.html>


More information about the Development mailing list