|
2 | 2 | import sys |
3 | 3 | import os |
4 | 4 | import os.path |
| 5 | +from pathlib import Path |
5 | 6 | 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 |
11 | 13 | from twisted.internet.defer import inlineCallbacks, Deferred |
12 | 14 | import numpy as np |
13 | 15 | import pyqtgraph as pg |
|
28 | 30 | print("--------------PyPDF2 not installed... Merge PDF function disabled--------------") |
29 | 31 |
|
30 | 32 |
|
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')) |
35 | 35 | import dvPlotterResources_rc |
36 | 36 |
|
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') |
44 | 44 |
|
45 | | -guiIconPath = path + r"\hex.svg" |
| 45 | +guiIconPath = os.path.join(path, 'hex.svg') |
46 | 46 |
|
47 | 47 | Ui_MainWin, QtBaseClass = uic.loadUiType(mainWinGUI) |
48 | 48 | Ui_ExtPrompt, QtBaseClass = uic.loadUiType(plotExtentGUI) |
@@ -2952,8 +2952,8 @@ def closeEvent(self, e): |
2952 | 2952 | if __name__ == "__main__": |
2953 | 2953 | global app |
2954 | 2954 | app = QtGui.QApplication([]) |
2955 | | - from qtreactor import pyqt4reactor |
2956 | | - pyqt4reactor.install() |
| 2955 | + import qt5reactor |
| 2956 | + qt5reactor.install() |
2957 | 2957 | from twisted.internet import reactor |
2958 | 2958 | window = dvPlotter(reactor) |
2959 | 2959 | window.show() |
|
0 commit comments