MainWindow.py 813 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 .GenericoW import Ui_Generico
Pedro Henrique Kopper's avatar
Pedro Henrique Kopper committed
4
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
        # Faz o app funcionar em telas burguesas safadas com DPI alto
10 11
        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
12 13 14 15

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

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

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

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