Blog Archives

PyQt4: Getting into depth

Now let us add some functionalities to the window generated. For that, I am listing the APIs to create any widget and handling signals & slots:

To create any widget:

1. textbox=QtGui.QTextBox(“content of the text box”)

Note:This will work fine unless until you need to access this textbox in some function treating it as a global variable. To avoid the errors in future, use this line:

self.textbox=QtGui.QTextBox(“content of the text box”)

adding self in beginning will make textbox an attribute of the window under which it is created.

2. self.label=QtGui.QLabel(“content of the label”)

3. self.pushbutton=QtGui.QPushButton(“text on pushbutton”)

to create singnals and slots:

This can be achieved in two ways:
1.New version API- QtCore.QObject.Connect method:
QtCore.QObject.Connect(<name of the object generating signal>,QtCore.SIGNAL(“<signal name>”), <slot>)


QtCore.QObject.Connect(self.pushbutton,QtCore.SIGNAL(“clicked()”),   self.on_pushbutton_click) Read the rest of this entry


Qt: Introduction

Hii friends, this time i am going to share my little knowledge about Qt… i.e.. what is Qt, why it is used, and (obviously) how it is used 😛 Later on, in the successive blogs, I will show how to write applications in Qt.

Qt is basically a cross-platform c++ based application framework. Cross-


platform means that the code you write on one platform (ex. Linux) can get compiled easily on another platform (ex. Linux). Qt is mainly used for designing GUI (graphical user interface ) applications and some non-GUI application like console for servers. Qt finds its application in VLC media player, AutoDesk Maya, Fedora(KDE framework), Mathematica, OPERA MINI (upto version 10.0). The companies using Qt comprises of NOKIA, Samsung, Google (google server consoles), Research In Motion etc. Read the rest of this entry