4 задача

This commit is contained in:
2023-01-30 19:34:51 +07:00
parent b95d3e4680
commit 94480dcd0c
3 changed files with 18 additions and 8 deletions
+17 -8
View File
@@ -1,26 +1,28 @@
from PyQt5.QtWidgets import *
from PyQt5.QtGui import QPixmap
import sys
from PyQt5 import uic
from PyQt5 import QtCore
from functions.get_img_map import get_img_map
class Window(QMainWindow):
def __init__(self):
super().__init__()
super().__init__(None)
uic.loadUi('window.ui', self)
self.pixmap = None
self.acceptDrops()
self.setWindowTitle("Image")
self.setGeometry(0, 0, 600, 450)
self.label = QLabel(self)
self.delta = 0.02
self.lon = 37.530887
self.lat = 55.703118
self.variant_map = "map"
get_img_map(self.delta, (self.lon, self.lat), self.variant_map)
self.pixmap = QPixmap('image.png')
self.label.setPixmap(self.pixmap)
self.label.resize(self.pixmap.width(), self.pixmap.height())
self.show()
self.update()
self.button_group = QButtonGroup()
self.button_group.addButton(self.map)
self.button_group.addButton(self.sat)
self.button_group.addButton(self.skl)
self.button_group.buttonClicked.connect(self.push_button)
def keyPressEvent(self, event):
try:
@@ -53,6 +55,13 @@ class Window(QMainWindow):
self.label.resize(self.pixmap.width(), self.pixmap.height())
self.show()
def push_button(self, button):
if button.text() == "skl":
self.variant_map = "sat,skl"
else:
self.variant_map = button.text()
self.update()
App = QApplication(sys.argv)
window = Window()