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

FileDialog inside custom QQuickItem TypeErrors on exit

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P3: Somewhat important
    • Resolution: Unresolved
    • Affects Version/s: 5.13.0
    • Fix Version/s: None
    • Component/s: Quick: Other
    • Labels:
      None
    • Platform/s:
      macOS, Windows

      Description

      When I sometimes close my PySide2 5.13.0 application which contains a FileDialog inside an Item inside of a custom QQuickItem, I get a lot of TypeError messages printed to the console. Using my extremly trimmed down example below, the TypeError messages do not display if I nest the FileDialog directly under CustomView or if I use width and height instead of anchors.fill.

      main.py:

      import sys
      
      from PySide2.QtCore import QUrl
      from PySide2.QtQml import QQmlApplicationEngine, qmlRegisterType
      from PySide2.QtWidgets import QApplication
      from custom_view import CustomView
      
      import qml_rc
      
      
      if __name__ == "__main__":
          app = QApplication(sys.argv)
      
          qmlRegisterType(CustomView, "CustomView", 1, 0, "CustomView")
          engine = QQmlApplicationEngine()
          engine.load(QUrl("qrc:/main.qml"))
      
          if not engine.rootObjects():
              sys.exit(-1)
      
          sys.exit(app.exec_())
      

      main.qml

      import QtQuick.Controls 2.13
      
      ApplicationWindow {
          visible: true
      
          CustomView {}
      }
      

      custom_view.py

      from PySide2.QtQuick import QQuickItem
      
      
      class CustomView(QQuickItem):
          def __init__(self, parent: QQuickItem = None) -> None:
              super().__init__(parent)
      

      CustomView.qml

      import QtQuick 2.13
      import QtQuick.Dialogs 1.2
      import CustomView 1.0
      
      CustomView {
          Item {
              anchors.fill: parent
              FileDialog {}
          }
      }
      

      qml.qrc

      <RCC>
          <qresource prefix="/">
              <file>CustomView.qml</file>
              <file>main.qml</file>
          </qresource>
      </RCC>

      The errors I see when closing the application:

      file:///Users/user/.local/share/virtualenvs/FileDialogBug-e4i87lHt/lib/python3.7/site-packages/PySide2/Qt/qml/QtQuick/Dialogs/DefaultFileDialog.qml:433: TypeError: Cannot read property 'bottom' of undefined
      file:///Users/user/.local/share/virtualenvs/FileDialogBug-e4i87lHt/lib/python3.7/site-packages/PySide2/Qt/qml/QtQuick/Controls/SplitView.qml:535: TypeError: Type error
      file:///Users/user/.local/share/virtualenvs/FileDialogBug-e4i87lHt/lib/python3.7/site-packages/PySide2/Qt/qml/QtQuick/Controls/SplitView.qml:536: TypeError: Type error
      file:///Users/user/.local/share/virtualenvs/FileDialogBug-e4i87lHt/lib/python3.7/site-packages/PySide2/Qt/qml/QtQuick/Controls/SplitView.qml:537: TypeError: Type error
      file:///Users/user/.local/share/virtualenvs/FileDialogBug-e4i87lHt/lib/python3.7/site-packages/PySide2/Qt/qml/QtQuick/Controls/SplitView.qml:538: TypeError: Type error
      file:///Users/user/.local/share/virtualenvs/FileDialogBug-e4i87lHt/lib/python3.7/site-packages/PySide2/Qt/qml/QtQuick/Dialogs/DefaultFileDialog.qml:303: TypeError: Cannot read property 'right' of undefined
      file:///Users/user/.local/share/virtualenvs/FileDialogBug-e4i87lHt/lib/python3.7/site-packages/PySide2/Qt/qml/QtQuick/Controls/SplitView.qml:535: TypeError: Type error
      file:///Users/user/.local/share/virtualenvs/FileDialogBug-e4i87lHt/lib/python3.7/site-packages/PySide2/Qt/qml/QtQuick/Controls/SplitView.qml:536: TypeError: Type error
      file:///Users/user/.local/share/virtualenvs/FileDialogBug-e4i87lHt/lib/python3.7/site-packages/PySide2/Qt/qml/QtQuick/Controls/SplitView.qml:537: TypeError: Type error
      file:///Users/user/.local/share/virtualenvs/FileDialogBug-e4i87lHt/lib/python3.7/site-packages/PySide2/Qt/qml/QtQuick/Controls/SplitView.qml:538: TypeError: Type error
      file:///Users/user/.local/share/virtualenvs/FileDialogBug-e4i87lHt/lib/python3.7/site-packages/PySide2/Qt/qml/QtQuick/Controls/Private/ScrollViewHelper.qml:110: TypeError: Type error
      file:///Users/user/.local/share/virtualenvs/FileDialogBug-e4i87lHt/lib/python3.7/site-packages/PySide2/Qt/qml/QtQuick/Controls/Private/ScrollViewHelper.qml:111: TypeError: Type error
      file:///Users/user/.local/share/virtualenvs/FileDialogBug-e4i87lHt/lib/python3.7/site-packages/PySide2/Qt/qml/QtQuick/Controls/Private/ScrollViewHelper.qml:132: TypeError: Type error
      file:///Users/user/.local/share/virtualenvs/FileDialogBug-e4i87lHt/lib/python3.7/site-packages/PySide2/Qt/qml/QtQuick/Controls/Private/ScrollViewHelper.qml:133: TypeError: Type error
      file:///Users/user/.local/share/virtualenvs/FileDialogBug-e4i87lHt/lib/python3.7/site-packages/PySide2/Qt/qml/QtQuick/Controls/Private/ScrollViewHelper.qml:190: TypeError: Type error
      file:///Users/user/.local/share/virtualenvs/FileDialogBug-e4i87lHt/lib/python3.7/site-packages/PySide2/Qt/qml/QtQuick/Controls/Private/ScrollViewHelper.qml:191: TypeError: Type error
      file:///Users/user/.local/share/virtualenvs/FileDialogBug-e4i87lHt/lib/python3.7/site-packages/PySide2/Qt/qml/QtQuick/Controls/Private/ScrollViewHelper.qml:110: TypeError: Type error
      file:///Users/user/.local/share/virtualenvs/FileDialogBug-e4i87lHt/lib/python3.7/site-packages/PySide2/Qt/qml/QtQuick/Controls/Private/ScrollViewHelper.qml:111: TypeError: Type error
      file:///Users/user/.local/share/virtualenvs/FileDialogBug-e4i87lHt/lib/python3.7/site-packages/PySide2/Qt/qml/QtQuick/Controls/Private/ScrollViewHelper.qml:132: TypeError: Type error
      file:///Users/user/.local/share/virtualenvs/FileDialogBug-e4i87lHt/lib/python3.7/site-packages/PySide2/Qt/qml/QtQuick/Controls/Private/ScrollViewHelper.qml:133: TypeError: Type error
      file:///Users/user/.local/share/virtualenvs/FileDialogBug-e4i87lHt/lib/python3.7/site-packages/PySide2/Qt/qml/QtQuick/Controls/Private/ScrollViewHelper.qml:190: TypeError: Type error
      file:///Users/user/.local/share/virtualenvs/FileDialogBug-e4i87lHt/lib/python3.7/site-packages/PySide2/Qt/qml/QtQuick/Controls/Private/ScrollViewHelper.qml:191: TypeError: Type error
      file:///Users/user/.local/share/virtualenvs/FileDialogBug-e4i87lHt/lib/python3.7/site-packages/PySide2/Qt/qml/QtQuick/Controls/Private/ScrollViewHelper.qml:110: TypeError: Type error
      file:///Users/user/.local/share/virtualenvs/FileDialogBug-e4i87lHt/lib/python3.7/site-packages/PySide2/Qt/qml/QtQuick/Controls/Private/ScrollViewHelper.qml:111: TypeError: Type error
      file:///Users/user/.local/share/virtualenvs/FileDialogBug-e4i87lHt/lib/python3.7/site-packages/PySide2/Qt/qml/QtQuick/Controls/Private/ScrollViewHelper.qml:132: TypeError: Type error
      file:///Users/user/.local/share/virtualenvs/FileDialogBug-e4i87lHt/lib/python3.7/site-packages/PySide2/Qt/qml/QtQuick/Controls/Private/ScrollViewHelper.qml:133: TypeError: Type error
      file:///Users/user/.local/share/virtualenvs/FileDialogBug-e4i87lHt/lib/python3.7/site-packages/PySide2/Qt/qml/QtQuick/Controls/Private/ScrollViewHelper.qml:190: TypeError: Type error
      file:///Users/user/.local/share/virtualenvs/FileDialogBug-e4i87lHt/lib/python3.7/site-packages/PySide2/Qt/qml/QtQuick/Controls/Private/ScrollViewHelper.qml:191: TypeError: Type error
      file:///Users/user/.local/share/virtualenvs/FileDialogBug-e4i87lHt/lib/python3.7/site-packages/PySide2/Qt/qml/QtQuick/Controls/Private/BasicTableView.qml:777: TypeError: Cannot read property 'top' of undefined
      file:///Users/user/.local/share/virtualenvs/FileDialogBug-e4i87lHt/lib/python3.7/site-packages/PySide2/Qt/qml/QtQuick/Controls/Private/BasicTableView.qml:778: TypeError: Cannot read property 'right' of undefined
      file:///Users/user/.local/share/virtualenvs/FileDialogBug-e4i87lHt/lib/python3.7/site-packages/PySide2/Qt/qml/QtQuick/Controls/Private/BasicTableView.qml:734: TypeError: Type error
      file:///Users/user/.local/share/virtualenvs/FileDialogBug-e4i87lHt/lib/python3.7/site-packages/PySide2/Qt/qml/QtQuick/Controls/Private/BasicTableView.qml:734: TypeError: Type error
      file:///Users/user/.local/share/virtualenvs/FileDialogBug-e4i87lHt/lib/python3.7/site-packages/PySide2/Qt/qml/QtQuick/Controls/Private/BasicTableView.qml:734: TypeError: Type error
      file:///Users/user/.local/share/virtualenvs/FileDialogBug-e4i87lHt/lib/python3.7/site-packages/PySide2/Qt/qml/QtQuick/Controls/Private/BasicTableView.qml:734: TypeError: Type error
      file:///Users/user/.local/share/virtualenvs/FileDialogBug-e4i87lHt/lib/python3.7/site-packages/PySide2/Qt/qml/QtQuick/Controls/Private/BasicTableView.qml:734: TypeError: Type error
      file:///Users/user/.local/share/virtualenvs/FileDialogBug-e4i87lHt/lib/python3.7/site-packages/PySide2/Qt/qml/QtQuick/Controls/ToolBar.qml:172: TypeError: Cannot read property 'right' of undefined
      file:///Users/user/.local/share/virtualenvs/FileDialogBug-e4i87lHt/lib/python3.7/site-packages/PySide2/Qt/qml/QtQuick/Controls/ToolBar.qml:174: TypeError: Cannot read property 'verticalCenter' of undefined
      file:///Users/user/.local/share/virtualenvs/FileDialogBug-e4i87lHt/lib/python3.7/site-packages/PySide2/Qt/qml/QtQuick/Dialogs/DefaultFileDialog.qml:437: TypeError: Cannot read property 'right' of undefined
      file:///Users/user/.local/share/virtualenvs/FileDialogBug-e4i87lHt/lib/python3.7/site-packages/PySide2/Qt/qml/QtQuick/Dialogs/DefaultFileDialog.qml:439: TypeError: Cannot read property 'verticalCenter' of undefined
      file:///Users/user/.local/share/virtualenvs/FileDialogBug-e4i87lHt/lib/python3.7/site-packages/PySide2/Qt/qml/QtQuick/Dialogs/DefaultFileDialog.qml:458: TypeError: Cannot read property 'verticalCenter' of undefined

        Attachments

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

          Activity

            People

            • Assignee:
              w00t Robin Burchell
              Reporter:
              fgsdbudwin Drew
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:

                Gerrit Reviews

                There are no open Gerrit changes