混合pyqt和qtcreator

目的:测试能否用qtcreator编辑ui资源,而用python编写代码逻辑

import sys
from PyQt4 import QtGui, uic

class MyWindow(QtGui.QMainWindow):
def __init__(self):
super(MyWindow, self).__init__()
uic.loadUi('mywindow.ui', self)

self.actionLoad_Image.triggered.connect(self.myactionLoad_Image)

self.show()

def myactionLoad_Image(self):
print ('hello')

if __name__ == '__main__':
app = QtGui.QApplication(sys.argv)
window = MyWindow()
sys.exit(app.exec_())

posted on 2018-04-08 22:59  cutepig  阅读(400)  评论(0编辑  收藏  举报

导航