• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

KDEUI

Signals | Public Member Functions | Protected Member Functions | List of all members
KStatusBar Class Reference

#include <kstatusbar.h>

Inheritance diagram for KStatusBar:
Inheritance graph
[legend]

Signals

void pressed (int)
 
void released (int)
 

Public Member Functions

 KStatusBar (QWidget *parent=0)
 
 ~KStatusBar ()
 
void changeItem (const QString &text, int id)
 
bool hasItem (int id) const
 
void insertFixedItem (const QString &text, int id)
 
void insertItem (const QString &text, int id, int stretch=0)
 
void insertPermanentFixedItem (const QString &text, int id)
 
void insertPermanentItem (const QString &text, int id, int stretch=0)
 
QString itemText (int id) const
 
void removeItem (int id)
 
void setItemAlignment (int id, Qt::Alignment alignment)
 
void setItemFixed (int id, int width=-1)
 

Protected Member Functions

bool eventFilter (QObject *object, QEvent *event)
 

Detailed Description

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::clearMessage(). See QStatusBar::showMessage for details.

It is useful to connect the KActionCollection signals to the QStatusBar::showMessage 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 donoh.nosp@m.oe@k.nosp@m.de.or.nosp@m.g and Sven Radej radej.nosp@m.@kde.nosp@m..org
See also
KActionCollection

Definition at line 59 of file kstatusbar.h.

Constructor & Destructor Documentation

KStatusBar::KStatusBar ( QWidget *  parent = 0)
explicit

Constructs a status bar.

parent is usually KMainWindow.

Definition at line 72 of file kstatusbar.cpp.

KStatusBar::~KStatusBar ( )

Destructor.

Deletes all internal objects.

Definition at line 89 of file kstatusbar.cpp.

Member Function Documentation

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

Parameters
textThe label's text string
idThe id of item.

Definition at line 163 of file kstatusbar.cpp.

bool KStatusBar::eventFilter ( QObject *  object,
QEvent *  event 
)
protected

Definition at line 53 of file kstatusbar.cpp.

bool KStatusBar::hasItem ( int  id) const

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

Parameters
idid of the item

Definition at line 149 of file kstatusbar.cpp.

void KStatusBar::insertFixedItem ( const QString &  text,
int  id 
)

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.

Parameters
textThe label's text string
idid of item

Definition at line 109 of file kstatusbar.cpp.

void KStatusBar::insertItem ( const QString &  text,
int  id,
int  stretch = 0 
)

Inserts a temporary text label into the status bar.

Parameter stretch is passed to QStatusBar::addWidget .

Parameters
textThe label's text string.
idid of item
stretchstretch passed to QStatusBar::addWidget
See also
QStatusbar::addWidget

Definition at line 94 of file kstatusbar.cpp.

void KStatusBar::insertPermanentFixedItem ( const QString &  text,
int  id 
)

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.

Parameters
textThe label's text string
idid of item

Definition at line 131 of file kstatusbar.cpp.

void KStatusBar::insertPermanentItem ( const QString &  text,
int  id,
int  stretch = 0 
)

Inserts a permanent text label into the status bar.

Parameter stretch is passed to QStatusBar::addWidget .

Parameters
textThe label's text string.
idid of item
stretchstretch passed to QStatusBar::addPermanentWidget
See also
QStatusbar::addPermanentWidget

Definition at line 116 of file kstatusbar.cpp.

QString KStatusBar::itemText ( int  id) const

The text of an item, if it exists.

Definition at line 154 of file kstatusbar.cpp.

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

void KStatusBar::removeItem ( int  id)

Removes an item.

Parameters
idThe item to remove.

Definition at line 137 of file kstatusbar.cpp.

void KStatusBar::setItemAlignment ( int  id,
Qt::Alignment  alignment 
)

Sets the alignment of item id.

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

Definition at line 180 of file kstatusbar.cpp.

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
idid of item
widthfixed width in pixels. Default -1 is to adapt to text width.

Definition at line 190 of file kstatusbar.cpp.


The documentation for this class was generated from the following files:
  • kstatusbar.h
  • kstatusbar.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:49:18 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDEUI

Skip menu "KDEUI"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal