remove calls to setGraphicsSystem

in fact all are no-ops
This commit is contained in:
KIU Shueng Chuan 2021-02-22 18:23:01 +08:00
parent e09a397ebc
commit 61616ffad9
7 changed files with 3 additions and 14 deletions

View File

@ -11,7 +11,6 @@ from pyqtgraph.Qt import QtGui, QtCore
import numpy as np import numpy as np
import pyqtgraph as pg import pyqtgraph as pg
#QtGui.QApplication.setGraphicsSystem('raster')
app = pg.mkQApp("Plot Auto Range Example") app = pg.mkQApp("Plot Auto Range Example")
#mw = QtGui.QMainWindow() #mw = QtGui.QMainWindow()
#mw.resize(800,800) #mw.resize(800,800)

View File

@ -12,7 +12,6 @@ from pyqtgraph.Qt import QtGui, QtCore
import numpy as np import numpy as np
import pyqtgraph as pg import pyqtgraph as pg
#QtGui.QApplication.setGraphicsSystem('raster')
app = pg.mkQApp() app = pg.mkQApp()
mw = QtGui.QMainWindow() mw = QtGui.QMainWindow()
mw.setWindowTitle('pyqtgraph example: PlotWidget') mw.setWindowTitle('pyqtgraph example: PlotWidget')

View File

@ -12,7 +12,6 @@ from pyqtgraph.Qt import QtGui, QtCore
import numpy as np import numpy as np
import pyqtgraph as pg import pyqtgraph as pg
#QtGui.QApplication.setGraphicsSystem('raster')
app = pg.mkQApp("Plotting Example") app = pg.mkQApp("Plotting Example")
#mw = QtGui.QMainWindow() #mw = QtGui.QMainWindow()
#mw.resize(800,800) #mw.resize(800,800)

View File

@ -40,7 +40,6 @@ parser.add_argument('--lut-alpha', default=False, action='store_true', help="Use
parser.add_argument('--size', default='512x512', type=lambda s: tuple([int(x) for x in s.split('x')]), help="WxH image dimensions default='512x512'") parser.add_argument('--size', default='512x512', type=lambda s: tuple([int(x) for x in s.split('x')]), help="WxH image dimensions default='512x512'")
args = parser.parse_args(sys.argv[1:]) args = parser.parse_args(sys.argv[1:])
#QtGui.QApplication.setGraphicsSystem('raster')
app = pg.mkQApp("Video Speed Test Example") app = pg.mkQApp("Video Speed Test Example")
win = QtGui.QMainWindow() win = QtGui.QMainWindow()

View File

@ -12,7 +12,6 @@ from pyqtgraph.Qt import QtGui, QtCore
import numpy as np import numpy as np
import pyqtgraph as pg import pyqtgraph as pg
#QtGui.QApplication.setGraphicsSystem('raster')
app = pg.mkQApp("Linked Views Example") app = pg.mkQApp("Linked Views Example")
#mw = QtGui.QMainWindow() #mw = QtGui.QMainWindow()
#mw.resize(800,800) #mw.resize(800,800)

View File

@ -199,7 +199,7 @@ conditionalExamples = {
) )
] ]
) )
def testExamples(frontend, f, graphicsSystem=None): def testExamples(frontend, f):
# runExampleFile(f[0], f[1], sys.executable, frontend) # runExampleFile(f[0], f[1], sys.executable, frontend)
name, file = f name, file = f
@ -210,15 +210,11 @@ def testExamples(frontend, f, graphicsSystem=None):
sys.stdout.flush() sys.stdout.flush()
import1 = "import %s" % frontend if frontend != '' else '' import1 = "import %s" % frontend if frontend != '' else ''
import2 = os.path.splitext(os.path.split(fn)[1])[0] import2 = os.path.splitext(os.path.split(fn)[1])[0]
graphicsSystem = (
'' if graphicsSystem is None else "pg.QtGui.QApplication.setGraphicsSystem('%s')" % graphicsSystem
)
code = """ code = """
try: try:
%s %s
import initExample import initExample
import pyqtgraph as pg import pyqtgraph as pg
%s
import %s import %s
import sys import sys
print("test complete") print("test complete")
@ -231,7 +227,7 @@ except:
print("test failed") print("test failed")
raise raise
""" % (import1, graphicsSystem, import2) """ % (import1, import2)
if sys.platform.startswith('win'): if sys.platform.startswith('win'):
process = subprocess.Popen([sys.executable], process = subprocess.Popen([sys.executable],
stdin=subprocess.PIPE, stdin=subprocess.PIPE,

View File

@ -37,9 +37,7 @@ if 'linux' in sys.platform: ## linux has numerous bugs in opengl implementation
elif 'darwin' in sys.platform: ## openGL can have a major impact on mac, but also has serious bugs elif 'darwin' in sys.platform: ## openGL can have a major impact on mac, but also has serious bugs
useOpenGL = False useOpenGL = False
if QtGui.QApplication.instance() is not None: if QtGui.QApplication.instance() is not None:
print('Warning: QApplication was created before pyqtgraph was imported; there may be problems (to avoid bugs, call QApplication.setGraphicsSystem("raster") before the QApplication is created).') print('Warning: QApplication was created before pyqtgraph was imported; there may be problems.')
if QtGui.QApplication.setGraphicsSystem:
QtGui.QApplication.setGraphicsSystem('raster') ## work around a variety of bugs in the native graphics system
else: else:
useOpenGL = False ## on windows there's a more even performance / bugginess tradeoff. useOpenGL = False ## on windows there's a more even performance / bugginess tradeoff.