I have a QT application where I use the GraphicsView in combination with GraphicsLayout. I took the example "GraphicsLayout.py" from the PyQtGraph repository as a starting point. The below code snippet shows from where I started out.
app = QtGui.QApplication([])
view = pg.GraphicsView()
l = pg.GraphicsLayout(border=(100,100,100))
view.setCentralItem(l)
view.show()
view.setWindowTitle('pyqtgraph example: GraphicsLayout')
view.resize(800,600)
p1 = l.addPlot(title="Plot 1")
p2 = l.addPlot(title="Plot 2")
vb = l.addViewBox(lockAspect=True)
img = pg.ImageItem(np.random.normal(size=(100,100)))
vb.addItem(img)
This approach works fine but I now would like to add an ImageView instead of an ImageItem to the layout. Mainly because I want to take advantage of the histogram and slider functionalities already inbuilt in ImageView objects.
In the example "DataSlicing" they add ImageView objects to a layout, but there it is a QtGui.QtGridLayout object and the ImageViews are added as widgets and not as items.
cw = QtGui.QWidget()
win.setCentralWidget(cw)
l = QtGui.QGridLayout()
cw.setLayout(l)
imv1 = pg.ImageView()
imv2 = pg.ImageView()
l.addWidget(imv1, 0, 0)
l.addWidget(imv2, 1, 0)
Is there a way to combine these two approaches, by adding ImageView objects to a pg.GraphicsLayout, or is that not the right way to go?
Thanks for any kind of advice