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

Reg->6.4.0: Using QtCharts/QAbstractSeries::setUseOpenGL() refreshes the whole QMainWindow (RHI switching)

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.4.0
    • Charts, Qt RHI
    • None
    • Linux/X11, Windows

    Description

      Since PySide 6.4.0 there is an issue using QChartView, QChart and QLineSeries with OpenGL enabled. It cause the QMainWindow to "close" then "open" like a refresh, which it doesn't occurs using PySide < 6.4.0.

      https://doc.qt.io/qt-6/qabstractseries.html#useOpenGL-prop

      Steps to reproduce:

      • build attached C++ example qtbug108190.zip
      • Press "Add line series"
      • Note Main Window jumping/being recreated in 6.4

       

      import sys
      from PySide6.QtWidgets import QMainWindow, QApplication, QPushButton, QVBoxLayout, QWidget
      from PySide6.QtCharts import QChart, QChartView, QLineSeries
      
      
      class TestWindow(QMainWindow):
         def __init__(self):
            super().__init__()
      
            self.chart = QChart()
      
            self._chart_view = QChartView(self.chart)
      
            self._button1 = QPushButton("Add line series")
            self._button1.clicked.connect(self._button1_clicked)
      
            self.main_widget = QWidget(self)
            self.main_layout = QVBoxLayout()
            self.main_layout.addWidget(self._chart_view)
            self.main_layout.addWidget(self._button1)
            self.main_widget.setLayout(self.main_layout)
            self.setCentralWidget(self.main_widget)
      
         def update_line_series(self):
            self.series = QLineSeries()
            self.series.setUseOpenGL(True)
            self.series.append(0, 6)
            self.series.append(2, 4)
            self.series.append(3, 8)
            self.series.append(7, 4)
      
            self.chart.addSeries(self.series)
      
         def _button1_clicked(self):
            self.update_line_series()
      
      
      if __name__ == "__main__":
         app = QApplication(sys.argv)
         window = TestWindow()
         window.show()
         window.resize(440, 300)
         sys.exit(app.exec())
      
      
      

       

      Tested with Python 3.10 and 3.11.

      Attachments

        1. pyside2109.py
          1 kB
          Friedemann Kleint
        2. qtbug108190.zip
          1 kB
          Friedemann Kleint

        Issue Links

          Activity

            People

              lagocs Laszlo Agocs
              dproust Damien Proust
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: