Qt World Summit: Register Today!

Why QQuickItem geometry uses floating point units?

  • Hi,

    Why QQuickItem width, height, x , y is a floating point units? It's not like Qt can somehow paint one third of a pixel.
    I'm asking because I'm porting QWidget application to QtQuick. QWidget application uses a lot of QPoint variables with widget interaction.
    So does rewriting all those variables to QPointF would be beneficial or should I just use QPointF::toPoint?

  • Moderators

    because - at least in one aspect it is - like in the QGraphics framework it's possible to apply transformations, which do not map to pixels in almost all cases.
    Using non-float types would result in very unprecise results.

  • Quick sits on top of OpenGL (at least it was tied to it when it was new), and the fundamental type for coordinates is float in the GPU world.

Log in to reply