2012-03-17 15:47:20 +00:00
|
|
|
## make this version of pyqtgraph importable before any others
|
|
|
|
import sys, os
|
2012-12-26 22:51:52 +00:00
|
|
|
path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
|
|
|
|
path.rstrip(os.path.sep)
|
|
|
|
if path.endswith('pyqtgraph'):
|
|
|
|
sys.path.insert(0, os.path.join(path, '..')) ## examples installed inside pyqtgraph package
|
|
|
|
elif 'pyqtgraph' in os.listdir(path):
|
|
|
|
sys.path.insert(0, path) ## examples adjacent to pyqtgraph (as in source)
|
2012-10-26 12:55:53 +00:00
|
|
|
|
2012-12-26 22:51:52 +00:00
|
|
|
## should force example to use PySide instead of PyQt
|
|
|
|
if 'pyside' in sys.argv:
|
2012-12-25 05:43:31 +00:00
|
|
|
from PySide import QtGui
|
2012-10-26 12:55:53 +00:00
|
|
|
elif 'pyqt' in sys.argv:
|
2012-12-25 05:43:31 +00:00
|
|
|
from PyQt4 import QtGui
|
|
|
|
else:
|
|
|
|
from pyqtgraph.Qt import QtGui
|
|
|
|
|
2012-12-26 22:51:52 +00:00
|
|
|
## Force use of a specific graphics system
|
2012-12-25 05:43:31 +00:00
|
|
|
for gs in ['raster', 'native', 'opengl']:
|
|
|
|
if gs in sys.argv:
|
|
|
|
QtGui.QApplication.setGraphicsSystem(gs)
|
|
|
|
break
|
|
|
|
|