Index: src/sas/qtgui/Perspectives/Fitting/FittingOptions.py
===================================================================
--- src/sas/qtgui/Perspectives/Fitting/FittingOptions.py	(revision b3e8629bf18b74f4214d6552e620fcbc4e73a28c)
+++ src/sas/qtgui/Perspectives/Fitting/FittingOptions.py	(revision 4992ff2626be19df7de9e5dfc0078b96bf47a75e)
@@ -4,7 +4,8 @@
 import types
 
-from PyQt4 import QtCore
-from PyQt4 import QtGui
-from PyQt4 import QtWebKit
+from PyQt5 import QtCore
+from PyQt5 import QtGui
+from PyQt5 import QtWidgets
+from PyQt5 import QtWebKitWidgets
 
 from sas.qtgui.UI import images_rc
@@ -21,5 +22,5 @@
 
 
-class FittingOptions(QtGui.QDialog, Ui_FittingOptions):
+class FittingOptions(QtWidgets.QDialog, Ui_FittingOptions):
     """
     Hard-coded version of the fit options dialog available from BUMPS.
@@ -52,7 +53,7 @@
 
         # Handle the Apply button click
-        self.buttonBox.button(QtGui.QDialogButtonBox.Ok).clicked.connect(self.onApply)
+        self.buttonBox.button(QtWidgets.QDialogButtonBox.Ok).clicked.connect(self.onApply)
         # handle the Help button click
-        self.buttonBox.button(QtGui.QDialogButtonBox.Help).clicked.connect(self.onHelp)
+        self.buttonBox.button(QtWidgets.QDialogButtonBox.Help).clicked.connect(self.onHelp)
 
         # Handle the combo box changes
@@ -71,8 +72,8 @@
 
         # OK has to be initialized to True, after initial validator setup
-        self.buttonBox.button(QtGui.QDialogButtonBox.Ok).setEnabled(True)
+        self.buttonBox.button(QtWidgets.QDialogButtonBox.Ok).setEnabled(True)
 
         # Display HTML content
-        self.helpView = QtWebKit.QWebView()
+        self.helpView = QtWebKitWidgets.QWebView()
 
     def assignValidators(self):
@@ -104,8 +105,8 @@
         if state == QtGui.QValidator.Acceptable:
             color = '' # default
-            self.buttonBox.button(QtGui.QDialogButtonBox.Ok).setEnabled(True)
+            self.buttonBox.button(QtWidgets.QDialogButtonBox.Ok).setEnabled(True)
         else:
             color = '#fff79a' # yellow
-            self.buttonBox.button(QtGui.QDialogButtonBox.Ok).setEnabled(False)
+            self.buttonBox.button(QtWidgets.QDialogButtonBox.Ok).setEnabled(False)
 
         sender.setStyleSheet('QLineEdit { background-color: %s }' % color)
@@ -134,5 +135,5 @@
 
         # OK has to be reinitialized to True
-        self.buttonBox.button(QtGui.QDialogButtonBox.Ok).setEnabled(True)
+        self.buttonBox.button(QtWidgets.QDialogButtonBox.Ok).setEnabled(True)
 
     def onApply(self):
@@ -148,5 +149,5 @@
             """
             widget = self.widgetFromOption(option)
-            new_value = widget.currentText() if isinstance(widget, QtGui.QComboBox) \
+            new_value = widget.currentText() if isinstance(widget, QtWidgets.QComboBox) \
                 else float(widget.text())
             self.config.values[self.current_fitter_id][option] = new_value
Index: src/sas/qtgui/Perspectives/Fitting/FittingPerspective.py
===================================================================
--- src/sas/qtgui/Perspectives/Fitting/FittingPerspective.py	(revision b3e8629bf18b74f4214d6552e620fcbc4e73a28c)
+++ src/sas/qtgui/Perspectives/Fitting/FittingPerspective.py	(revision 4992ff2626be19df7de9e5dfc0078b96bf47a75e)
@@ -1,6 +1,7 @@
 import numpy
 
