Results 1 to 2 of 2

Thread: file read & write help....

  1. #1
    Join Date
    Sep 2008
    Posts
    84
    Thanks
    28
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Question file read & write help....

    I want to simple program to read & write a simple text file.
    Is there any example on file reading and writing a simple textfile.

    I don't where to start.
    Pls help

  2. #2
    Join Date
    Dec 2006
    Posts
    849
    Thanks
    6
    Thanked 163 Times in 151 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: file read & write help....

    something like that should work:
    Qt Code:
    1. QFile input(filename);
    2. if (!input.open(QIODevice::ReadOnly)) handle_error_somehow();
    3. QTextStream in(&input);
    4. // now read from in
    To copy to clipboard, switch view to plain text mode 

    HTH

Similar Threads

  1. How can I Read Write Excel File
    By xingshaoyong in forum Qt Programming
    Replies: 6
    Last Post: 13th July 2011, 20:16
  2. [Java] read and write a file
    By mickey in forum General Programming
    Replies: 3
    Last Post: 22nd June 2008, 10:43
  3. structures to a file (read and write)
    By baray98 in forum Qt Programming
    Replies: 5
    Last Post: 10th February 2008, 20:12
  4. How to open a file in Read Write mode
    By merry in forum Qt Programming
    Replies: 13
    Last Post: 16th November 2007, 14:40
  5. Read \Write Excel File using Qt
    By xingshaoyong in forum Qt Programming
    Replies: 4
    Last Post: 27th July 2007, 22:07

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.