eric7.EricWidgets.EricSqueezeLabels

Module implementing labels that squeeze their contents to fit the size of the label.

Global Attributes

None

Classes

EricSqueezeLabel Class implementing a label that squeezes its contents to fit its size.
EricSqueezeLabelPath Class implementing a label showing a file path compacted to fit its size.

Functions

None


EricSqueezeLabel

Class implementing a label that squeezes its contents to fit its size.

Derived from

QLabel

Class Attributes

None

Class Methods

None

Methods

EricSqueezeLabel Constructor
paintEvent Protected method called when some painting is required.
setText Public method to set the label's text.

Static Methods

None

EricSqueezeLabel (Constructor)

EricSqueezeLabel(parent=None)

Constructor

parent
reference to the parent Widget (QWidget)

EricSqueezeLabel.paintEvent

paintEvent(event)

Protected method called when some painting is required.

event
reference to the paint event (QPaintEvent)

EricSqueezeLabel.setText

setText(txt)

Public method to set the label's text.

txt
the text to be shown (string)
Up


EricSqueezeLabelPath

Class implementing a label showing a file path compacted to fit its size.

Derived from

QLabel

Class Attributes

None

Class Methods

None

Methods

EricSqueezeLabelPath Constructor
length Public method to return the length of a text in pixels.
paintEvent Protected method called when some painting is required.
setPath Public method to set the path of the label.
setSurrounding Public method to set the surrounding of the path string.
setTextPath Public method to set the surrounding and the path of the label.

Static Methods

None

EricSqueezeLabelPath (Constructor)

EricSqueezeLabelPath(parent=None)

Constructor

parent
reference to the parent Widget (QWidget)

EricSqueezeLabelPath.length

length(txt)

Public method to return the length of a text in pixels.

txt
text to calculate the length for after wrapped (string)
Return:
length of the wrapped text in pixels (integer)

EricSqueezeLabelPath.paintEvent

paintEvent(event)

Protected method called when some painting is required.

event
reference to the paint event (QPaintEvent)

EricSqueezeLabelPath.setPath

setPath(path)

Public method to set the path of the label.

path
path to be shown (string)

EricSqueezeLabelPath.setSurrounding

setSurrounding(surrounding)

Public method to set the surrounding of the path string.

surrounding
the a string containg placeholders for the path (string)

EricSqueezeLabelPath.setTextPath

setTextPath(surrounding, path)

Public method to set the surrounding and the path of the label.

surrounding
the a string containg placeholders for the path (string)
path
path to be shown (string)
Up