-from PyQt4 import QtCore
-from PyQt4 import QtGui
+from PyQt5 import QtCore
+from PyQt5 import QtGui
+from PyQt5 import QtWidgets
 
 from bumps import options
@@ -14,9 +15,10 @@
 #from sas.qtgui.Perspectives.Fitting import ModelUtilities
 
-class FittingWindow(QtGui.QTabWidget):
+class FittingWindow(QtWidgets.QTabWidget):
     """
     """
     name = "Fitting" # For displaying in the combo box in DataExplorer
     def __init__(self, parent=None, data=None):
+
         super(FittingWindow, self).__init__()
 
Index: src/sas/qtgui/Perspectives/Fitting/FittingUtilities.py
===================================================================
--- src/sas/qtgui/Perspectives/Fitting/FittingUtilities.py	(revision cee5c78929349ae10afc88cb8b95e0c907f1826a)
+++ src/sas/qtgui/Perspectives/Fitting/FittingUtilities.py	(revision 4992ff2626be19df7de9e5dfc0078b96bf47a75e)
@@ -1,6 +1,7 @@
 from copy import deepcopy
 
-from PyQt4 import QtGui
-from PyQt4 import QtCore
+from PyQt5 import QtCore
+from PyQt5 import QtGui
+from PyQt5 import QtWidgets
 
 import numpy
Index: src/sas/qtgui/Perspectives/Fitting/FittingWidget.py
===================================================================
--- src/sas/qtgui/Perspectives/Fitting/FittingWidget.py	(revision 7fb471d81b5d11daed3df86a4e8427e6a832cf7a)
+++ src/sas/qtgui/Perspectives/Fitting/FittingWidget.py	(revision 4992ff2626be19df7de9e5dfc0078b96bf47a75e)
@@ -9,7 +9,8 @@
 import numpy as np
 
-from PyQt4 import QtGui
-from PyQt4 import QtCore
-from PyQt4 import QtWebKit
+from PyQt5 import QtCore
+from PyQt5 import QtGui
+from PyQt5 import QtWidgets
+from PyQt5 import QtWebKitWidgets
 
 from sasmodels import product
@@ -74,5 +75,5 @@
         return QtGui.QStandardItemModel.headerData(self, section, orientation, role)
 
-class FittingWidget(QtGui.QWidget, Ui_FittingWidgetUI):
+class FittingWidget(QtWidgets.QWidget, Ui_FittingWidgetUI):
     """
     Main widget for selecting form and structure factor models
@@ -121,5 +122,5 @@
 
         # Display HTML content
-        self.helpView = QtWebKit.QWebView()
+        self.helpView = QtWebKitWidgets.QWebView()
 
         # New font to display angstrom symbol
@@ -233,5 +234,5 @@
         """
         # Options widget
-        layout = QtGui.QGridLayout()
+        layout = QtWidgets.QGridLayout()
         self.options_widget = OptionsWidget(self, self.logic)
         layout.addWidget(self.options_widget)
@@ -239,5 +240,5 @@
 
         # Smearing widget
-        layout = QtGui.QGridLayout()
+        layout = QtWidgets.QGridLayout()
         self.smearing_widget = SmearingWidget(self)
         layout.addWidget(self.smearing_widget)
@@ -254,6 +255,6 @@
 
         # Magnetic angles explained in one picture
-        self.magneticAnglesWidget = QtGui.QWidget()
-        labl = QtGui.QLabel(self.magneticAnglesWidget)
+        self.magneticAnglesWidget = QtWidgets.QWidget()
+        labl = QtWidgets.QLabel(self.magneticAnglesWidget)
         pixmap = QtGui.QPixmap(GuiUtils.IMAGES_DIRECTORY_LOCATION + '/M_angles_pic.bmp')
         labl.setPixmap(pixmap)
@@ -274,4 +275,5 @@
         self.lstParams.setModel(self._model_model)
         self.readCategoryInfo()
