SBGit-2019 / Pyside-QCP

Pyside2 bindings for QCustomplot
Other
16 stars 1 forks source link

Unable to set attributes of a grid #8

Open phoenixx-666 opened 1 year ago

phoenixx-666 commented 1 year ago

When trying to set attributes to a grid of an axis, an error is raised, that the underlying object (a QCPGrid) was already destroyed.

For example, the followng code:

from PySide2.QtCore import Qt
from PySide2 import QtWidgets as W
import qcustomplot_pyside2

app = W.QApplication()
w = qcustomplot_pyside2.QCustomPlot()
w.resize(800, 600)
w.xAxis.grid().setPen(Qt.red)
w.show()
app.exec_()

Results in the following error on Ubuntu 20.04:

Traceback (most recent call last):
  File "errtest.py", line 8, in <module>
    w.xAxis.grid().setPen(Qt.red)
RuntimeError: Internal C++ object (QCustomPlot.QCPGrid) already deleted.