<--SyntaxHighlighter--> SyntaxHighlighter.all();

 

 

import sys
import os
from PySide2 import QtUiTools, QtGui
from PySide2.QtWidgets import QApplication, QMainWindow
from PySide2.QtCore import Slot, Qt


class MainView(QMainWindow):
    def setupUI(self):
        global UI_set

        UI_set = QtUiTools.QUiLoader().load("./test.ui")

        self.setCentralWidget(UI_set)
        self.setWindowTitle("UI TEST")
        self.setWindowIcon(QtGui.QPixmap("./images/clock.ico"))
        self.resize(500, 270)
        self.show()

    def __init__(self):
        super().__init__()
        self.setupUI()
        UI_set.pushButton.clicked.connect(self.clicked)


    @Slot()
    def clicked(self):
        UI_set.label.setText("Hello")

if __name__ == '__main__':
    app = QApplication(sys.argv)
    main = MainView()
    # main.show()
    sys.exit(app.exec_())

 

+ Recent posts