+
         self.model_parameters = None
 
@@ -307,5 +309,4 @@
         self.lstParams.customContextMenuRequested.connect(self.showModelDescription)
         self.lstParams.setAttribute(QtCore.Qt.WA_MacShowFocusRect, False)
-
         # Poly model displayed in poly list
         self.lstPoly.setModel(self._poly_model)
@@ -466,6 +467,6 @@
             msg += "You must select a model to get information on this"
 
-        menu = QtGui.QMenu()
-        label = QtGui.QLabel(msg)
+        menu = QtWidgets.QMenu()
+        label = QtWidgets.QLabel(msg)
         action = QtGui.QWidgetAction(self)
         action.setDefaultWidget(label)
@@ -915,5 +916,5 @@
         self.lstParams.resizeColumnToContents(4)
         self.lstParams.resizeColumnToContents(5)
-        self.lstParams.setSizePolicy(QtGui.QSizePolicy.MinimumExpanding, QtGui.QSizePolicy.Expanding)
+        self.lstParams.setSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Expanding)
 
         self.has_error_column = True
@@ -1230,5 +1231,5 @@
         # Adjust the table cells width
         self.lstParams.resizeColumnToContents(0)
-        self.lstParams.setSizePolicy(QtGui.QSizePolicy.MinimumExpanding, QtGui.QSizePolicy.Expanding)
+        self.lstParams.setSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Expanding)
 
         # Now we claim the model has been loaded
@@ -1536,16 +1537,17 @@
         table.verticalHeader().setVisible(False)
         table.setAlternatingRowColors(True)
-        table.setSizePolicy(QtGui.QSizePolicy.MinimumExpanding, QtGui.QSizePolicy.Expanding)
-        table.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows)
+        table.setSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Expanding)
+        table.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectRows)
         table.resizeColumnsToContents()
 
         # Header
         header = table.horizontalHeader()
-        header.setResizeMode(QtGui.QHeaderView.ResizeToContents)
-
-        header.ResizeMode(QtGui.QHeaderView.Interactive)
+        header.setSectionResizeMode(QtWidgets.QHeaderView.ResizeToContents)
+        header.ResizeMode(QtWidgets.QHeaderView.Interactive)
+
+        # Qt5: the following 2 lines crash - figure out why!
         # Resize column 0 and 7 to content
-        header.setResizeMode(0, QtGui.QHeaderView.ResizeToContents)
-        header.setResizeMode(7, QtGui.QHeaderView.ResizeToContents)
+        #header.setSectionResizeMode(0, QtWidgets.QHeaderView.ResizeToContents)
+        #header.setSectionResizeMode(7, QtWidgets.QHeaderView.ResizeToContents)
 
     def setPolyModel(self):
@@ -1600,5 +1602,5 @@
 
         # All possible polydisp. functions as strings in combobox
-        func = QtGui.QComboBox()
+        func = QtWidgets.QComboBox()
         func.addItems([str(name_disp) for name_disp in POLYDISPERSITY_MODELS.keys()])
         # Set the default index
@@ -1683,7 +1685,7 @@
         Show the load file dialog and loads requested data into state
         """
-        datafile = QtGui.QFileDialog.getOpenFileName(
-            self, "Choose a weight file", "", "All files (*.*)",
-            QtGui.QFileDialog.DontUseNativeDialog)
+        datafile = QtWidgets.QFileDialog.getOpenFileName(
+            self, "Choose a weight file", "", "All files (*.*)", None,
+            QtWidgets.QFileDialog.DontUseNativeDialog)
 
         if datafile is None or str(datafile)=='':
@@ -1784,5 +1786,5 @@
         item1 = QtGui.QStandardItem(param_name)
 
-        func = QtGui.QComboBox()
+        func = QtWidgets.QComboBox()
         # Available range of shells displayed in the combobox
         func.addItems([str(i) for i in range(param_length+1)])
Index: src/sas/qtgui/Perspectives/Fitting/OptionsWidget.py
===================================================================
--- src/sas/qtgui/Perspectives/Fitting/OptionsWidget.py	(revision b3e8629bf18b74f4214d6552e620fcbc4e73a28c)
+++ src/sas/qtgui/Perspectives/Fitting/OptionsWidget.py	(revision 4992ff2626be19df7de9e5dfc0078b96bf47a75e)
@@ -3,6 +3,7 @@
 """
 import numpy as np
