refactor GLViewWidget code into GLViewMixin#2659
Merged
j9ac9k merged 2 commits intopyqtgraph:masterfrom May 17, 2023
Merged
Conversation
9fa2fca to
767e397
Compare
Contributor
Author
|
All the following invocations should work. import pyqtgraph as pg
import pyqtgraph.opengl as gl
pg.mkQApp()
gl.GLViewWidget()
gl.GLViewWidget(None)
gl.GLViewWidget(parent=None)
gl.GLViewWidget(rotationMethod='euler')
gl.GLViewWidget(None, rotationMethod='euler')
gl.GLViewWidget(parent=None, rotationMethod='euler')
gl.GLViewWidget(rotationMethod='euler', parent=None)Although I don't quite understand the utility of specifying the parent on instantiation. import pyqtgraph as pg
import pyqtgraph.opengl as gl
from pyqtgraph.Qt import QtWidgets
pg.mkQApp()
main = QtWidgets.QWidget()
glw = gl.GLViewWidget(parent=main)
main.show()
pg.exec() |
Member
|
Thanks @pijyoi for this PR, sorry for my indecisiveness regarding the documentation blurb. This LGTM, I am curious if it will get adopted much. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Some less-often used features of GLViewWidget no longer work with QOpenGLWidget but do work with QOpenGLWindow. This code factors out the "meat" of GLViewWidget into GLViewMixin so that users can more easily inherit from it to use with QOpenGLWindow.
Sample usage:
Non-satisfactory parts
Details
__init__methods have to be called manually