'Adding pyqtgraph to PyQt6
So I am making a GUI using Pyqt6 and want to add graphs inside the Gui with other data, SO when I try adding the graph i get the error bellow:
call: addWidget(self, QWidget): argument 1 has unexpected type 'PlotWidget' addWidget(self, QWidget, int, int, alignment: Qt.AlignmentFlag = Qt.Alignment()): argument 1 has unexpected type 'PlotWidget' addWidget(self, QWidget, int, int, int, int, alignment: Qt.AlignmentFlag = Qt.Alignment()): argument 1 has unexpected type 'PlotWidget'
The code I have
self.plt=pyqtgraph.PlotWidget()
self.plt.plot([1,2,3,4,5],[1,2,3,4,5])
grid.addWidget(self.plt, 6, 1, 3, 3)
self.setLayout(grid) #up I have grid=QGridLayout()
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|