Firstly, using pyuic4
is certainly not "bad practice".
There are three main ways to get PyQt4 UI's into your code:
- Write it all by hand yourself
- Use
pyuic4
to auto-generate a python module that can be imported
- Use the
uic
package to load ui
files directly at runtime
Of these, the first two are by far the most common, and most documentation, tutorials, advice, etc that you will come across will use those methods.
A good source for PyQt4 tutorials can be found in this section of the PyQt4 Wiki. However, I should probably point out that, although still relevant, many of them are quite old and so still use the old-style signals and slots.
However, the difference between the old- and new- styles is not that difficult to understand, so maybe a simple example is all that's needed.
Here's the old-style way to connect a button-click signal to a handler method (aka slot):
self.connect(self.button, QtCore.SIGNAL('clicked()'), self.handleButtonClick)
and here's the new-style way:
self.button.clicked(self.handleButtonClick)
As you can see, the new-style is much simpler and more pythonic. On the other hand, the old-style is quite similar to how signals are connected using C++ (and for this reason can still be useful in certain circumstances).
If you have problems with connecting signals when writing your GUIs, you can always ask a question here - but it's much easier to get good answers if you ask specific questions that include example code.