# class KTMainWindow | KDE top level main window. More...
Deprecated! use with care
Definition | `#include <ktmainwindow.h>`
Inherits | KMainWindow [public ]
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

#### Public Methods

- KTMainWindow ( const char *name = 0, WFlags f = WDestructiveClose )
- virtual ~KTMainWindow ()
- void setView ( QWidget *w, bool = FALSE )
- QWidget * view () const
- void enableStatusBar ( KStatusBar::BarStatus stat = KStatusBar::Toggle )
- void enableToolBar ( KToolBar::BarStatus stat = KToolBar::Toggle, int id = 0 )
- void setEnableToolBar ( KToolBar::BarStatus stat = KToolBar::Toggle, const char * name = "mainToolBar" )
- int addToolBar ( KToolBar *toolbar, int index = -1 )
- KToolBar * toolBar ( int id = 0 )
- void setMenu (KMenuBar * )
- void setStatusBar ( KStatusBar * )
- bool hasMenuBar ()
- bool hasStatusBar ()
- bool hasToolBar ( int id = 0 )

#### Protected Slots

- virtual void updateRects ()

## 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.

See also: KApplication

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

Construct a main window.

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

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

Parameters:

name | The 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 ;-)
f | Specify 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 () | ### ~KTMainWindow

[virtual]

Destructor.

Will also destroy the toolbars, and menubar if needed.

void setView ( QWidget *w, bool = FALSE ) | ### setView

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.

QWidget * view () | ### view

[const]

Retrieve the view widget.

See also: setView()

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

Enable or disable the status bar.

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

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" ) | ### setEnableToolBar

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

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

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.

Reimplemented from QMainWindow.

KToolBar * toolBar ( int id = 0 ) | ### toolBar

Retrieve a pointer to the toolbar with the specified id.

If there is no such tool bar yet, it will be generated.

Reimplemented from KMainWindow.

void setMenu (KMenuBar * ) | ### setMenu

void setStatusBar ( KStatusBar * ) | ### setStatusBar

bool hasMenuBar () | ### hasMenuBar

Returns: `true` if the menubar exists.

bool hasStatusBar () | ### hasStatusBar

Returns: `true` if the statusbar exists.

bool hasToolBar ( int id = 0 ) | ### hasToolBar

Returns: `true` if the specified toolbar exists.

void updateRects () | ### updateRects

[protected slots virtual slot]

- Author: Reginald Stadlbauer (reggie@kde.org) Stephan Kulow (coolo@kde.org), Matthias Ettrich (ettrich@kde.org), Chris Schlaeger (cs@kde.org), Sven Radej (radej@kde.org). Maintained by Sven Radej (radej@kde.org)
- Generated: root@sparc.ports.openbsd.org on Wed May 2 09:37:45 2001, using kdoc 2.0a53.