Skip to content

Commit af176b0

Browse files
committed
Make all imports compatible with pyqt5
1 parent 20debed commit af176b0

3 files changed

Lines changed: 20 additions & 20 deletions

File tree

122 KB
Binary file not shown.

Resources/dvPlotterResources_rc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#
77
# WARNING! All changes made in this file will be lost!
88

9-
from PyQt4 import QtCore
9+
from PyQt5 import QtCore
1010

1111
qt_resource_data = b"\
1212
\x00\x00\x04\xc3\

dataVaultLivePlotter.py

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@
22
import sys
33
import os
44
import os.path
5+
from pathlib import Path
56
import twisted
6-
from PyQt4 import QtCore, QtGui, QtTest, uic
7-
from PyQt4.QtGui import *
8-
from PyQt4.QtCore import *
9-
from PyQt4.QtGui import QApplication, QPrinter
10-
from PyQt4.QtWebKit import QWebView
7+
from PyQt5 import QtCore, QtGui, QtTest, uic, QtWidgets, QtPrintSupport
8+
from PyQt5.QtGui import *
9+
from PyQt5.QtCore import *
10+
from PyQt5.QtWidgets import QApplication
11+
from PyQt5.QtPrintSupport import QPrinter
12+
from PyQt5.QtWebEngineWidgets import QWebEngineView
1113
from twisted.internet.defer import inlineCallbacks, Deferred
1214
import numpy as np
1315
import pyqtgraph as pg
@@ -28,21 +30,19 @@
2830
print("--------------PyPDF2 not installed... Merge PDF function disabled--------------")
2931

3032

31-
32-
path = sys.path[0]
33-
34-
sys.path.append(sys.path[0] + '\Resources')
33+
path = os.path.dirname(os.path.realpath(__file__))
34+
sys.path.append(os.path.join(path, 'Resources'))
3535
import dvPlotterResources_rc
3636

37-
mainWinGUI = path + r"\startPlotter.ui"
38-
plotExtentGUI = path + r"\extentPrompt.ui"
39-
dvExplorerGUI = path + r"\dvExplorer.ui"
40-
dirExplorerGUI = path + r"\dirExplorer.ui"
41-
editInfoGUI = path + r"\editDatasetInfo.ui"
42-
plotSetupUI = path + r"\plotSetup.ui"
43-
helpWindowUI = path + r"\helpWindow.ui"
37+
mainWinGUI = os.path.join(path, 'startPlotter.ui')
38+
plotExtentGUI = os.path.join(path, 'extentPrompt.ui')
39+
dvExplorerGUI = os.path.join(path, 'dvExplorer.ui')
40+
dirExplorerGUI = os.path.join(path, 'dirExplorer.ui')
41+
editInfoGUI = os.path.join(path, 'editDatasetInfo.ui')
42+
plotSetupUI = os.path.join(path, 'plotSetup.ui')
43+
helpWindowUI = os.path.join(path, 'helpWindow.ui')
4444

45-
guiIconPath = path + r"\hex.svg"
45+
guiIconPath = os.path.join(path, 'hex.svg')
4646

4747
Ui_MainWin, QtBaseClass = uic.loadUiType(mainWinGUI)
4848
Ui_ExtPrompt, QtBaseClass = uic.loadUiType(plotExtentGUI)
@@ -2952,8 +2952,8 @@ def closeEvent(self, e):
29522952
if __name__ == "__main__":
29532953
global app
29542954
app = QtGui.QApplication([])
2955-
from qtreactor import pyqt4reactor
2956-
pyqt4reactor.install()
2955+
import qt5reactor
2956+
qt5reactor.install()
29572957
from twisted.internet import reactor
29582958
window = dvPlotter(reactor)
29592959
window.show()

0 commit comments

Comments
 (0)