and made 2 modifications: (1) import pyqtgraph.opengl as gl and (2) substituted gl.GLViewWidget for plot instead of pg.plotWidget. However, unlike the original pg.plotWidget, the GLViewWidget doesn't show up in the Qt window when I run the script. After extensive searching, I can't find a reason for this behavior. Can anyone enlighten me as to how to get this to work? My ultimate objective is to embed a GLViewWidget with a 3D data animation in a Qt window that has controls that link to how the 3D data is displayed.
# Example from
http://www.pyqtgraph.org/documentation/qtcrashcourse.htmlfrom PyQt4 import QtGui # (the example applies equally well to PySide)
import pyqtgraph as pg
import pyqtgraph.opengl as gl
## Always start by initializing Qt (only once per application)
app = QtGui.QApplication([])
## Define a top-level widget to hold everything
w = QtGui.QWidget()
## Create some widgets to be placed inside
btn = QtGui.QPushButton('press me')
text = QtGui.QLineEdit('enter text')
listw = QtGui.QListWidget()
plot = gl.GLViewWidget()
## Create a grid layout to manage the widgets size and position
layout = QtGui.QGridLayout()
w.setLayout(layout)
## Add widgets to the layout in their proper positions
layout.addWidget(btn, 0, 0) # button goes in upper-left
layout.addWidget(text, 1, 0) # text edit goes in middle-left
layout.addWidget(listw, 2, 0) # list widget goes in bottom-left
layout.addWidget(plot, 0, 1, 3, 1) # plot goes on right side, spanning 3 rows
## Display the widget as a new window
w.show()
## Start the Qt event loop
app.exec_()