PyKDE Programming/QT

A basic QT Application (with a widget)
You will create your first Window in this application. Did you notice the differences? You did less and got more. But don’t let this fool you. KDE requires this information, but from now on, i doesn’t get any more complicated in KDE than in pure Qt.

Maybe you did spot what we did now and didn’t do earlier: We constructed a widget and showed it. Clicking on the standard “x”-button it closes the whole application by default, but you can change that, of course. You can now transfer the widget-code into the KDE application but you wouldn’t want to write KDE applications if you didn’t want to use KDE’s features, do you?

Let’s move on, but without wasting space: I will leave out everything redundant now, you should keep it in your script, though. Everything we care about now is what we can do between these two lines: What about using our window as a frame for other widgets?

In order to do that, we will need a so-called layout and add our widgets to it: What have we done? Quite something, I guess. We have:
 * Created and shown our widget, as we did before
 * Created a layout which stacks widgets vertically (VBox) and told the widget to use it
 * Added two more widgets to it, both containing text. (As you can see, the QLabel even supports HTML-stuff like the &lt;br&gt;-linebreak)