forked from AspirantDrago/YandexMaps
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
32 lines (27 loc) · 995 Bytes
/
Copy pathapp.py
File metadata and controls
32 lines (27 loc) · 995 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
from asyncio import Event
from PyQt6.QtCore import Qt
from PyQt6.QtGui import QKeyEvent
from PyQt6.QtWidgets import QMainWindow
from forms.main_window import Ui_MainWindow
from src.controller import MapController
class App(QMainWindow, Ui_MainWindow):
def __init__(self):
super().__init__()
self.setupUi(self)
self._controller = MapController()
self._controller.set_view(self.map_canvas)
self._controller.update()
def keyPressEvent(self, event: QKeyEvent):
match event.key():
case Qt.Key.Key_PageUp:
self._controller.scale_up()
case Qt.Key.Key_PageDown:
self._controller.scale_down()
case Qt.Key.Key_Left:
self._controller.left()
case Qt.Key.Key_Right:
self._controller.right()
case Qt.Key.Key_Up:
self._controller.up()
case Qt.Key.Key_Down:
self._controller.down()