by tangke <> 2009-06-10
PyQt和Qt程序的转换
安装转换工具
apt-get install pyqt4-dev-tools
//基于Qt4版本编写的Qt代码转换
apt-get install pyqt-tools
//基于Qt3版本编写的Qt代码转换
安装完之后我们看一下pyqt4-dev-tools里面的文件:
dpkg -L pyqt4-dev-tools
/.
/usr
/usr/share
/usr/share/doc
/usr/share/doc/pyqt4-dev-tools
/usr/share/doc/pyqt4-dev-tools/changelog.gz
/usr/share/doc/pyqt4-dev-tools/changelog.Debian.gz
/usr/share/doc/pyqt4-dev-tools/THANKS
/usr/share/doc/pyqt4-dev-tools/copyright
/usr/share/doc/pyqt4-dev-tools/NEWS.gz
/usr/share/man
/usr/share/man/man1
/usr/share/man/man1/pyuic4.1.gz
/usr/share/man/man1/pyrcc4.1.gz
/usr/share/man/man1/pylupdate4.1.gz
/usr/bin
/usr/bin/pyuic4
/usr/bin/pyrcc4
/usr/bin/pylupdate4
pyuic4 -x patch_widget.ui
#
-*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'patch_widget.ui'
#
# Created: Wed Jun 10 13:27:26 2009
# by: PyQt4 UI code generator 4.4.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
class Ui_patch_widgetClass(object): def setupUi(self,
patch_widgetClass):
patch_widgetClass.setObjectName("patch_widgetClass")
patch_widgetClass.resize(400, 39)
self.retranslateUi(patch_widgetClass)
QtCore.QMetaObject.connectSlotsByName(patch_widgetClass) def
retranslateUi(self, patch_widgetClass):
patch_widgetClass.setWindowTitle(QtGui.QApplication.translate("patch_widgetClass",
"patch_widget", None, QtGui.QApplication.UnicodeUTF8))
if __name__ == "__main__": import sys app =
QtGui.QApplication(sys.argv) patch_widgetClass = QtGui.QWidget() ui
= Ui_patch_widgetClass() ui.setupUi(patch_widgetClass)
patch_widgetClass.show() sys.exit(app.exec_())
阅读(495) | 评论(0) | 转发(0) |