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

runtime error when getting the style of a widget in embedded application

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4: Low P4: Low
    • 6.7.0
    • 6.5.3
    • PySide
    • None
    • Windows
    • b9381164e (dev)

      We embed qt and python in our application. When we run python code we don't need to create a QApplication (it already exists).

      Running:
       

      from PySide6 import QtCore, QtWidgets
      combo = QtWidgets.QComboBox()
      view = combo.view()
      print(view.style())

      will throw:

      
      RuntimeError: Internal C++ object (PySide6.QtWidgets.QCommonStyle) already deleted.

      The workaround consists in calling:

      QtWidgets.QApplication.instance()

      once (just after the import).

      But it would be nice not having to do that.

        1. pyside2605_diag.diff
          4 kB
        2. pyside2605_invalidate_stack.txt
          24 kB
        3. pyside2605_log.txt
          4 kB
        4. pyside2605_nonembedded.py
          0.9 kB
        5. pyside2605_repro.diff
          0.7 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            crmaurei Cristian Maureira-Fredes
            hugow Hugo Windisch
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes