Run-time integration with TQt-Designer
Prev
Next

Chapter 4. Run-time integration with TQt-Designer

Qt-Designer is a graphical application used for designing user interfaces. It creates .ui files. These files need to be converted into Python classes before they can be used in a Python application. This can be manually done using the pyuic command from the shell. But it is a lot more convenient to let PyTDE Extensions to this automatically for you. All you need to do is import the tqtdesigner or tdedesigner module, depending on whether your application is pure TQt or uses TDE, and then you can import your user interface files as though they were normal Python files.

#!/usr/bin/env python
from tdeui import *

import tdedesigner     # This module lets us import .ui file directly.
from MyWindow import * # Loads MyWindow.ui

# Subclass the TQt-designer form.
class MyWindowCode(MyWindow):
    # Implement extra functionality and methods.
The tdedesigner/tqtdesigner module converts .ui on demand to .py files.

Prev
Next
Home


Would you like to comment or contribute an update to this page?
Send feedback to the TDE Development Team