Chemical Data Processing Library Python API - Version 1.4.0
Public Member Functions | List of all members
CDPL.Vis.QtBackend.QtFontMetrics Class Reference

Implements the FontMetrics interface for the Qt rendering backend. More...

+ Inheritance diagram for CDPL.Vis.QtBackend.QtFontMetrics:

Public Member Functions

None __init__ (PyQt5.QtGui.QPaintDevice paint_dev)
 Constructs a font metrics object for Qt's default font and the given paint device. More...
 
None setFont (Vis.Font font)
 Specifies the font to use for the calculation of text metrics. More...
 
float getAscent ()
 Returns the ascent of the current font. More...
 
float getDescent ()
 Returns the descent of the current font. More...
 
float getHeight ()
 Returns the height of the current font. More...
 
float getLeading ()
 Returns the leading of the current font. More...
 
float getWidth ()
 
float getBounds (str string, Vis.Rectangle2D bounds)
 
- Public Member Functions inherited from CDPL.Vis.FontMetrics
None __init__ ()
 Initializes the FontMetrics instance.
 
int getObjectID ()
 Returns the numeric identifier (ID) of the wrapped C++ class instance. More...
 
None setFont (Font font)
 Specifies the font for which to obtain the metrics. More...
 
float getWidth (str string)
 
None getBounds (str string, Rectangle2D bounds)
 

Additional Inherited Members

- Properties inherited from CDPL.Vis.FontMetrics
 objectID = property(getObjectID)
 

Detailed Description

Implements the FontMetrics interface for the Qt rendering backend.

QtFontMetrics is implemented by wrapping a corresponding QFontMetrics instance created for the font specified by setFont(). For more information about QFontMetrics and the Qt Toolkit see [QTDOC].

Constructor & Destructor Documentation

◆ __init__()

None CDPL.Vis.QtBackend.QtFontMetrics.__init__ ( PyQt5.QtGui.QPaintDevice  paint_dev)

Constructs a font metrics object for Qt's default font and the given paint device.

Parameters
paint_devA reference to the Qt paint device, or None if unspecified.

Member Function Documentation

◆ setFont()

None CDPL.Vis.QtBackend.QtFontMetrics.setFont ( Vis.Font  font)

Specifies the font to use for the calculation of text metrics.

Parameters
fontThe font used for the calculation of text metrics.

◆ getAscent()

float CDPL.Vis.QtBackend.QtFontMetrics.getAscent ( )

Returns the ascent of the current font.

Returns
The ascent of the current font.

Reimplemented from CDPL.Vis.FontMetrics.

◆ getDescent()

float CDPL.Vis.QtBackend.QtFontMetrics.getDescent ( )

Returns the descent of the current font.

Returns
The descent of the current font.

Reimplemented from CDPL.Vis.FontMetrics.

◆ getHeight()

float CDPL.Vis.QtBackend.QtFontMetrics.getHeight ( )

Returns the height of the current font.

Returns
The height of the current font.

Reimplemented from CDPL.Vis.FontMetrics.

◆ getLeading()

float CDPL.Vis.QtBackend.QtFontMetrics.getLeading ( )

Returns the leading of the current font.

Returns
The leading of the current font.

Reimplemented from CDPL.Vis.FontMetrics.

◆ getWidth()

float CDPL.Vis.QtBackend.QtFontMetrics.getWidth ( )
Returns

◆ getBounds()

float CDPL.Vis.QtBackend.QtFontMetrics.getBounds ( str  string,
Vis.Rectangle2D  bounds 
)
Parameters
string
bounds
Returns