Commit 93284d6f authored by Maxime Perrotin's avatar Maxime Perrotin

Prepare for Pyside2

parent b079c493
......@@ -19,8 +19,13 @@ import signal
import speedometer
from tasteplot import TastePlot
from PySide.QtGui import QAction
from PySide.QtCore import QObject, Slot
try:
from PySide.QtGui import QAction
from PySide.QtCore import QObject, Slot
except ImportError as err:
from PySide2.QtWidgets import *
from PySide2.QtGui import *
from PySide2.QtCore import *
class plot(object):
......
......@@ -20,15 +20,27 @@ import csv
import matplotlib
# Following two lines need to be set before importing FigureCanvas
matplotlib.use('Qt4Agg')
matplotlib.rcParams['backend.qt4']='PySide'
try:
matplotlib.use('Qt4Agg')
matplotlib.rcParams['backend.qt4']='PySide'
except:
matplotlib.use('Qt5Agg')
#matplotlib.rcParams['backend.qt5']='PySide2'
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.figure import Figure
from PySide.QtUiTools import QUiLoader
from PySide import QtCore, QtGui
from PySide.QtCore import QFile, QThread
from PySide.QtGui import QSpinBox, QCheckBox, QLineEdit, QDoubleSpinBox
try:
from PySide.QtUiTools import QUiLoader
from PySide import QtCore, QtGui
from PySide.QtCore import QFile, QThread
from PySide.QtGui import QSpinBox, QCheckBox, QLineEdit, QDoubleSpinBox
except ImportError:
from PySide2.QtWidgets import *
from PySide2.QtUiTools import *
from PySide2.QtGui import *
from PySide2.QtCore import *
import resources
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment