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

QProxyStyle crash app !

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: Not Evaluated
    • Resolution: Unresolved
    • Affects Version/s: 6.0.0, 6.0.1
    • Fix Version/s: None
    • Component/s: PySide
    • Labels:
      None
    • Platform/s:
      Windows

      Description

      Hey

       

      This code will cause crash>

       

      import sys
      
      from PySide6.QtWidgets import QApplication, QProxyStyle, QWidget
      app = QApplication()
      
      class MyProxyStyle(QProxyStyle):
          def __init__(self):
              QProxyStyle.__init__(self)
              self.setBaseStyle(QApplication.style())
      s =MyProxyStyle()
      s.deleteLater()
      w =QWidget()
      w.show()
      sys.exit(app.exec_())
      

      Can any1 help out? 

      It could be related to > https://bugreports.qt.io/browse/PYSIDE-922

       

       

      UPDATE 

      I've made a fully working example showing the issue.  Please have look at styleVersionTest_01.py. 

      There are 6 buttons, each of them creates a tree view with a different QProxyStyle. The Inherited Style takes app.style() as base style while default() style does not. As you can see the default style has a different style to the currently applied app style. Thus it does not inherit from the app by default as it should. When it comes to deletion after you add the 3 views, go on and delete the 3 vies and you will get a crash. 

       

       

       

        Attachments

        1. pyside1504_stack.txt
          23 kB
        2. pyside1504.py
          1 kB
        3. pyside1504_noncrash.py
          1 kB
        4. styleVersionTest_01.py
          3 kB
        5. image-2021-05-10-13-57-22-540.png
          image-2021-05-10-13-57-22-540.png
          28 kB

          Issue Links

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

            Activity

              People

              Assignee:
              crmaurei Cristian Maureira-Fredes
              Reporter:
              dariusz dariusz
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:

                  Gerrit Reviews

                  There are no open Gerrit changes