Results 1 to 7 of 7

Thread: QString assignment problem in C++ style but not in C style

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Join Date
    Sep 2009
    Location
    Wroclaw, Poland
    Posts
    1,394
    Thanked 342 Times in 324 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: QString assignment problem in C++ style but not in C style

    Why is that?
    Because there is no QString constructor taking a std::string as agrument.
    What's the best way to obtain a line from a file in Qt?
    Use QFile and QTextStream, there is an example of reading a file line-by-line in QFile documentation.
    Last edited by stampede; 29th December 2011 at 14:09. Reason: updated contents

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

    timmu (29th December 2011)

Similar Threads

  1. copy constructor and assignment operator
    By sajis997 in forum Newbie
    Replies: 9
    Last Post: 27th July 2011, 17:02
  2. QSettings Assignment
    By SixDegrees in forum Qt Programming
    Replies: 1
    Last Post: 30th April 2010, 23:00
  3. QString assignment
    By valgaba in forum Qt Programming
    Replies: 4
    Last Post: 25th April 2010, 17:31
  4. QVector assignment question
    By hvw59601 in forum Qt Programming
    Replies: 1
    Last Post: 14th November 2007, 20:34
  5. copying and assignment constructors
    By TheKedge in forum General Programming
    Replies: 3
    Last Post: 17th August 2006, 15:09

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.