Results 1 to 4 of 4

Thread: Writing single line inside a text file

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Writing single line inside a text file

    You can only randomly update the file if the space already exists for the data you are inserting. If the file size needs to change (longer or shorter) then there is no way to avoid rewriting the entire file.

    if you know a better way of creating a blanck QString without having to use a for with append(" "), I'ld be glad to know
    Qt Code:
    1. QString blanks(80, ' ');
    2. QString hyphens(80, '-');
    To copy to clipboard, switch view to plain text mode 

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

    Momergil (15th July 2013)

Similar Threads

  1. Start writing from a specific line in a file
    By nackasha in forum Newbie
    Replies: 1
    Last Post: 17th August 2011, 17:31
  2. writing in text file
    By ready in forum Qt Programming
    Replies: 3
    Last Post: 3rd July 2011, 22:20
  3. New line when writing a File
    By locke in forum Qt Programming
    Replies: 5
    Last Post: 17th May 2011, 11:27
  4. Writing the text within a text edit to a file
    By Splatify in forum Newbie
    Replies: 4
    Last Post: 23rd February 2011, 22:48
  5. writing to a text-file
    By QtBros61 in forum Newbie
    Replies: 7
    Last Post: 9th April 2010, 11:15

Tags for this Thread

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.