# eric6.E5Gui.E5SqueezeLabels

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

### Global Attributes

None

### Classes

E5SqueezeLabel | Class implementing a label that squeezes its contents to fit its size.
E5SqueezeLabelPath | Class implementing a label showing a file path compacted to fit its size.

### Functions

None

## E5SqueezeLabel

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

### Derived from

QLabel

### Class Attributes

None

### Class Methods

None

### Methods

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

### Static Methods

None

#### E5SqueezeLabel (Constructor)

E5SqueezeLabel(parent=None)

Constructor

parent
  reference to the parent Widget (QWidget)

#### E5SqueezeLabel.paintEvent

paintEvent(event)

Protected method called when some painting is required.

event
  reference to the paint event (QPaintEvent)

#### E5SqueezeLabel.setText

setText(txt)

Public method to set the label's text.

txt
  the text to be shown (string)

Up

## E5SqueezeLabelPath

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

### Derived from

QLabel

### Class Attributes

None

### Class Methods

None

### Methods

E5SqueezeLabelPath | 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

#### E5SqueezeLabelPath (Constructor)

E5SqueezeLabelPath(parent=None)

Constructor

parent
  reference to the parent Widget (QWidget)

#### E5SqueezeLabelPath.length

length(txt)

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

txt
  text to calculate the length for after wrapped (string)

Returns:
  length of the wrapped text in pixels (integer)

#### E5SqueezeLabelPath.paintEvent

paintEvent(event)

Protected method called when some painting is required.

event
  reference to the paint event (QPaintEvent)

#### E5SqueezeLabelPath.setPath

setPath(path)

Public method to set the path of the label.

path
  path to be shown (string)

#### E5SqueezeLabelPath.setSurrounding

setSurrounding(surrounding)

Public method to set the surrounding of the path string.

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

#### E5SqueezeLabelPath.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