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

Missing import in 'Using UI Files' tutorial

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • 5.15.1
    • 5.14.2
    • Documentation
    • None
    • Windows
    • 96203cf77e2e2367a4461946f47dd9205c7fbe9c

    Description

      The second last code block of the 'Using UI Files' tutorial on:

      https://doc.qt.io/qtforpython/tutorials/basictutorial/uifiles.html

      is missing an import from QtCore for QIODevice:

      Traceback (most recent call last):
        File "mainwindow_2.py", line 11, in <module>
          if not ui_file.open(QIODevice.ReadOnly):
      NameError: name 'QIODevice' is not defined
      

      Please add this import:

      from PySide2.QtCore import QFile, QIODevice
      

      Attachments

        For Gerrit Dashboard: QTBUG-84270
        # Subject Branch Project Status CR V

        Activity

          People

            vertries Nico Vertriest (Inactive)
            raketenjoint Tim Meiler
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 1 minute
                1m
                Remaining:
                Remaining Estimate - 1 minute
                1m
                Logged:
                Time Spent - Not Specified
                Not Specified

                Gerrit Reviews

                  There are no open Gerrit changes