Results 1 to 9 of 9

Thread: problem with binary writting a QString array

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Join Date
    Mar 2008
    Location
    Kraków, Poland
    Posts
    1,540
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanked 284 Times in 279 Posts

    Default Re: problem with binary writting a QString array

    First : sizeof(QString) is NOT string length, this is a size of object. Code for writing should be :
    Qt Code:
    1. for( int i = 0; i <125; i++ )
    2. namef.write(names.toAscii());
    To copy to clipboard, switch view to plain text mode 
    Second : strings have different lengths. If you save them without any separator how you split them later?

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

    Alex22 (19th December 2015)

Similar Threads

  1. Replies: 5
    Last Post: 16th November 2015, 20:18
  2. Replies: 6
    Last Post: 30th September 2015, 20:20
  3. QString to Binary Problem
    By onder_11 in forum Qt Programming
    Replies: 5
    Last Post: 22nd October 2012, 02:43
  4. Cast QString array to std::string array
    By Ishtar in forum Newbie
    Replies: 4
    Last Post: 15th July 2011, 08:28
  5. Problem in converting QString to QChar array?
    By KaKa in forum Qt Programming
    Replies: 2
    Last Post: 19th March 2007, 00:38

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.