Results 1 to 13 of 13

Thread: how to copy QString content into array

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: how to copy QString content into array

    ...and the other is not even a string. To copy the content of QString into the buffer, you'll need something like this:
    Qt Code:
    1. char name[50];
    2. QString str = "xxx";
    3. strncpy(name, str.toLocal8Bit().constData(), 50);
    To copy to clipboard, switch view to plain text mode 

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

    eric (15th November 2007)

Similar Threads

  1. how to copy part of QString to anothe QString
    By nass in forum Qt Programming
    Replies: 1
    Last Post: 26th March 2007, 19:05
  2. Problem in converting QString to QChar array?
    By KaKa in forum Qt Programming
    Replies: 2
    Last Post: 19th March 2007, 00:38
  3. Convert from iso-8859-1 to... Something else :-)
    By Nyphel in forum Qt Programming
    Replies: 4
    Last Post: 7th March 2007, 17:59

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.