混合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_())

Powered by Jekyll and Theme by solid

本站总访问量