class KStatusBar

KDE statusbar widget. More...

Definition#include <kstatusbar.h>
InheritsQFrame
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Types

Public Methods

Public Slots

Signals

Protected Methods

Protected Slots


Detailed Description

Display status messages.

You can insert text labels or custom widgets. Their geometry is Managed internally. KStatusBar resizes itself, but positioning is left to KTMainWindow (or to you, if you don't use KTMainWindow).

A special type of item is a message which is a temporary text-message or custom widget which is displayed on top of other items in full-width. Messages are visible for specified time, or until you call the slot clear().

STILL UNIMPLEMENTED:

It is also possible to replace one item by another, keeping the same size and position.

enum BarStatus {Toggle, Show, Hide }

Possible states of the status bar.

enum Position {Top, Left, Bottom, Right, Floating }

Possible positions of the status bar.

enum InsertOrder {LeftToRight, RightToLeft }

Ways to inset widgets.

KStatusBar ( QWidget* parent = 0L, const char* name = 0L )

Construct KStatusBar object.

~KStatusBar ()

Destructor.

Deletes all internal objects.

int insertItem ( const QString& text, int ID )

Insert text label into the status bar.

When inserting the item send the longest text you expect to go into the field as the first argument. The field is sized to accomodate this text. However, the last field inserted is always stretched to fit the window width.

int insertWidget ( QWidget* _widget, int size, int id )

Insert custom widget into the status bar.

The widget must have this statusbar as it's parent. The size is the width of the widget. However, the last item inserted is always stretched to fit the window width.

void removeItem ( int id )

Remove an item.

If id corresponds to your custom widget, then it's hidden but not deleted.

Parameters:
idThe item to remove.

void replaceItem ( int _id, const QString& new_text )

NOT YET IMPLEMENTED! Replaces item id with new label wich has text new_text. New label will have the same position and size as old. If old item was your custom widget it is not deleted. Note that it is rather pointless to replace one label by another; use changeItem for that.

void replaceItem ( int _id, QWidget *new_widget )

NOT YET IMPLEMENTED! Replaces item id with new widget new_widget. New widget will have the same position and size as old item. If old item was your custom widget it is not deleted.

void changeItem ( const QString& text, int id )

Change the text in a status bar field.

The field is not resized! This is useful only for labels.

void setInsertOrder ( InsertOrder order )

Change the order of widget insertion.

If order is KStatusBar::LeftToRight the fields are inserted from left to right, in particular the last field is streched to the right border of the window. If order is KStatusBar::RightToLeft the fields are inserted from the right.

void setAlignment ( int id, int align )

Sets the alignment of a field.

By default all fields are aligned left. Useful only for labels.

Valid values for align are:

void setHeight ( int )

Set the height of the StatusBar.

Default height is computed from default font height.

void setBorderWidth ( int )

Set the border width of the status bar seperators and frame.

bool enable ( BarStatus stat )

Enable/ disable status bar.

You can get the same effect with @ref @QWidget::show() or QWidget::hide(), but if you do that the signal moved() won't be emitted.

void message ( const QString& text, int time = 0 )

Hide all items and display temporary text message over entire statusbar.

The message will be removed (and old items redisplayed) after a time time has elapsed (in ms). If time is 0 (default) the message will remain until you call clear(). You can remove the message by calling clear() at any time.

void message ( QWidget* wiiidget, int time = 0 )

Hide all items and display temporary custom widget over entire statusbar.

The widget must have this statusbar as its parent. The widget will be removed (and old items redisplayed) after time time has elapsed (in ms). If time is 0 (default) widget will remain until you call clear(). You can remove the message by calling clear() any time. Upon calling clear() your widget will be hidden, not deleted.

QSize sizeHint ()
[const]

For now returns QWidget::height() and QWidget::width().

KStatusBarItem * item ( int id )

Retrieve a statusbar item.

void clear ()
[slot]

Clear the message (if any), and return to regular state.

This method is a slot so you can connect to it. It does nothing if message() was not called before. If the message was your custom widget it will be hidden but not deleted, so you have to clean it up.

void pressed ( int )
[signal]

Emitted when mouse is pressed over statusbar item id.

Connect to this signal if you want to respond to mouse press events. If you want to catch this signal for your custom widgets, the widgets must not catch mouse press events.

void released ( int )
[signal]

Emitted when mouse is released over statusbar item id.

Connect to this signal if you want to respond to mouse clicks. If you want to catch this signal for your custom widgets, the widgets must not catch mouse release events.

void moved ()
[signal]

Emitted when statusbar changes its position (not implemented!), or when item is removed from statusbar.

This is normaly connected to KTMainWindow::updateRects(). If you subclass KTMainWindow and reimplement KTMainWindow::resizeEvent() or KTMainWindow::updateRects(), be sure to connect to this signal.