Results 1 to 4 of 4

Thread: File Handling!!!

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2011
    Posts
    8
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Maemo/MeeGo

    Default File Handling!!!

    I cannot write to the file and read from it
    here is my code..

    write:

    Qt Code:
    1. QFile file("dd.txt");
    2. file.open(QIODevice::WriteOnly);
    3. QTextStream out(&file);
    4. out<<d;
    5. file.close();
    To copy to clipboard, switch view to plain text mode 


    read:

    Qt Code:
    1. QFile f("dd.txt");
    2. f.open(QIODevice::ReadOnly | QIODevice::Text);
    3. QTextStream stream(&f);
    4. l=stream.readLine();
    5. f.close();
    To copy to clipboard, switch view to plain text mode 
    Last edited by Lykurg; 26th January 2011 at 19:50. Reason: missing [code] tags

Similar Threads

  1. file handling
    By santakdalai90 in forum Qt Programming
    Replies: 1
    Last Post: 22nd October 2009, 20:50
  2. Bug in MDI handling
    By daren in forum Qt Programming
    Replies: 1
    Last Post: 31st March 2009, 14:13
  3. large file handling
    By sakthi in forum Qt-based Software
    Replies: 1
    Last Post: 30th October 2008, 00:34
  4. Collision handling 101
    By Morea in forum Qt Programming
    Replies: 9
    Last Post: 25th November 2006, 20:17
  5. string handling
    By vijay anandh in forum Qt Programming
    Replies: 4
    Last Post: 5th May 2006, 09:15

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.