# eric4.E4Gui.E4SqueezeLabels

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

### Global Attributes

None

### Classes

E4SqueezeLabel | Class implementing a label that squeezes its contents to fit it's size.
E4SqueezeLabelPath | Class implementing a label showing a file path compacted to fit it's size.

### Functions

None

## E4SqueezeLabel

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

### Derived from

QLabel

### Class Attributes

None

### Class Methods

None

### Methods

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

### Static Methods

None

#### E4SqueezeLabel (Constructor)

E4SqueezeLabel(parent = None)

Constructor

parent
  reference to the parent Widget (QWidget)

#### E4SqueezeLabel.paintEvent

paintEvent(event)

Protected method called when some painting is required.

event
  reference to the paint event (QPaintEvent)

#### E4SqueezeLabel.setText

setText(txt)

Public method to set the label's text.

txt
  the text to be shown (string or QString)

Up

## E4SqueezeLabelPath

Class implementing a label showing a file path compacted to fit it's size.

### Derived from

QLabel

### Class Attributes

None

### Class Methods

None

### Methods

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

#### E4SqueezeLabelPath (Constructor)

E4SqueezeLabelPath(parent = None)

Constructor

parent
  reference to the parent Widget (QWidget)

#### E4SqueezeLabelPath.length

length(txt)

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

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

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

#### E4SqueezeLabelPath.paintEvent

paintEvent(event)

Protected method called when some painting is required.

event
  reference to the paint event (QPaintEvent)

#### E4SqueezeLabelPath.setPath

setPath(path)

Public method to set the path of the label.

path
  path to be shown (string or QString)

#### E4SqueezeLabelPath.setSurrounding

setSurrounding(surrounding)

Public method to set the surrounding of the path string.

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

#### E4SqueezeLabelPath.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 (QString)
path
  path to be shown (string or QString)

Up