Results 1 to 10 of 10

Thread: char* to QString: conversion

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #4
    Join Date
    Feb 2010
    Posts
    31
    Qt products
    Qt3 Qt4 Qt/Embedded Qt Jambi
    Platforms
    Windows
    Thanks
    1

    Default Re: char* to QString: conversion

    Thanks toutarrive.

    However if I use the following:
    Qt Code:
    1. const char* test = "Abhijit";
    2. QByteArray d(test);
    3. result = QString::number(d.size());
    4. QString fileName = QDir::currentPath() + "/Test.txt";
    5. QFile file(fileName);
    6. file.open(QIODevice::Append | QIODevice::Text);
    7. file.write(QString(test) + "\n");
    8. return result;
    To copy to clipboard, switch view to plain text mode 

    everything is going fine. But if instead of defining test in the program itself, if I pass test value as an parameter from vb.net then some absurd result is thrown. Can anybody put some light on this?

    Thanks in advance.
    Last edited by abghosh; 7th March 2010 at 09:57. Reason: I was wrong

Similar Threads

  1. Conversion Char Array to string
    By anafor2004 in forum Newbie
    Replies: 6
    Last Post: 6th May 2008, 14:35
  2. qreal -> QString conversion
    By MarkoSan in forum Newbie
    Replies: 2
    Last Post: 13th April 2008, 14:37
  3. QString iso 8859-1 conversion
    By mattia in forum Newbie
    Replies: 11
    Last Post: 21st January 2008, 14:17
  4. Conversion from unsigned char* to unsigned char
    By santosh.kumar in forum General Programming
    Replies: 1
    Last Post: 6th August 2007, 13:12
  5. conversion from QString to const uint8 *
    By vishal.chauhan in forum Qt Programming
    Replies: 3
    Last Post: 19th February 2007, 13:14

Tags for this Thread

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.