Results 1 to 2 of 2

Thread: how to write in text file

  1. #1
    Join Date
    Aug 2013
    Location
    India
    Posts
    44
    Thanks
    3
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default how to write in text file

    I have four lineEdit and one pushbutton .
    on each buttonclick new data will be updated in lineEdit and on each buttonclick i want to add data in text file every time.
    plzz suggest me how i can do this.

  2. #2
    Join Date
    Dec 2009
    Location
    New Orleans, Louisiana
    Posts
    791
    Thanks
    13
    Thanked 153 Times in 150 Posts
    Qt products
    Qt5
    Platforms
    MacOS X

    Default Re: how to write in text file

    Use QFile::open(QIODevice::Text|QIODevice::Append) to open a file so that you append data to the end of the file, then use QTextStream or write to the file directly using QFile::write.

Similar Threads

  1. Replies: 7
    Last Post: 5th February 2014, 11:20
  2. Write on a text file from QString
    By Malek in forum Newbie
    Replies: 3
    Last Post: 27th December 2010, 19:27
  3. How to write something on a text file on a certain line?
    By Bong.Da.City in forum Qt Programming
    Replies: 1
    Last Post: 17th December 2010, 21:01
  4. Write one value per line in text file
    By babygal in forum Newbie
    Replies: 11
    Last Post: 1st December 2010, 06:47
  5. How to write ByteArray into a text file?
    By babygal in forum Newbie
    Replies: 4
    Last Post: 11th October 2010, 04:19

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.