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] Max/Min values of custom simple types (quint32, qlong, qint64, etc...)

[SOLVED] Max/Min values of custom simple types (quint32, qlong, qint64, etc...)

Scheduled Pinned Locked Moved General and Desktop
5 Posts 3 Posters 17.5k Views
  • 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.
  • A Offline
    A Offline
    aureshinite
    wrote on last edited by
    #1

    What is the best way to get the max/min values of the simple types defined by Qt?
    Is there any specify macros or constants for that??

    Right now I am using my own byte operations .

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andre
      wrote on last edited by
      #2

      These types are defines for the basic standard types on the platform, and so you can use the standard numeric limits. That makes this really a C++ question, and not hard to "find":http://lmgtfy.com/?q=C+++numeric+limits...

      1 Reply Last reply
      0
      • A Offline
        A Offline
        aureshinite
        wrote on last edited by
        #3

        Didn't want to use compiler\platform specific macros but I guess can create portables ones in this case.

        1 Reply Last reply
        0
        • B Offline
          B Offline
          baysmith
          wrote on last edited by
          #4

          @
          #include <limits>

          std::numeric_limits<quint32>::min();
          std::numeric_limits<quint32>::max();
          std::numeric_limits<qlong>::min();
          std::numeric_limits<qlong>::max();
          std::numeric_limits<qint64>::min();
          std::numeric_limits<qint64>::max();
          @

          Nokia Certified Qt Specialist.

          1 Reply Last reply
          0
          • A Offline
            A Offline
            aureshinite
            wrote on last edited by
            #5

            Thanks Bradley!!! I guess that was what Andre implied but I was unaware of these functions.

            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