MainWindow.py 717 Bytes
Newer Older
Pedro Henrique Kopper's avatar
Pedro Henrique Kopper committed
1
import sys
Pedro Henrique Kopper's avatar
Pedro Henrique Kopper committed
2
from PyQt5 import QtWidgets, QtCore
Pedro Henrique Kopper's avatar
Pedro Henrique Kopper committed
3
4
from ui.CalibracaoPressaoW import Ui_CalibracaoPressaoW
from threads.MainThread import MainThread
Pedro Henrique Kopper's avatar
Pedro Henrique Kopper committed
5
6
7
8

class Ui_MainWindow(object):

    def __init__(self):
Pedro Henrique Kopper's avatar
Pedro Henrique Kopper committed
9
10
        # Faz o app funcionar em telas burguesas safadas com DPI alto
        QtWidgets.QApplication.setAttribute(QtCore.Qt.AA_EnableHighDpiScaling, True)
Pedro Henrique Kopper's avatar
Pedro Henrique Kopper committed
11
12
13
14
15
16
17

        self.app = QtWidgets.QApplication(sys.argv)
        self.dialog = QtWidgets.QMainWindow()

        self.ui = Ui_CalibracaoPressaoW()
        self.ui.setupUi(self.dialog)

Pedro Henrique Kopper's avatar
Pedro Henrique Kopper committed
18
        print(self.ui)
Pedro Henrique Kopper's avatar
Pedro Henrique Kopper committed
19
20
21
22
        main_thread = MainThread(self.ui)
        main_thread.finished.connect(self.app.exit)
        main_thread.start()

Pedro Henrique Kopper's avatar
Pedro Henrique Kopper committed
23
        self.dialog.showMaximized()