MainWindow.py 900 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
3
from PyQt5.QtCore import QTimer
4
from .GenericoW import Ui_Generico
Pedro Henrique Kopper's avatar
Pedro Henrique Kopper committed
5
from threads.MainThread import MainThread
Pedro Henrique Kopper's avatar
Pedro Henrique Kopper committed
6
7
8
9

class Ui_MainWindow(object):

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

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

17
        self.ui = Ui_Generico()
Pedro Henrique Kopper's avatar
Pedro Henrique Kopper committed
18
19
        self.ui.setupUi(self.dialog)

Pedro Henrique Kopper's avatar
Pedro Henrique Kopper committed
20
        print(self.ui)
Pedro Henrique Kopper's avatar
Pedro Henrique Kopper committed
21

22
23
        self.timer = QTimer(self.app)
        self.main_thread = MainThread(self.ui, self.timer)
Pedro Henrique Kopper's avatar
Pedro Henrique Kopper committed
24
        self.dialog.showMaximized()
25
26
        #main_thread.finished.connect(self.app.exit)
        #main_thread.start()