-from PyQt4 import QtGui
-from PyQt4 import QtCore
+from PyQt5 import QtCore
+from PyQt5 import QtGui
+from PyQt5 import QtWidgets
 
 from sas.qtgui.Plotting.PlotterData import Data2D
@@ -21,5 +22,5 @@
     'LOG_SPACED']
 
-class DataWidgetMapper(QtGui.QDataWidgetMapper):
+class DataWidgetMapper(QtWidgets.QDataWidgetMapper):
     """
     Custom version of the standard QDataWidgetMapper allowing for proper
@@ -32,13 +33,13 @@
             super(DataWidgetMapper, self).addMapping(widget, section, propertyName)
 
-        if isinstance(widget, QtGui.QComboBox):
+        if isinstance(widget, QtWidgets.QComboBox):
             delegate = self.itemDelegate()
             widget.currentIndexChanged.connect(lambda: delegate.commitData.emit(widget))
 
-        elif isinstance(widget, QtGui.QCheckBox):
+        elif isinstance(widget, QtWidgets.QCheckBox):
             delegate = self.itemDelegate()
             widget.stateChanged.connect(lambda: delegate.commitData.emit(widget))
 
-class OptionsWidget(QtGui.QWidget, Ui_tabOptions):
+class OptionsWidget(QtWidgets.QWidget, Ui_tabOptions):
     plot_signal = QtCore.pyqtSignal()
     def __init__(self, parent=None, logic=None):
@@ -52,5 +53,5 @@
 
         # Weight radio box group
-        self.weightingGroup = QtGui.QButtonGroup()
+        self.weightingGroup = QtWidgets.QButtonGroup()
         self.weighting = 0
 
@@ -114,5 +115,6 @@
         self.mapper.addMapping(self.txtNpts,     MODEL.index('NPTS'))
         self.mapper.addMapping(self.chkLogData,  MODEL.index('LOG_SPACED'))
-        self.mapper.toFirst()
+        # FIXME DOESNT WORK WITH QT5
+        #self.mapper.toFirst()
 
     def toggleLogData(self, isChecked):
Index: src/sas/qtgui/Perspectives/Fitting/SmearingWidget.py
===================================================================
--- src/sas/qtgui/Perspectives/Fitting/SmearingWidget.py	(revision b3e8629bf18b74f4214d6552e620fcbc4e73a28c)
+++ src/sas/qtgui/Perspectives/Fitting/SmearingWidget.py	(revision 4992ff2626be19df7de9e5dfc0078b96bf47a75e)
@@ -2,6 +2,7 @@
 Widget/logic for smearing data.
 """
-from PyQt4 import QtGui
-from PyQt4 import QtCore
+from PyQt5 import QtCore
+from PyQt5 import QtGui
+from PyQt5 import QtWidgets
 
 from sas.qtgui.Plotting.PlotterData import Data1D
@@ -11,5 +12,5 @@
 from sas.qtgui.Perspectives.Fitting.UI.SmearingWidgetUI import Ui_SmearingWidgetUI
 
