Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Why QQuickItem geometry uses floating point units?
Qt 6.11 is out! See what's new in the release blog

Why QQuickItem geometry uses floating point units?

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
3 Posts 3 Posters 897 Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    Eligijus
    wrote on last edited by
    #1

    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?

    raven-worxR 1 Reply Last reply
    0
    • E Eligijus

      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?

      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      @Eligijus
      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.

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      2
      • ? Offline
        ? Offline
        A Former User
        wrote on last edited by
        #3

        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.

        1 Reply Last reply
        2

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved