Hi, you might need to place the place the graphicsview inside gridlayout, add GLviewwidget onto the layout
#Create object form GLviewWidget self.viewt = gl.GLViewWidget() #create grid features self.xgrid.rotate(90, 0, 1, 0) self.xgrid.translate(-10, 0, 0) #add grid item to GLviewWidget object self.viewt.addItem(self.xgrid) #This should solve the issue self.layout_parent = QGridLayout(self.graphicsView) self.layout_parent.setContentsMargins(20, 20, 20, 20) self.layout_parent.addWidget(self.viewt) Let me know On Sunday, April 4, 2021 at 6:31:19 AM UTC-7 [email protected] wrote: > Hello everyone, > > I'm fairly new to PyQtGraph, and for the most part I have been having > tremendous success. I am creating an application that does some analysis on > objects in 3D space, and generates plots based on their geometry. Currently > my plots are all 2D, with an image view and linked axes to show data > arising from the underlying model geometry, however I was hoping to also > include a 3D plot *showing* the geometry. Going through the PyQtGraph > examples, the GlScatterPlotItem looks to be precisely what I am looking for. > > Oddly enough, the example runs perfectly fine, however when I try to > implement this into my application I got an error. My first instinct was to > bring the GlViewWidget outside of my GraphicsLayoutWidget, and plot > independently. This worked.. kind of. I can add a GridItem to the > GlViewWidget, and that renders fine - I can interact with it as I can in > the examples. However, upon trying to add a GlScatterPlotItem I get the > following error: > > line 114, in addItem > self.checkOpenGLVersion('Error while adding item %s to GLViewWidget.' > % str(item)) > > line 535, in checkOpenGLVersion > verString = glGetString(GL_VERSION) > > line 415, in __call__ > return self( *args, **named ) > > line 230, in glCheckError > raise self._errorClass( > OpenGL.error.GLError: GLError( > err = 1282, > description = b'invalid operation', > baseOperation = glGetString, > cArguments = (GL_VERSION,) > ) > > What baffles me is that the examples work without issue. Some googling > lead me to upgrading mesa drivers, however that did not seem to fix the > issue - Any ideas on what I could do to make this work? > > -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/pyqtgraph/bda24d48-8412-4425-8d67-04f57b8cfdben%40googlegroups.com.
