|
@@ -5,7 +5,7 @@
|
|
|
|
|
|
|
|
from timeit import timeit
|
|
from timeit import timeit
|
|
|
|
|
|
|
|
-from PyQt5.Qt import Qt
|
|
|
|
|
|
|
+from PyQt5.Qt import Qt, QEvent
|
|
|
from PyQt5.QtCore import QPointF
|
|
from PyQt5.QtCore import QPointF
|
|
|
from PyQt5.QtWidgets import QMainWindow, \
|
|
from PyQt5.QtWidgets import QMainWindow, \
|
|
|
QApplication, QGraphicsScene, QGraphicsView
|
|
QApplication, QGraphicsScene, QGraphicsView
|
|
@@ -59,10 +59,20 @@ class GridViewer(QMainWindow):
|
|
|
self.ui.view.centerOn(QPointF(0, 0))
|
|
self.ui.view.centerOn(QPointF(0, 0))
|
|
|
|
|
|
|
|
self.ui.view.setViewportUpdateMode(QGraphicsView.BoundingRectViewportUpdate)
|
|
self.ui.view.setViewportUpdateMode(QGraphicsView.BoundingRectViewportUpdate)
|
|
|
-
|
|
|
|
|
self.ui.view.setDragMode(QGraphicsView.NoDrag)
|
|
self.ui.view.setDragMode(QGraphicsView.NoDrag)
|
|
|
self.ui.view.setTransformationAnchor(QGraphicsView.AnchorUnderMouse)
|
|
self.ui.view.setTransformationAnchor(QGraphicsView.AnchorUnderMouse)
|
|
|
|
|
|
|
|
|
|
+ self.ui.view.viewport().installEventFilter(self)
|
|
|
|
|
+
|
|
|
|
|
+ def eventFilter(self, obj, event):
|
|
|
|
|
+ if event.type() == QEvent.Wheel:
|
|
|
|
|
+ if event.angleDelta().y() > 0:
|
|
|
|
|
+ self.zoom_plus()
|
|
|
|
|
+ elif event.angleDelta().y() < 0:
|
|
|
|
|
+ self.zoom_minus()
|
|
|
|
|
+ return True
|
|
|
|
|
+ return False
|
|
|
|
|
+
|
|
|
def make_grid(self, grid):
|
|
def make_grid(self, grid):
|
|
|
QApplication.setOverrideCursor(Qt.WaitCursor)
|
|
QApplication.setOverrideCursor(Qt.WaitCursor)
|
|
|
self.grid = grid
|
|
self.grid = grid
|
|
@@ -123,26 +133,6 @@ class GridViewer(QMainWindow):
|
|
|
new_lst = ListViewDialog(self.selection).exec_()
|
|
new_lst = ListViewDialog(self.selection).exec_()
|
|
|
self.update_selected_cells(new_lst)
|
|
self.update_selected_cells(new_lst)
|
|
|
|
|
|
|
|
- def wheelEvent(self, event):
|
|
|
|
|
- if event.angleDelta().y() > 0:
|
|
|
|
|
-# self.zoom_plus()
|
|
|
|
|
- event.accept()
|
|
|
|
|
- elif event.angleDelta().y() < 0:
|
|
|
|
|
-# self.zoom_minus()
|
|
|
|
|
- event.accept()
|
|
|
|
|
- else:
|
|
|
|
|
- event.ignore()
|
|
|
|
|
-
|
|
|
|
|
- def keyPressEvent(self, event):
|
|
|
|
|
- if event.key() == Qt.Key_Left:
|
|
|
|
|
- pass
|
|
|
|
|
- elif event.key() == Qt.Key_Right:
|
|
|
|
|
- pass
|
|
|
|
|
- elif event.key() == Qt.Key_Down:
|
|
|
|
|
- pass
|
|
|
|
|
- elif event.key() == Qt.Key_Up:
|
|
|
|
|
- pass
|
|
|
|
|
-
|
|
|
|
|
def job_names(self):
|
|
def job_names(self):
|
|
|
with open("jobs.yml", "r") as f:
|
|
with open("jobs.yml", "r") as f:
|
|
|
jobs = yaml.load(f)
|
|
jobs = yaml.load(f)
|