KSqueezedTextLabel Class Reference
from PyKDE4.kdeui import *
Inherits: QLabel → QFrame → QWidget → QObject
Detailed Description
A replacement for QLabel that squeezes its text
A label class that squeezes its text into the label
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
"KSqueezedTextLabel Widget"
Methods | |
__init__ (self, QWidget parent=0) | |
__init__ (self, QString text, QWidget parent=0) | |
contextMenuEvent (self, QContextMenuEvent a0) | |
QSize | minimumSizeHint (self) |
resizeEvent (self, QResizeEvent a0) | |
setAlignment (self, Qt.Alignment a0) | |
setText (self, QString text) | |
setTextElideMode (self, Qt.TextElideMode mode) | |
QSize | sizeHint (self) |
squeezeTextToLabel (self) | |
Qt.TextElideMode | textElideMode (self) |
Method Documentation
__init__ | ( | self, | ||
QWidget | parent=0 | |||
) |
Default constructor.
contextMenuEvent | ( | self, | ||
QContextMenuEvent | a0 | |||
) |
\reimp
QSize minimumSizeHint | ( | self ) |
resizeEvent | ( | self, | ||
QResizeEvent | a0 | |||
) |
Called when widget is resized
setAlignment | ( | self, | ||
Qt.Alignment | a0 | |||
) |
Overridden for internal reasons; the API remains unaffected.
setText | ( | self, | ||
QString | text | |||
) |
Sets the text. Note that this is not technically a reimplementation of QLabel.setText(), which is not virtual (in Qt 4.3). Therefore, you may need to cast the object to KSqueezedTextLabel in some situations: \Example
KSqueezedTextLabel* squeezed = new KSqueezedTextLabel("text", parent); QLabel* label = squeezed; label->setText("new text"); // this will not work squeezed->setText("new text"); // works as expected static_cast<KSqueezedTextLabel*>(label)->setText("new text"); // works as expected
- Parameters:
-
mode The new text.
setTextElideMode | ( | self, | ||
Qt.TextElideMode | mode | |||
) |
Sets the text elide mode.
- Parameters:
-
mode The text elide mode.
QSize sizeHint | ( | self ) |
squeezeTextToLabel | ( | self ) |
does the dirty work
Qt.TextElideMode textElideMode | ( | self ) |
Returns the text elide mode.