O'Reilly logo

PySide GUI Application Development - Second Edition by Venkateshwaran Loganathan, Gopinath Jaganmohan

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 that is 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, time from PySide.QtGui import * # Our main window class class MainWindow(QMainWindow): # Constructor function def __init__(self, fileName=None): super(MainWindow,self).__init__() self.initGUI() def initGUI(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) ...

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