-class DataWidgetMapper(QtGui.QDataWidgetMapper):
+class DataWidgetMapper(QtWidgets.QDataWidgetMapper):
     """
     Custom version of the standard QDataWidgetMapper allowing for proper
@@ -22,5 +23,5 @@
             super(DataWidgetMapper, self).addMapping(widget, section, propertyName)
 
-        if isinstance(widget, QtGui.QComboBox):
+        if isinstance(widget, QtWidgets.QComboBox):
             delegate = self.itemDelegate()
             widget.currentIndexChanged.connect(lambda: delegate.commitData.emit(widget))
@@ -35,5 +36,5 @@
     'ACCURACY']
 
-class SmearingWidget(QtGui.QWidget, Ui_SmearingWidgetUI):
+class SmearingWidget(QtWidgets.QWidget, Ui_SmearingWidgetUI):
     def __init__(self, parent=None):
         super(SmearingWidget, self).__init__()
@@ -83,5 +84,7 @@
         self.mapper.addMapping(self.cbSmearing,   MODEL.index('SMEARING'))
         self.mapper.addMapping(self.cbAccuracy,   MODEL.index('ACCURACY'))
-        self.mapper.toFirst()
+
+        # FIXME DOESNT WORK WITH QT5
+        #self.mapper.toFirst()
 
     def updateSmearing(self, data=None):
Index: src/sas/qtgui/Perspectives/Fitting/ViewDelegate.py
===================================================================
--- src/sas/qtgui/Perspectives/Fitting/ViewDelegate.py	(revision 02f1d12e5976114d2ebc60df5ae8182f08e4b269)
+++ src/sas/qtgui/Perspectives/Fitting/ViewDelegate.py	(revision 4992ff2626be19df7de9e5dfc0078b96bf47a75e)
@@ -1,8 +1,9 @@
-from PyQt4 import QtGui
-from PyQt4 import QtCore
+from PyQt5 import QtCore
+from PyQt5 import QtGui
+from PyQt5 import QtWidgets
 
 import sas.qtgui.Utilities.GuiUtils as GuiUtils
 
-class ModelViewDelegate(QtGui.QStyledItemDelegate):
+class ModelViewDelegate(QtWidgets.QStyledItemDelegate):
     """
     Custom delegate for appearance and behavior control of the model view
@@ -12,5 +13,5 @@
         Overwrite generic constructor to allow for some globals
         """
-        super(QtGui.QStyledItemDelegate, self).__init__()
+        super(QtWidgets.QStyledItemDelegate, self).__init__()
 
         # Main parameter table view columns
@@ -43,5 +44,6 @@
         if index.column() in self.fancyColumns():
             # Units - present in nice HTML
-            options = QtGui.QStyleOptionViewItemV4(option)
+            #options = QtWidgets.QStyleOptionViewItemV4(option)
+            options = QtWidgets.QStyleOptionViewItem(option)
             self.initStyleOption(options,index)
 
@@ -57,8 +59,8 @@
             # delete the original content
             options.text = ""
-            style.drawControl(QtGui.QStyle.CE_ItemViewItem, options, painter, options.widget);
+            style.drawControl(QtWidgets.QStyle.CE_ItemViewItem, options, painter, options.widget);
 
             context = QtGui.QAbstractTextDocumentLayout.PaintContext()
-            textRect = style.subElementRect(QtGui.QStyle.SE_ItemViewItemText, options)
+            textRect = style.subElementRect(QtWidgets.QStyle.SE_ItemViewItemText, options)
 
             painter.save()
@@ -70,5 +72,5 @@
         else:
             # Just the default paint
-            QtGui.QStyledItemDelegate.paint(self, painter, option, index)
+            QtWidgets.QStyledItemDelegate.paint(self, painter, option, index)
 
     def createEditor(self, widget, option, index):
@@ -79,5 +81,5 @@
             return 0
         if index.column() == self.param_value: #only in the value column
-            editor = QtGui.QLineEdit(widget)
+            editor = QtWidgets.QLineEdit(widget)
             validator = QtGui.QDoubleValidator()
             editor.setValidator(validator)
@@ -100,8 +102,8 @@
                 # balloon popup? tooltip? cell background colour flash?
                 return
-        QtGui.QStyledItemDelegate.setModelData(self, editor, model, index)
-
-
-class PolyViewDelegate(QtGui.QStyledItemDelegate):
+        QtWidgets.QStyledItemDelegate.setModelData(self, editor, model, index)
+
+
+class PolyViewDelegate(QtWidgets.QStyledItemDelegate):
     """
     Custom delegate for appearance and behavior control of the polydispersity view
