from PyQt5 import QtWidgets, uic
import pyqtgraph.opengl as gl
import pyqtgraph as pg
import numpy as np
class MainWindow(QtWidgets.QMainWindow):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
uic.loadUi('test.ui', self)
self.openGLWidget.show()
def main():
m = MainWindow()
grid = gl.GLGridItem()
m.openGLWidget.addItem(grid) # <-- Works, no problem.
pos = np.array([(0, 0, 0), (0, 1, 0)])
size = np.array([10, 10])
scatter_plot = gl.GLScatterPlotItem(pos=pos, size=size)
m.openGLWidget.addItem(scatter_plot) # <-- Throws error
return m
if __name__ == '__main__':
app = pg.mkQApp()
m = main()
m.show()
pg.mkQApp().exec_()
--
You received this message because you are subscribed to the Google Groups "pyqtgraph" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyqtgraph+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyqtgraph/59081bd0-1015-40f6-9772-23611e7aa0b8n%40googlegroups.com.