class KTMainWindow

KDE top level main window. More...

Definition#include <ktmainwindow.h>
InheritsKMainWindow
Inherited byKDockMainWindow
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods

Protected Slots


Detailed Description

Compatibility top level widget class

This class is intended to make porting of KDE-1.x applications easier. For new applications, use its base class KMainWindow.

 KTMainWindow ( const char *name = 0, WFlags f = WDestructiveClose )

Construct a main window.

KTMainWindows must be created on the heap with 'new', like:

 KTMainWindow *ktmw = new KTMainWindow (...</pre>

Parameters:
nameThe object name. For session management to work properly, all main windows in the application have to have a different name. When passing 0 (the default), KTMainWindow will create such a name for you. So simply never pass anything else ;-)
fSpecify the widget flags. The default is WDestructiveClose. It indicates that a main window is automatically destroyed when its window is closed. Pass 0 if you do not want this behaviour.

KTMainWindow ()

[virtual]

Destructor.

Will also destroy the toolbars, and menubar if needed.

void  setView ( QWidget *w, bool = FALSE )

Set the main client widget.

This is the main widget for your application; it's geometry will be automatically managed by KTMainWindow to fit the client area, constrained by the positions of the menu, toolbars and status bar. It can be fixed-width or Y-fixed.

Only one client widget can be handled at a time. Multiple calls of setView() will cause only the last widget to be added to be properly handled. The layout management will not start before this function has been called. It increases the application start speed to call this function after all bars have been registered. The presence of the view widget is mandatory for the class to operate.

The widget must have been created with this instance of KTMainWindow as its parent.

QWidgetview ()

[const]

Retrieve the view widget.

void  enableStatusBar ( KStatusBar::BarStatus stat = KStatusBar::Toggle )

Enable or disable the status bar.

void  enableToolBar ( KToolBar::BarStatus stat = KToolBar::Toggle, int id = 0 )

Enable or disable the toolbar with the specified @id.

If no id is specified, the default id of 0 is used.

void  setEnableToolBar ( KToolBar::BarStatus stat = KToolBar::Toggle, const char * name = "mainToolBar" )

Enable or disable the toolbar with the specified name (as determined by the XML UI framework).

int  addToolBar ( KToolBar *toolbar, int index = -1 )

Add a toolbar to the widget.

A toolbar added to this widget will be automatically laid out by it.

The toolbar must have been created with this instance of KTMainWindow as its parent.

Usually you do not need this function. Just refer to a toolbar with toolBar(index) instead and the KTMainWindow will create it for you. Anyway addToolBar() is useful if you want to pass additional arguments to the toolbar's constructor.

void  setMenu (KMenuBar * )

void  setStatusBar ( KStatusBar * )

void  updateRects ()

[protected virtual slot]