Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-126564

fix open QFile before size() description

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Won't Do
    • P4: Low
    • None
    • 6.8
    • Documentation
    • All
    • DaVinci 99

    Description

      I want to call

      QFile file("1.txt");
      auto mysize= file.size();
      

      In fact this code works in my OS. But I am afraid of UB... Should I open file before ask size()?

      In Qt community we have talked that it is not clear... I suggest to fix doc...

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            paulwicking Paul Wicking
            dungeonlords Andrei Cherniaev
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes