O'Reilly logo

PySide GUI Application Development by Venkateshwaran Loganathan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

A simple text editor

The following is the implementation of a simple text editor extended from the previous examples in its building version. This code contains some new features such as, QFontDialog, QFileDialog, and so on; which are discussed in Chapter 5, Dialogs and Widgets. Otherwise, the following code is self explanatory:

# Import required modules import sys from PySide.QtGui import * class MainWindow(QMainWindow): """ Our Main Window class """ def __init__(self, fileName=None): """ Constructor Function """ QMainWindow.__init__(self) self.setWindowTitle("A Simple Text Editor") self.setWindowIcon(QIcon('appicon.png')) self.setGeometry(100, 100, 800, 600) self.textEdit = QTextEdit() self.setCentralWidget(self.textEdit) self.fileName = None ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required