Results 1 to 3 of 3

Thread: QTextStream and file handle

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2010
    Posts
    25
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default QTextStream and file handle

    Hi,
    I have a query regarding Files and textstream in QT

    if I have a code such as the following :

    Qt Code:
    1. QFile file("abc.txt");
    2. file.open(QIODevice::ReadOnly);
    3. QTextStream(&file);
    4.  
    5. file.setFileName("xyz.txt");
    6. file.open(QIODevice::ReadOnly);
    To copy to clipboard, switch view to plain text mode 


    In the above case what should QTextstream be pointing at?
    Contents of "abc.txt" or "xyz.txt"
    In my case it points to "abc.txt"
    Is there any way I can change it to point to "xyz.txt"?

    Thank you in advance.
    Last edited by high_flyer; 4th January 2011 at 11:16. Reason: code tags

Similar Threads

  1. Replies: 0
    Last Post: 17th June 2010, 11:07
  2. writing file with QTextStream
    By Raul in forum Qt Programming
    Replies: 3
    Last Post: 31st May 2010, 14:46
  3. Replies: 5
    Last Post: 27th May 2009, 12:49
  4. QTextStream loses position while reading file
    By bjh in forum Qt Programming
    Replies: 2
    Last Post: 13th February 2008, 15:47
  5. Reading File using QFile and QTextStream
    By atm in forum Qt Programming
    Replies: 4
    Last Post: 13th July 2006, 23:12

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.