Skip to content
Snippets Groups Projects

Add scheduler GUI

Merged Oscar Gustafsson requested to merge scheduler-gui into master
4 files
+ 100
193
Compare changes
  • Side-by-side
  • Inline
Files
4
@@ -44,22 +44,22 @@ if __debug__:
raise
elif QT_API.lower() == 'pyside2':
# try:
# from ui.main_window_ui import Ui_MainWindow
# except ImportError:
try:
from ui.main_window_ui import Ui_MainWindow
except ImportError:
try:
import subprocess
OS = sys.platform
if OS.startswith('linux'):
cmds = ["mkdir -p ui", "pyside2-uic -o ui/main_window_ui.py main_window.ui"]
for cmd in cmds:
print('$ ' + cmd)
subprocess.call(cmd.split())
else:
print('ERROR: Autocompile for ' + OS + ' is currently not supported.')
raise SystemExit
except:
raise
import subprocess
OS = sys.platform
if OS.startswith('linux'):
cmds = ["mkdir -p ui", "pyside2-uic -o ui/main_window_ui.py main_window.ui"]
for cmd in cmds:
print('$ ' + cmd)
subprocess.call(cmd.split())
else:
print('ERROR: Autocompile for ' + OS + ' is currently not supported.')
raise SystemExit
except:
raise
except:
print("ERROR: Could not import 'Ui_MainWindow'.")
print("ERROR: Can't autocompile under " + QT_API + " eviroment. Try to manual compile 'main_window.ui' to 'ui/main_window_ui.py'")
@@ -127,15 +127,16 @@ class MainWindow(QMainWindow, Ui_MainWindow):
#print('self:\t\t' + str(type(self)))
def _init_graphics_view(self):
self.setCentralWidget(self.graphicsView)
# pass
# self.scene = QGraphicsScene(self)
# self.graphic_view = QGraphicsView(self.scene, self)
# self.graphic_view.setRenderHint(QPainter.Antialiasing)
# self.graphic_view.setGeometry(20, 20, self.width(), self.height())
# self.graphic_view.setDragMode(QGraphicsView.RubberBandDrag)
# print(self.centralwidget.baseSize())
self.scene = QGraphicsScene(self)
self.graphic_view = QGraphicsView(self.scene, self)
self.graphic_view.setRenderHint(QPainter.Antialiasing)
self.graphic_view.setGeometry(20, 20, self.width(), self.height())
self.graphic_view.setDragMode(QGraphicsView.RubberBandDrag)
print(self.centralwidget.baseSize())
self.setupUi(self) # Need to setup ui again
#self.setupUi(self) # Need to setup ui again
@Slot()
@@ -163,7 +164,8 @@ class MainWindow(QMainWindow, Ui_MainWindow):
def printButtonPressed(self, func_name: str):
self.label_2.setText("hello")
self.label.setText("hello")
alert = QMessageBox(self)
alert.setText("Called from " + func_name + '!')
Loading