Difference between revisions of "Development/Languages/Python/PyKDE WebKit Tutorial/Part5"

Jump to: navigation, search
m (Text replace - "</code>" to "</syntaxhighlight>")
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
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.
Line 15: Line 15:
 
[[image:Pykde-tutorial-2.png|center]]
 
[[image:Pykde-tutorial-2.png|center]]
  
[[Development/Languages/Python/PyKDE_WebKit_Tutorial/Part4|« On to Part 4]] [[Development/Languages/Python/PyKDE_WebKit_Tutorial/Part6|On to Part 6 »]]
+
[[Development/Languages/Python/PyKDE_WebKit_Tutorial/Part4|« Back to Part 4]] | [[Development/Languages/Python/PyKDE_WebKit_Tutorial/Part6|On to Part 6 »]]
 +
[[Category:Python]]

Latest revision as of 20:50, 29 June 2011

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

        self.window = KMainWindow()
        self.widget = QWidget()
        self.window.setCentralWidget(self.widget)

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.

See the full code.

This version will look the same as the previous.

Pykde-tutorial-2.png

« Back to Part 4 | On to Part 6 »


This page was last modified on 29 June 2011, at 20:50. This page has been accessed 4,858 times. Content is available under Creative Commons License SA 3.0 as well as the GNU Free Documentation License 1.2.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V.Legal