# class KStatusBar

###

Module | kdeui
Namespace |
Class | KStatusBar
Inherits | QStatusBar

%KDE statusbar widget

Display status messages.

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.

It is useful to connect the KActionCollection signals to the QStatusBar.message slots.

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>

See also KActionCollection

### methods

- KStatusBar (parent)

  returns ctor
  KDE 4.1.0 and later only

  Argument | Type | Default
  --- | --- | ---
  parent | QWidget | 0

  Constructs a status bar. parent is usually KMainWindow.

- KStatusBar (a0)

  returns ctor
  before KDE 4.1.0 only

  Argument | Type | Default
  --- | --- | ---
  a0 | QWidget | 0

- changeItem (text, id)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  text | QString |
  id | int |

  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 (until you add some text).

  text - The label's text string

  id - The id of item.

- eventFilter (object, event)

  returns bool

  Argument | Type | Default
  --- | --- | ---
  object | QObject |
  event | QEvent |

- hasItem (id)

  returns bool

  Argument | Type | Default
  --- | --- | ---
  id | int |

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

  id - id of the item

- insertFixedItem (text, id)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  text | QString |
  id | int |

  Inserts a fixed width temporary 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.

  text - The label's text string

  id - id of item

- insertItem (text, id, stretch)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  text | QString |
  id | int |
  stretch | int | 0

  Inserts a temporary text label into the status bar. Parameter stretch is passed to QStatusBar.addWidget .

  text - The label's text string.

  id - id of item

  stretch - stretch passed to QStatusBar.addWidget

  See also QStatusbar.addWidget

- insertPermanentFixedItem (text, id)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  text | QString |
  id | int |

  Inserts a fixed width permanent 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.

  text - The label's text string

  id - id of item

- insertPermanentItem (text, id, stretch)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  text | QString |
  id | int |
  stretch | int | 0

  Inserts a permanent text label into the status bar. Parameter stretch is passed to QStatusBar.addWidget .

  text - The label's text string.

  id - id of item

  stretch - stretch passed to QStatusBar.addPermanentWidget

  See also QStatusbar.addPermanentWidget

- itemText (id)

  returns QString

  Argument | Type | Default
  --- | --- | ---
  id | int |

  The text of an item, if it exists.

- pressed (a0)

  returns Nothing
  SIGNAL ("pressed (int)")

  Argument | Type | Default
  --- | --- | ---
  a0 | int |

  Emitted when mouse is pressed over item id.

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

- released (a0)

  returns Nothing
  SIGNAL ("released (int)")

  Argument | Type | Default
  --- | --- | ---
  a0 | int |

  Emitted when mouse is released over item id.

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

- removeItem (id)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  id | int |

  Removes an item.

  id - The item to remove.

- setItemAlignment (id, alignment)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  id | int |
  alignment | Qt.Alignment |

  Sets the alignment of item id. By default all fields are aligned AlignHCenter | AlignVCenter. See QLabel.setAlignment for details.

- setItemFixed (id, width)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  id | int |
  width | int | -1

  Sets item id to have fixed width. This cannot be undone, but you can always set new fixed width.

  id - id of item

  width - fixed width in pixels. Default -1 is to adapt to text width.