Results 1 to 18 of 18

Thread: Display contents of .txt file

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    6
    Thanked 348 Times in 333 Posts

    Default Re: Display contents of .txt file

    Quote Originally Posted by wysota View Post
    But if you don't know the maximum line length, how much would you read?
    Depends on the requirement. If it was 20 lines, then I would read 20 * 132 as a starting point. If I don't see 20 new lines in the buffer, then I would guess at another figure depending on how many lines I did see (appending to the data already in the buffer), and keep doing that until I matched the requirement.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: Display contents of .txt file

    Effectively reading the whole file For instance if the whole file contained only a single line.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Replies: 0
    Last Post: 9th April 2009, 06:35
  2. Application.app/Contents/MacOS file issue
    By sgmurphy19 in forum Qt Programming
    Replies: 1
    Last Post: 20th September 2008, 09:03
  3. how to display DGN file
    By Nithya in forum Qt Programming
    Replies: 8
    Last Post: 24th April 2008, 10:23
  4. Replies: 6
    Last Post: 9th January 2008, 15:56
  5. Replies: 4
    Last Post: 10th December 2006, 09:04

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.