Results 1 to 2 of 2

Thread: QString in bytes

  1. #1
    Join Date
    Jan 2008
    Location
    Brasil
    Posts
    131
    Thanks
    18
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QString in bytes

    Hi,

    How do I know how many bytes or KB got into a QString?
    Thanks,

    Marcelo E. Geyer

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QString in bytes

    Query for QString::size() and multiply by two. I don't know what you are trying to do but if you are asking about kilobytes then you probably want to use QByteArray instead of QString. The latter is only for textual data as it gets converted into Unicode. Unless of course you wish to store such large texts in QString but this is probably a bad idea.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. How to get an array of bytes from a DLL?
    By srohit24 in forum Qt Programming
    Replies: 5
    Last Post: 22nd April 2009, 16:11
  2. Replies: 4
    Last Post: 31st January 2008, 20:44
  3. How many bytes did i send?
    By yagabey in forum Qt Programming
    Replies: 3
    Last Post: 24th January 2008, 10:12
  4. How to construct Image from Bytes
    By vishal.chauhan in forum Qt Programming
    Replies: 2
    Last Post: 29th January 2007, 05:41
  5. is ther any function which use int 8 bytes
    By jyoti in forum General Programming
    Replies: 3
    Last Post: 12th December 2006, 10:45

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.