kdeui Library API Documentation

KSqueezedTextLabel Class Reference

A label class that squeezes its text into the label A replacement for QLabel that squeezes its text. More...

#include <ksqueezedtextlabel.h>

Inheritance diagram for KSqueezedTextLabel:

Inheritance graph
[legend]
Collaboration diagram for KSqueezedTextLabel:

Collaboration graph
[legend]
List of all members.

Public Slots

void setText (const QString &)

Public Member Functions

 KSqueezedTextLabel (QWidget *parent, const char *name=0)
 Default constructor.

 KSqueezedTextLabel (const QString &text, QWidget *parent, const char *name=0)
virtual QSize minimumSizeHint () const

Protected Member Functions

void resizeEvent (QResizeEvent *)
 used when widget is resized

void squeezeTextToLabel ()
 does the dirty work

virtual void virtual_hook (int id, void *data)

Protected Attributes

QString fullText

Detailed Description

A label class that squeezes its text into the label A replacement for QLabel that squeezes its text.

If the text is too long to fit into the label it is divided into remaining left and right parts which are separated by three dots.

Example: http://www.kde.org/documentation/index.html could be squeezed to http://www.kde...ion/index.html

Author:
Ronny Standtke <Ronny.Standtke@gmx.de>
Version:
Id
ksqueezedtextlabel.h,v 1.6 2002/03/04 00:51:51 lunakl Exp

Definition at line 43 of file ksqueezedtextlabel.h.


Constructor & Destructor Documentation

KSqueezedTextLabel::KSqueezedTextLabel QWidget parent,
const char *  name = 0
 

Default constructor.

Definition at line 29 of file ksqueezedtextlabel.cpp.

References KStdAccel::name().


Member Function Documentation

void KSqueezedTextLabel::resizeEvent QResizeEvent  )  [protected]
 

used when widget is resized

Definition at line 34 of file ksqueezedtextlabel.cpp.

References squeezeTextToLabel().

void KSqueezedTextLabel::squeezeTextToLabel  )  [protected]
 

does the dirty work

Definition at line 50 of file ksqueezedtextlabel.cpp.

References QToolTip::add(), QToolTip::hide(), QString::left(), QString::length(), QToolTip::remove(), QString::right(), QLabel::setText(), and QFontMetrics::width().

Referenced by resizeEvent().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.5.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Wed Jan 28 13:04:52 2004 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2001