@@ -116,5 +118,5 @@
         Overwrite generic constructor to allow for some globals
         """
-        super(QtGui.QStyledItemDelegate, self).__init__()
+        super(QtWidgets.QStyledItemDelegate, self).__init__()
 
         self.poly_parameter = 0
@@ -160,10 +162,10 @@
             return None
         elif index.column() in self.editableParameters():
-            self.editor = QtGui.QLineEdit(widget)
+            self.editor = QtWidgets.QLineEdit(widget)
             validator = QtGui.QDoubleValidator()
             self.editor.setValidator(validator)
             return self.editor
         else:
-            QtGui.QStyledItemDelegate.createEditor(self, widget, option, index)
+            QtWidgets.QStyledItemDelegate.createEditor(self, widget, option, index)
 
     def paint(self, painter, option, index):
@@ -173,5 +175,5 @@
         if index.column() in (self.poly_min, self.poly_max):
             # Units - present in nice HTML
-            options = QtGui.QStyleOptionViewItemV4(option)
+            options = QtWidgets.QStyleOptionViewItem(option)
             self.initStyleOption(options,index)
 
@@ -187,8 +189,8 @@
             # delete the original content
             options.text = ""
-            style.drawControl(QtGui.QStyle.CE_ItemViewItem, options, painter, options.widget);
+            style.drawControl(QtWidgets.QStyle.CE_ItemViewItem, options, painter, options.widget);
 
             context = QtGui.QAbstractTextDocumentLayout.PaintContext()
-            textRect = style.subElementRect(QtGui.QStyle.SE_ItemViewItemText, options)
+            textRect = style.subElementRect(QtWidgets.QStyle.SE_ItemViewItemText, options)
 
             painter.save()
@@ -200,7 +202,7 @@
         else:
             # Just the default paint
-            QtGui.QStyledItemDelegate.paint(self, painter, option, index)
-
-class MagnetismViewDelegate(QtGui.QStyledItemDelegate):
+            QtWidgets.QStyledItemDelegate.paint(self, painter, option, index)
+
+class MagnetismViewDelegate(QtWidgets.QStyledItemDelegate):
     """
     Custom delegate for appearance and behavior control of the magnetism view
