Results 1 to 10 of 10

Thread: Conversion from QString to quint32

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #8
    Join Date
    May 2010
    Location
    Romania
    Posts
    1,021
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows Android
    Thanks
    62
    Thanked 260 Times in 246 Posts

    Default Re: Conversion from QString to quint32

    Qt Code:
    1. QString testInt = "4294967295"; //biggest value
    2. quint32 test = testInt.toUInt();
    3.  
    4. str = "FF";
    5. bool ok;
    6.  
    7. quint32 hex = str.toUInt(&ok, 16); // hex
    8. quint32 dec = str.toUInt(&ok, 10); // dec
    9.  
    10. qDebug() << test;
    11. qDebug() << hex;
    12. qDebug() << dec;
    To copy to clipboard, switch view to plain text mode 

  2. The following user says thank you to Zlatomir for this useful post:

    sksingh73 (2nd July 2010)

Similar Threads

  1. BSTR to QString Conversion
    By bismitapadhy in forum Qt Programming
    Replies: 9
    Last Post: 16th February 2012, 12:51
  2. Qstring conversion UTF8
    By harleyskater in forum Qt Programming
    Replies: 12
    Last Post: 25th June 2010, 11:59
  3. QString Unicode conversion
    By user_mail07 in forum Qt Programming
    Replies: 5
    Last Post: 15th April 2010, 22:16
  4. char* to QString: conversion
    By abghosh in forum Qt Programming
    Replies: 9
    Last Post: 8th March 2010, 09:32
  5. QString iso 8859-1 conversion
    By mattia in forum Newbie
    Replies: 11
    Last Post: 21st January 2008, 14:17

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.