kdeui Library API Documentation

KStatusBar Class Reference

Display status messages. KDE statusbar widget. More...

#include <kstatusbar.h>

Inheritance diagram for KStatusBar:

QStatusBar List of all members.

Public Types

enum  BarStatus { Toggle, Show, Hide }

Signals

void pressed (int)
void released (int)

Public Member Functions

 KStatusBar (QWidget *parent=0L, const char *name=0L)
 ~KStatusBar ()
void insertItem (const QString &text, int id, int stretch=0, bool permanent=false)
void insertFixedItem (const QString &text, int id, bool permanent=false)
void removeItem (int id)
bool hasItem (int id) const
void changeItem (const QString &text, int id)
void setItemAlignment (int id, int align)
void setItemFixed (int id, int width=-1)

Detailed Description

Display status messages. KDE statusbar widget.

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

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

KStatusBar inherits QStatusBar, you can freely use all QStatusBar methods.

Empty text items are not visible. They will become visible when you change (add) text.

Author:
Mark Donohoe (donohoe@kde.org) Maintained by Sven Radej <radej@kde.org>
Version:
Id
kstatusbar.h,v 1.40 2003/12/17 00:45:16 kniederk Exp

Definition at line 82 of file kstatusbar.h.


Member Enumeration Documentation

enum KStatusBar::BarStatus
 

Deprecated:
WARNING: This enum is only for backward compatibility and it may be removed. No method here uses it.

Definition at line 92 of file kstatusbar.h.


Constructor & Destructor Documentation

KStatusBar::KStatusBar QWidget parent = 0L,
const char *  name = 0L
 

Constructs a status bar.

parent is usually KMainWindow.

Definition at line 70 of file kstatusbar.cpp.

References KGlobal::config(), KConfigBase::group(), KStatusBar(), KConfigBase::readBoolEntry(), and KConfigBase::setGroup().

Referenced by KStatusBar().

KStatusBar::~KStatusBar  ) 
 

Destructor.

Deletes all internal objects.

Definition at line 84 of file kstatusbar.cpp.


Member Function Documentation

void KStatusBar::insertItem const QString text,
int  id,
int  stretch = 0,
bool  permanent = false
 

Inserts a text label into the status bar.

Paremeters stretch and permanent are passed to QStatusBar::addWidget .

If permanent is true, then item will be placed on the far right of the statusbar and will never be hidden by QStatusBar::message.

Parameters:
text The label's text string.
id id of item
stretch stretch passed to QStatusBar::addWidget
permanent is item permanent or not (passed to QStatusBar::addWidget )
See also:
QStatusbar::addWidget

Definition at line 89 of file kstatusbar.cpp.

References endl(), insertItem(), and kdDebug().

Referenced by insertItem().

void KStatusBar::insertFixedItem const QString text,
int  id,
bool  permanent = false
[inline]
 

Inserts a fixed width text label into status bar.

The width will be set according to text, but will remain fixed even if you change text. You can change fixed width by calling setItemFixed.

Parameters:
text The label's text string
id id of item
permanent permanent flag passed to QStatusBar::addWidget

Definition at line 133 of file kstatusbar.h.

References insertFixedItem(), and setItemFixed().

Referenced by insertFixedItem().

void KStatusBar::removeItem int  id  ) 
 

Removes an item.

Parameters:
id The item to remove.

Definition at line 102 of file kstatusbar.cpp.

References endl(), kdDebug(), and removeItem().

Referenced by removeItem().

bool KStatusBar::hasItem int  id  )  const
 

Since:
3.2

Returns true if an item with exists already in KStatusBar, otherwise returns false.

Parameters:
id id of the item

Definition at line 116 of file kstatusbar.cpp.

References hasItem().

Referenced by hasItem().

void KStatusBar::changeItem const QString text,
int  id
 

Changes the text in a status bar field.

The item will be resized to fit the text. If you change text to be empty, item will not be visible (untill you add some text).

Parameters:
text The label's text string
id The id of item.

Definition at line 125 of file kstatusbar.cpp.

References changeItem(), endl(), and kdDebug().

Referenced by changeItem().

void KStatusBar::setItemAlignment int  id,
int  align
 

Sets the alignment of item id.

By default all fields are aligned AlignHCenter | AlignVCenter. See QLabel::setAlignment for details.

Definition at line 141 of file kstatusbar.cpp.

References endl(), kdDebug(), and setItemAlignment().

Referenced by setItemAlignment().

void KStatusBar::setItemFixed int  id,
int  width = -1
 

Sets item id to have fixed width.

This cannot be undone, but you can always set new fixed width.

Parameters:
id id of item
width fixed width in pixels. Default -1 is to adapt to text width.

Definition at line 152 of file kstatusbar.cpp.

References endl(), kdDebug(), and setItemFixed().

Referenced by insertFixedItem(), and setItemFixed().

void KStatusBar::pressed int   )  [signal]
 

Emitted when mouse is pressed over item id.

Connect to this signal if you want to respond to mouse press events.

void KStatusBar::released int   )  [signal]
 

Emitted when mouse is released over item id.

Connect to this signal if you want to respond to mouse release events (clicks).


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for kdeui Library Version 3.2.3.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sun Oct 10 18:55:13 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003