@@ -210,5 +212,5 @@
         Overwrite generic constructor to allow for some globals
         """
-        super(QtGui.QStyledItemDelegate, self).__init__()
+        super(QtWidgets.QStyledItemDelegate, self).__init__()
 
         self.mag_parameter = 0
@@ -238,10 +240,10 @@
             return 0
         if index.column() in self.editableParameters():
-            editor = QtGui.QLineEdit(widget)
+            editor = QtWidgets.QLineEdit(widget)
             validator = QtGui.QDoubleValidator()
             editor.setValidator(validator)
             return editor
         else:
-            QtGui.QStyledItemDelegate.createEditor(self, widget, option, index)
+            QtWidgets.QStyledItemDelegate.createEditor(self, widget, option, index)
 
     def paint(self, painter, option, index):
@@ -251,5 +253,5 @@
         if index.column() in (self.mag_min, self.mag_max, self.mag_unit):
             # Units - present in nice HTML
-            options = QtGui.QStyleOptionViewItemV4(option)
+            options = QtWidgets.QStyleOptionViewItem(option)
             self.initStyleOption(options,index)
 
@@ -265,8 +267,8 @@
             # delete the original content
             options.text = ""
-            style.drawControl(QtGui.QStyle.CE_ItemViewItem, options, painter, options.widget);
+            style.drawControl(QtWidgets.QStyle.CE_ItemViewItem, options, painter, options.widget);
 
             context = QtGui.QAbstractTextDocumentLayout.PaintContext()
-            textRect = style.subElementRect(QtGui.QStyle.SE_ItemViewItemText, options)
+            textRect = style.subElementRect(QtWidgets.QStyle.SE_ItemViewItemText, options)
 
             painter.save()
@@ -278,3 +280,3 @@
         else:
             # Just the default paint
-            QtGui.QStyledItemDelegate.paint(self, painter, option, index)
+            QtWidgets.QStyledItemDelegate.paint(self, painter, option, index)
Index: src/sas/qtgui/Perspectives/Invariant/InvariantDetails.py
===================================================================
--- src/sas/qtgui/Perspectives/Invariant/InvariantDetails.py	(revision b3e8629bf18b74f4214d6552e620fcbc4e73a28c)
+++ src/sas/qtgui/Perspectives/Invariant/InvariantDetails.py	(revision 4992ff2626be19df7de9e5dfc0078b96bf47a75e)
@@ -1,6 +1,7 @@
 import sys
 import os
-from PyQt4 import QtCore
-from PyQt4 import QtGui
+from PyQt5 import QtCore
+from PyQt5 import QtGui
+from PyQt5 import QtWidgets
 
 # local
@@ -8,5 +9,5 @@
 from .InvariantUtils import WIDGETS
 
-class DetailsDialog(QtGui.QDialog, Ui_Dialog):
+class DetailsDialog(QtWidgets.QDialog, Ui_Dialog):
     """
     """
Index: src/sas/qtgui/Perspectives/Invariant/InvariantPerspective.py
===================================================================
--- src/sas/qtgui/Perspectives/Invariant/InvariantPerspective.py	(revision 7fb471d81b5d11daed3df86a4e8427e6a832cf7a)
+++ src/sas/qtgui/Perspectives/Invariant/InvariantPerspective.py	(revision 4992ff2626be19df7de9e5dfc0078b96bf47a75e)
@@ -2,7 +2,8 @@
 import sys
 import os
-from PyQt4 import QtCore
-from PyQt4 import QtGui
-from PyQt4 import QtWebKit
+from PyQt5 import QtCore
+from PyQt5 import QtGui
+from PyQt5 import QtWidgets
+from PyQt5 import QtWebKitWidgets
 
 from twisted.internet import threads
@@ -35,5 +36,5 @@
         self._model.appendRow(item)
 
-class InvariantWindow(QtGui.QDialog, Ui_tabbedInvariantUI):
+class InvariantWindow(QtWidgets.QDialog, Ui_tabbedInvariantUI):
     # The controller which is responsible for managing signal slots connections
     # for the gui and providing an interface to the data model.
@@ -61,5 +62,5 @@
         self._model_item = QtGui.QStandardItem()
 
-        self._helpView = QtWebKit.QWebView()
+        self._helpView = QtWebKitWidgets.QWebView()
         self.detailsDialog = DetailsDialog(self)
 
@@ -502,5 +503,5 @@
     def setupMapper(self):
         # Set up the mapper.
-        self.mapper = QtGui.QDataWidgetMapper(self)
+        self.mapper = QtWidgets.QDataWidgetMapper(self)
         self.mapper.setOrientation(QtCore.Qt.Vertical)
         self.mapper.setModel(self.model)
@@ -543,5 +544,6 @@
         self.mapper.addMapping(self.lineEdit_18, WIDGETS.W_INVARIANT_ERR)
 
-        self.mapper.toFirst()
+        # FIXME DOESNT WORK WITH QT5
+        #self.mapper.toFirst()
 
     def setData(self, data_item, is_batch=False):
@@ -644,13 +646,2 @@
         """
         return False
-
-if __name__ == "__main__":
-    app = QtGui.QApplication([])
-    import qt4reactor
-    qt4reactor.install()
-    # DO NOT move the following import to the top!
-    # (unless you know what you're doing)
-    from twisted.internet import reactor
-    dlg = InvariantWindow(reactor)
-    dlg.show()
-    reactor.run()
