Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7964485
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T05:54:10+00:00 2026-06-04T05:54:10+00:00

The Qt documentation says: typedef qint8 Typedef for signed char. This type is guaranteed

  • 0

The Qt documentation says:

typedef qint8

Typedef for signed char. This type is guaranteed to be 8-bit on all platforms supported by Qt.

typedef qint16

Typedef for signed short. This type is guaranteed to be 16-bit on all platforms supported by Qt.

typedef qint32

Typedef for signed int. This type is guaranteed to be 32-bit on all platforms supported by Qt.

typedef qint64

Typedef for long long int (__int64 on Windows). This type is guaranteed to be 64-bit on all platforms supported by Qt.

The types are defined in qglobal.h as follows:

/*
   Size-dependent types (architechture-dependent byte order)
   Make sure to update QMetaType when changing these typedefs
*/
typedef signed char qint8;         /* 8 bit signed */
typedef unsigned char quint8;      /* 8 bit unsigned */
typedef short qint16;              /* 16 bit signed */
typedef unsigned short quint16;    /* 16 bit unsigned */
typedef int qint32;                /* 32 bit signed */
typedef unsigned int quint32;      /* 32 bit unsigned */
//....

But I’m wondering how (for example) qint32 can always be 32 bits long when there is no guarantee that int is 32 bits long. As far as I know, on 64-bit architectures ints are (or at least can be) 64 bits long. [EDIT: I was wrong. See comments below.]

How can they guarantee the sizes? Why don’t they use stdint (and __intN on windows platforms)?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T05:54:11+00:00Added an answer on June 4, 2026 at 5:54 am

    How can they guarantee the sizes?

    They target specific platforms that they know that the above definitions work. Qt doesn’t care for other platforms and other platforms don’t care about Qt. So, it won’t always work. But where it won’t work neither will Qt.

    Why don’t they use stdint (and __intN on windows platforms)?

    Sometimes it’s simpler to maintain the typedefs in <stdint.h> for your own project rather than conditionally including the standard header on platforms that have it and still maintaining a fallback for platforms that don’t (e.g. VS2005).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The documentation says to use: $(input[type='checkbox']).bind( change, function(event, ui) { But I want to
The documentation says you can use $.noConflict() like this: jQuery.noConflict(); (function($) { $(function() {
The documentation says: http://docs.djangoproject.com/en/dev/ref/settings/#time-zone Note that this is the time zone to which Django
Java documentation says: As a matter of style, programmers should always use this annotation
The MSDN documentation says that public class SomeObject { public void SomeOperation() { lock(this)
The Same Origin Policy Documentation says this: There is one exception to the same
SimpleIni Documentation says wchar_t is supported but I don't understand how to use it.
The documentation says: show This event is emitted when the panel is shown. So
Shred documentation says shred is not guaranteed to be effective (See bottom). So if
The documentation says: - (void)reset Returns the receiver to its base state. Discussion All

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.