class GraphicsWidget(QtGui.QFrame):
def __init__(self, parent):
super(GraphicsWidget, self).__init__(parent)
self.initWidget()
def initWidget(self):
view = gl.GLViewWidget(self)
self.setLayout(view)
and I call it in my main gui class:
class pyEC3PO(QtGui.QMainWindow):
def __init__(self):
super(pyEC3PO, self).__init__()
self.initUI()
def initUI(self):
#Set QMainWindow properties
self.setDockOptions(QtGui.QMainWindow.VerticalTabs)
#Create center widget
self.center = GraphicsWidget(self)
self.setCentralWidget(self.center)
#Set left docks
self.importDock = MyDocks(self, 'Import')
self.embedDock = MyDocks(self, 'Embed')
self.addDockWidget(QtCore.Qt.LeftDockWidgetArea, self.importDock)
self.tabifyDockWidget(self.importDock, self.embedDock)
#Status bar
self.statusBar = self.statusBar()
self.statusBar.showMessage('Ready')
self.importDock.msg2StatusBar[str].connect(self.statusBar.showMessage)
self.resize(800,800)
self.centerWindow()
self.setWindowTitle('My GUI!')
self.show()
def centerWindow(self):
screen = QtGui.QDesktopWidget().screenGeometry()
size = self.geometry()
self.move((screen.width()-size.width())/2,
(screen.height()-size.height())/2)
When setlayout(view) is called in GraphicsWidget, I get the following type error:
TypeError: QWidget.setLayout(QLayout): argument 1 has unexpected type 'GLViewWidget'
The documentation only says 2D elements can be embeded in your own applications. Does anyone know how to embed the GLViewWidget? Would Vispy be a good alternative?
Thank you,
Alex
--
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/d8699094-991b-431b-9f1b-6bf2c5ccf49f%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
When setlayout(view) is called in GraphicsWidget, I get the following type error:
TypeError: QWidget.setLayout(QLayout): argument 1 has unexpected type 'GLViewWidget'
Would Vispy be a good alternative?
--To view this discussion on the web visit https://groups.google.com/d/msgid/pyqtgraph/CACZXET9F4L3eP%2BG1jX6PUWM1_41KPy-dkHX5HeCCSKv-Ga2g4A%40mail.gmail.com.
You received this message because you are subscribed to a topic in the Google Groups "pyqtgraph" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pyqtgraph/JOZsBPCOoDI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pyqtgraph+...@googlegroups.com.