Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [SOLVED]QPoint for double type
Forum Updated to NodeBB v4.3 + New Features

[SOLVED]QPoint for double type

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 3.8k Views 1 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.
  • Q Offline
    Q Offline
    QHamed
    wrote on last edited by
    #1

    hi.
    in Qt we have QpointF that gets and sets floating points.
    but how can I have double points?
    Is there any data type to support pionts as double?

    1 Reply Last reply
    0
    • Chris KawaC Offline
      Chris KawaC Offline
      Chris Kawa
      Lifetime Qt Champion
      wrote on last edited by Chris Kawa
      #2

      It uses floating point variables. It doesn't say it uses float specifically. double is also a floating point type.

      QPointF uses a qreal typedef. As the doc states qreal is a typedef for double unless you compiled Qt yourself with -qreal float configure switch.

      So by default QPointF is using doubles already.

      1 Reply Last reply
      1
      • Q Offline
        Q Offline
        QHamed
        wrote on last edited by
        #3

        Thanks Chris.

        1 Reply Last reply
        0
        • A Offline
          A Offline
          Asperamanca
          wrote on last edited by
          #4

          Note that qreal will be float by default on certain CPU architectures without floating point unit.

          1 Reply Last reply
          0

          • Login

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