Another way to use .ui in your code:
from PyQt4 import QtCore, QtGui, uic class MyWidget(QtGui.QWidget) ... #somewhere in constructor: uic.loadUi('MyWidget.ui', self)
both approaches are good. Remember that if you use Qt resource files (extremely useful) for icons, etc., you should also compile it:
pyrcc4.exe -o ui/images_rc.py ui/images/images.qrc
Note that when uic compiles the interface, it adds "import images_rc" to the end of the .py file, so you must compile the resources into a file with that name or rename it to the generated code.
Maxim Popravko Mar 23 '10 at 14:59 2010-03-23 14:59
source share