Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QFile overwriting file contents
Qt 6.11 is out! See what's new in the release blog

QFile overwriting file contents

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 3 Posters 1.8k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    Hubbard
    wrote on last edited by
    #1

    0_1525569430705_70eaba80-f657-4236-8031-a8f1324346bd-image.png

    I apologize if this question is particularly basic, but how do I change this code so that it appends the file, because currently it is only the last entrance in the file, so I think its overwriting

    DiracsbracketD 1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi
      Its a mode like WriteOnly

      QFile f(...);
      if (f.open(QIODevice::WriteOnly | QIODevice::Append)) {
        ...
      }
      
      1 Reply Last reply
      5
      • H Hubbard

        0_1525569430705_70eaba80-f657-4236-8031-a8f1324346bd-image.png

        I apologize if this question is particularly basic, but how do I change this code so that it appends the file, because currently it is only the last entrance in the file, so I think its overwriting

        DiracsbracketD Offline
        DiracsbracketD Offline
        Diracsbracket
        wrote on last edited by
        #3
        This post is deleted!
        1 Reply Last reply
        1

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved