KDE 4.7 PyKDE API Reference

- KDE's Python API

# MainWindow Class Reference

`from PyKDE4.kparts import *`

Inherits: KXmlGuiWindow → KMainWindow → QMainWindow → QWidget → QObject,KParts.PartBase → KXMLGUIClient
Namespace: KParts

## Detailed Description

A KPart-aware main window, whose user interface is described in XML.

Inherit your main window from this class and don't forget to call setXMLFile() in the inherited constructor.

It implements all internal interfaces in the case of a KMainWindow as host: the builder and servant interface (for menu merging).

## Methods
| __init__ (self, QWidget parent=0, Qt::WindowFlags f=0)
| __init__ (self, QWidget parent, QString name=0, Qt::WindowFlags f=0)
| configureToolbars (self)
| createGUI (self, KParts.Part part)
| createShellGUI (self, bool create=1)
| saveNewToolbarConfig (self)
| slotSetStatusBarText (self, QString a0)

## Method Documentation

__init__ | ( | self, |
|  | QWidget | parent=0,
|  | Qt::WindowFlags | f=0
| ) |  |  |

Constructor, same signature as KMainWindow.

__init__ | ( | self, |
|  | QWidget | parent,
|  | QString | name=0,
|  | Qt::WindowFlags | f=0
| ) |  |  |

configureToolbars | ( |  | self ) |

createGUI | ( | self, |
|  | KParts.Part | part
| ) |  |  |

Create the GUI (by merging the host's and the active part's) You _must_ call this in order to see any GUI being created.

In a main window with multiple parts being shown (e.g. as in Konqueror) you need to connect this slot to the KPartManager.activePartChanged() signal

Parameters:

  | part | The active part (set to 0L if no part).

createShellGUI | ( | self, |
|  | bool | create=1
| ) |  |  |

saveNewToolbarConfig | ( |  | self ) |

Rebuilds the GUI after KEditToolbar changed the toolbar layout.

See also:
  configureToolbars() KDE4: make this virtual. (For now we rely on the fact that it's called as a slot, so the metaobject finds it here).

slotSetStatusBarText | ( | self, |
|  | QString | a0
| ) |  |  |

Called when the active part wants to change the statusbar message Reimplement if your mainwindow has a complex statusbar (with several items)