Class: QgsTableCell¶
-
class
qgis.core.
QgsTableCell
(content: Any = None)¶ Bases:
sip.wrapper
Constructor for
QgsTableCell
, with the specifiedcontent
.QgsTableCell(other:
QgsTableCell
) Copy constructorEncapsulates the contents and formatting of a single table cell.
New in version 3.12.
- Parameters
content –
-
backgroundColor
(self) → QColor¶ Returns the cell’s background color, or an invalid color if a default color should be used for the background.
See also
- Return type
QColor
-
content
(self) → Any¶ Returns the cell’s content.
See also
- Return type
Any
-
foregroundColor
(self) → QColor¶ Returns the cell’s foreground color, or an invalid color if a default color should be used for the foreground.
See also
- Return type
QColor
-
numericFormat
(self) → QgsNumericFormat¶ Returns the numeric format used for numbers in the cell, or
None
if no format is set.See also
- Return type
-
properties
(self, context: QgsReadWriteContext) → Dict[str, Any]¶ Returns the properties of the cell.
See also
- Parameters
context (QgsReadWriteContext) –
- Return type
Dict[str, Any]
-
setBackgroundColor
(self, color: Union[QColor, Qt.GlobalColor, QGradient])¶ Sets the cell’s background
color
.Set an invalid
color
if a default color should be used for the background.See also
- Parameters
color (Union[QColor) –
-
setContent
(self, content: Any)¶ Sets the cell’s
content
.See also
- Parameters
content (Any) –
-
setForegroundColor
(self, color: Union[QColor, Qt.GlobalColor, QGradient])¶ Sets the cell’s foreground
color
.Set an invalid
color
if a default color should be used for the foreground.See also
- Parameters
color (Union[QColor) –
-
setNumericFormat
(self, format: QgsNumericFormat)¶ Sets the numeric
format
used for numbers in the cell, orNone
if no specific format is set.Ownership of
format
is transferred to the cell.See also
- Parameters
format (QgsNumericFormat) –
-
setProperties
(self, properties: Dict[str, Any], context: QgsReadWriteContext)¶ Sets the
properties
for the cell.See also
- Parameters
properties (Dict[str) –
context (QgsReadWriteContext) –