11. Custom Widgets

One of PyQt’s greatest and longest-standing strengths is the ease with which it is possible to create custom widgets. The custom widgets we create with PyQt are made the same way as the standard built-in widgets, so they integrate seamlessly and have no arbitrary restrictions on their appearance or behavior. Creating custom widgets in PyQt is not a matter of “one size fits all”. Rather, we can choose from a number of approaches that give us increasing levels of control over our widgets’ behavior and appearance.

The most basic level of customization is to simply set some of the properties of an existing widget. We have already ...

Get Rapid GUI Programming with Python and Qt: The Definitive Guide to PyQt Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.