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
Issue Links
- relates to
-
QTBUG-104596 [reg->6.4] Qt Designer crashes when OpenGL widget is dragged to form
- Closed