Results 1 to 7 of 7

Thread: Conversion Char Array to string

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Join Date
    Apr 2008
    Location
    Pavlodar, Kazakhstan
    Posts
    22
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    1
    Thanked 5 Times in 5 Posts

    Default Re: Conversion Char Array to string

    Just use QLabel::setText(const QString &) function with your array as the argument. QString class will make conversion for you.

    For instance:
    Qt Code:
    1. char array[] = "Some text";
    2. QLabel label;
    3. label.setText(array);
    To copy to clipboard, switch view to plain text mode 

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

    anafor2004 (2nd May 2008)

Similar Threads

  1. Char Array to QString
    By 3nc31 in forum Qt Programming
    Replies: 2
    Last Post: 25th November 2007, 22:18
  2. Conversion from unsigned char* to unsigned char
    By santosh.kumar in forum General Programming
    Replies: 1
    Last Post: 6th August 2007, 13:12
  3. unable to save QCStrings properly in a buffer
    By nass in forum Qt Programming
    Replies: 13
    Last Post: 15th November 2006, 20:49
  4. String Array
    By Sarma in forum Qt Programming
    Replies: 1
    Last Post: 13th May 2006, 07:53
  5. How to get size (length, width ....) of string or char
    By Krishnacins in forum Qt Programming
    Replies: 1
    Last Post: 20th March 2006, 09:55

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.