Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-436

QTextStream operator "<<" ignores everything but numbers

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P5: Not important
    • Resolution: Fixed
    • Affects Version/s: dev
    • Fix Version/s: dev
    • Component/s: PySide
    • Labels:
      None
    • Environment:
      win7 python3.5.2 amd64 qt5.6.2

      Description

      Subject changed and example created by Christian Tismer
      Writing to a QTextStream with "<<" writes only the numbers. No error message, nothing.

      from PySide2.QtCore import *
      from PySide2.QtGui import *
      from PySide2.QtWidgets import *
      
      def f():
          file = QFile("out.txt")
          if not file.open(QIODevice.WriteOnly | QIODevice.Text):
              return
          out = QTextStream(file)
          out << "The magic number is: " << 49 << "huh" << 123 << "\n"
      
      if __name__ == "__main__":
          f()
      

        Attachments

          Issue Links

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

            Activity

              People

              Assignee:
              ctismer Christian Tismer
              Reporter:
              liuliuab1 ming liu
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes