Book Image

PySide GUI Application Development - Second Edition

By : Venkateshwaran Loganathan, Gopinath Jaganmohan
Book Image

PySide GUI Application Development - Second Edition

By: Venkateshwaran Loganathan, Gopinath Jaganmohan

Overview of this book

Elegantly-built GUI applications are always a massive hit among users. PySide is an open source software project that provides Python bindings for the Qt cross-platform UI framework. Combining the power of Qt and Python, PySide provides easy access to the Qt framework for Python developers and also acts as an excellent rapid application development platform. This book will take you through everything you need to know to develop UI applications. You will learn about installing and building PySide in various major operating systems as well as the basics of GUI programming. The book will then move on to discuss event management, signals and slots, and the widgets and dialogs available with PySide. Database interaction and manipulation is also covered. By the end of this book, you will be able to program GUI applications efficiently and master how to develop your own applications and how to run them across platforms.
Table of Contents (13 chapters)

Creating the application icon

We created our sample window, and now we go on to customize it with some features fitting our needs. For each customization, we add a new function under the SampleWindow class in the previous program to define its properties, and we call this our main function to apply these properties on the sample window. In this section, we define an icon to be set on the window that we created. An icon is a small image that is created to visually emphasize the purpose of the program. It is displayed in the top-left corner of the application window. The same is also displayed in the taskbar when the application is minimized. As a prerequisite for this program, you may need an icon image with dimensions similar to the image that is used here (72 X 72). You can create your own image or download it from the book's website if you wish to use the one used in this program:

# Import required modules
import sys, time
from PySide.QtGui import QApplication, QWidget, QIcon

# Our main...