#!python3
# -*- coding: utf-8 -*-
import sys
import os.path
from PySide2 import QtCore, QtGui, QtWidgets
from PySide2.QtUiTools import QUiLoader
CURRENT_PATH = os.path.dirname(os.path.abspath(sys.argv[0]))
class UISample(QtWidgets.QMainWindow):
def __init__(self, parent=None):
super(UISample, self).__init__(parent)
self.ui = QUiLoader().load(os.path.join(CURRENT_PATH, 'sample_btn_ui.ui'))
self.setCentralWidget(self.ui)
# Signal作成
self.ui.pushButton.clicked.connect(self.click_btn)
def click_btn(self):
# 押したときの動作
print("push!!")
if __name__ == '__main__':
app = QtWidgets.QApplication(sys.argv)
a = UISample()
a.show()
sys.exit(app.exec_())