- Create the GUI in QTDesigner
- Set names in the Property Editor to ease coding of the application (QTDesigner)
- Using pyuic4 create the python GUI class
- Call the application using that GUI class
- Extend it with our own slots
- When you use a widget you go to PyQt's Classes and check methods of each used widgets. The method names as "setText" are very easy to understand.
Tutorials List
- Simple text editor in PyQT4 - First application in PyQT4
- Extending PyQT4 text editor - Adding more features using PyQT4 widgets
- QYolk I - List widgets in PyQt4 - How to use list widgets in PyQt4
- QYolk II - Containers - How to use a Tab Widget
- PyQT4 Text editor - final changes - Some advanced PyQT4 features
- QYolk III - List of updates - A new feature
- WebKit in PyQt - rendering web pages - qt-webkit provides WebKit API in the Qt library and it can be use in PyQt to render web pages
- PyQt events - A description of Qt events, and QListWidget example of handling mouse events.
- QtSql in PyQt4 - handling databases - Overview of QtSql classes in PyQt that allow managing databases and grid integration
- QGraphicsView and QGraphicsScene - Description of widgets for visualizing 2D data (images etc.)
- QTimer - making timers in PyQt4 - Description of timers available in PyQt4
- QScintilla2 and PyQT4 - Adding widgets for programmers to PyQt4.
- Making PyQt4 widgets with SIP - Tutorial on making PyQt4 widgets from Qt4 widgets using SIP.
- PictureFlow - listing images in PyQt4 - PictureFlow - extra PyQt4 widget
- Rendering PDF files in PyQt4 with pypoppler-qt4 - Description of pypoppler-qt4 - bindings for Poppler library.
Introduction
We start with a "Hello... Close Button". When you launch the QTDesigner you will be able to chose base window type:





pyuic4 test.ui > test_ui.py
Next create test.py file with the code:
And run it:
python test.py
You will see our application, and when you click the button it will close.Notes
Ui_Form is the class name generated by pyuic4 the "Form" part is the name of the main window. You can change it in QTDesigner (we will do this in next tutorial). You have to change the objectName: