import sys from PyQt5 import QtWidgets, QtCore from PyQt5.QtCore import QTimer from .GenericoW import Ui_Generico from threads.MainThread import MainThread class Ui_MainWindow(object): def __init__(self): # Faz o app funcionar em telas burguesas safadas com DPI alto QtWidgets.QApplication.setAttribute(QtCore.Qt.AA_EnableHighDpiScaling, True) #enable highdpi scaling QtWidgets.QApplication.setAttribute(QtCore.Qt.AA_UseHighDpiPixmaps, True) #use highdpi icons self.app = QtWidgets.QApplication(sys.argv) self.dialog = QtWidgets.QMainWindow() self.ui = Ui_Generico() self.ui.setupUi(self.dialog) print(self.ui) self.timer = QTimer(self.app) self.main_thread = MainThread(self.ui, self.timer) self.dialog.showMaximized() #main_thread.finished.connect(self.app.exit) #main_thread.start()