Results 1 to 10 of 10

Thread: QString problem

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2006
    Posts
    339
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    15
    Thanked 21 Times in 16 Posts

    Default Re: QString problem

    Hi guys, come on
    this is a simple problem....

    Please get me some ideas
    Thankx

  2. #2
    Join Date
    Jan 2006
    Posts
    667
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    10
    Thanked 80 Times in 74 Posts

    Default Re: QString problem

    try

    Qt Code:
    1. std::string str = "hello";
    2. QString s = str;
    To copy to clipboard, switch view to plain text mode 

    It works

  3. #3
    Join Date
    Jan 2006
    Posts
    667
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    10
    Thanked 80 Times in 74 Posts

    Default Re: QString problem

    I am using 3.3.6 and the following code is not giving any error

    Qt Code:
    1. std::string str = "hello";
    2. QString s(str);
    To copy to clipboard, switch view to plain text mode 

  4. #4
    Join Date
    Sep 2006
    Posts
    339
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    15
    Thanked 21 Times in 16 Posts

    Default Re: QString problem

    Quote Originally Posted by munna View Post
    I am using 3.3.6 and the following code is not giving any error

    Qt Code:
    1. std::string str = "hello";
    2. QString s(str);
    To copy to clipboard, switch view to plain text mode 
    This is really surprising, when I run this same code in Qt3.3.5, it works fine but when the same code is run in Qt3.3.4 it fails..Telling it cannot be typecasted.

    How is that possible???Also when I just refered Qt3.3.4 assistant there is a member called
    QString ( const std::string & str )
    Then what is the problem? Is this a bug in Qt3.3.4?
    I'm unable to understand..Please help me.

    Cannot I make this run on Qt3.3.4??
    Thankx

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    28
    Thanked 976 Times in 912 Posts

    Default Re: QString problem

    Quote Originally Posted by vermarajeev View Post
    when I run this same code in Qt3.3.5, it works fine but when the same code is run in Qt3.3.4 it fails
    Maybe that Qt 3.3.4 version was compiled without STL support?

Similar Threads

  1. plugin loading problem
    By naresh in forum Qt Programming
    Replies: 6
    Last Post: 9th June 2007, 20:05
  2. QSqlQueryModel + set Write
    By raphaelf in forum Qt Programming
    Replies: 7
    Last Post: 5th June 2006, 09:55
  3. Converting QString to unsigned char
    By salston in forum Qt Programming
    Replies: 3
    Last Post: 24th April 2006, 23:10
  4. Problem with custom widget
    By jnana in forum Qt Programming
    Replies: 3
    Last Post: 15th March 2006, 12:55
  5. Replies: 16
    Last Post: 7th March 2006, 16:57

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.