We will change the top widget again adding a ''KMainWindow'' to contain our ''QWidget''.

We will change the top widget again adding a ''KMainWindow'' to contain our ''QWidget''.

−

<code python>

+

<syntaxhighlight lang="python">

self.window = KMainWindow()

self.window = KMainWindow()

self.widget = QWidget()

self.widget = QWidget()

self.window.setCentralWidget(self.widget)

self.window.setCentralWidget(self.widget)

−

</code>

+

</syntaxhighlight>

A [http://api.kde.org/pykde-4.1-api/kdeui/KMainWindow.html KMainWindow] is intended to be the top level widget in most KDE applications. It makes it very easy to add menus, toolbars and a statusbar to your application. In this example I'm afraid to say it exists only to work around a bug where the application crashes if we don't use it.

A [http://api.kde.org/pykde-4.1-api/kdeui/KMainWindow.html KMainWindow] is intended to be the top level widget in most KDE applications. It makes it very easy to add menus, toolbars and a statusbar to your application. In this example I'm afraid to say it exists only to work around a bug where the application crashes if we don't use it.

Latest revision as of 20:50, 29 June 2011

We will change the top widget again adding a KMainWindow to contain our QWidget.

A KMainWindow is intended to be the top level widget in most KDE applications. It makes it very easy to add menus, toolbars and a statusbar to your application. In this example I'm afraid to say it exists only to work around a bug where the application crashes if we don't use it.