QGIS API Documentation 3.40.0-Bratislava (b56115d8743)
Loading...
Searching...
No Matches
Public Member Functions | List of all members
QgsTableCell Class Reference

Encapsulates the contents and formatting of a single table cell. More...

#include <qgstablecell.h>

Public Member Functions

 QgsTableCell (const QgsTableCell &other)
 
 QgsTableCell (const QVariant &content=QVariant())
 Constructor for QgsTableCell, with the specified content.
 
 ~QgsTableCell ()
 
QColor backgroundColor () const
 Returns the cell's background color, or an invalid color if a default color should be used for the background.
 
int columnSpan () const
 Returns the column span for the cell.
 
QVariant content () const
 Returns the cell's content.
 
QColor foregroundColor () const
 Returns the cell's foreground color, or an invalid color if a default color should be used for the foreground.
 
Qt::Alignment horizontalAlignment () const
 Returns the horizontal alignment for text in the cell.
 
const QgsNumericFormatnumericFormat () const
 Returns the numeric format used for numbers in the cell, or nullptr if no format is set.
 
QgsTableCelloperator= (const QgsTableCell &other)
 
QVariantMap properties (const QgsReadWriteContext &context) const
 Returns the properties of the cell.
 
int rowSpan () const
 Returns the row span for the cell.
 
void setBackgroundColor (const QColor &color)
 Sets the cell's background color.
 
void setContent (const QVariant &content)
 Sets the cell's content.
 
void setForegroundColor (const QColor &color)
 Sets the cell's foreground color.
 
void setHorizontalAlignment (Qt::Alignment alignment)
 Sets the horizontal alignment for text in the cell.
 
void setNumericFormat (QgsNumericFormat *format)
 Sets the numeric format used for numbers in the cell, or nullptr if no specific format is set.
 
void setProperties (const QVariantMap &properties, const QgsReadWriteContext &context)
 Sets the properties for the cell.
 
void setSpan (int rowSpan, int columnSpan)
 Sets the row and column span for the cell.
 
void setTextFormat (const QgsTextFormat &format)
 Sets the cell's text format.
 
void setVerticalAlignment (Qt::Alignment alignment)
 Sets the vertical alignment for text in the cell.
 
QgsTextFormat textFormat () const
 Returns the cell's text format.
 
Qt::Alignment verticalAlignment () const
 Returns the vertical alignment for text in the cell.
 

Detailed Description

Encapsulates the contents and formatting of a single table cell.

Since
QGIS 3.12

Definition at line 35 of file qgstablecell.h.

Constructor & Destructor Documentation

◆ QgsTableCell() [1/2]

QgsTableCell::QgsTableCell ( const QVariant &  content = QVariant())

Constructor for QgsTableCell, with the specified content.

Definition at line 22 of file qgstablecell.cpp.

◆ QgsTableCell() [2/2]

QgsTableCell::QgsTableCell ( const QgsTableCell other)

Definition at line 26 of file qgstablecell.cpp.

◆ ~QgsTableCell()

QgsTableCell::~QgsTableCell ( )
default

Member Function Documentation

◆ backgroundColor()

QColor QgsTableCell::backgroundColor ( ) const
inline

Returns the cell's background color, or an invalid color if a default color should be used for the background.

See also
setBackgroundColor()

Definition at line 70 of file qgstablecell.h.

◆ columnSpan()

int QgsTableCell::columnSpan ( ) const
inline

Returns the column span for the cell.

See also
rowSpan()
setSpan()
Since
QGIS 3.40

Definition at line 197 of file qgstablecell.h.

◆ content()

QVariant QgsTableCell::content ( ) const
inline

Returns the cell's content.

See also
setContent()

Definition at line 56 of file qgstablecell.h.

◆ foregroundColor()

QColor QgsTableCell::foregroundColor ( ) const
inline

Returns the cell's foreground color, or an invalid color if a default color should be used for the foreground.

See also
setForegroundColor()

Definition at line 86 of file qgstablecell.h.

◆ horizontalAlignment()

Qt::Alignment QgsTableCell::horizontalAlignment ( ) const

Returns the horizontal alignment for text in the cell.

See also
setHorizontalAlignment()
verticalAlignment()
Since
QGIS 3.16

Definition at line 133 of file qgstablecell.cpp.

◆ numericFormat()

const QgsNumericFormat * QgsTableCell::numericFormat ( ) const

Returns the numeric format used for numbers in the cell, or nullptr if no format is set.

See also
setNumericFormat()

Definition at line 54 of file qgstablecell.cpp.

◆ operator=()

QgsTableCell & QgsTableCell::operator= ( const QgsTableCell other)

Definition at line 40 of file qgstablecell.cpp.

◆ properties()

QVariantMap QgsTableCell::properties ( const QgsReadWriteContext context) const

Returns the properties of the cell.

See also
setProperties()

Definition at line 64 of file qgstablecell.cpp.

◆ rowSpan()

int QgsTableCell::rowSpan ( ) const
inline

Returns the row span for the cell.

See also
columnSpan()
setSpan()
Since
QGIS 3.40

Definition at line 187 of file qgstablecell.h.

◆ setBackgroundColor()

void QgsTableCell::setBackgroundColor ( const QColor &  color)
inline

Sets the cell's background color.

Set an invalid color if a default color should be used for the background.

See also
backgroundColor()

Definition at line 79 of file qgstablecell.h.

◆ setContent()

void QgsTableCell::setContent ( const QVariant &  content)
inline

Sets the cell's content.

See also
content()

Definition at line 63 of file qgstablecell.h.

◆ setForegroundColor()

void QgsTableCell::setForegroundColor ( const QColor &  color)
inline

Sets the cell's foreground color.

Set an invalid color if a default color should be used for the foreground.

See also
foregroundColor()

Definition at line 95 of file qgstablecell.h.

◆ setHorizontalAlignment()

void QgsTableCell::setHorizontalAlignment ( Qt::Alignment  alignment)

Sets the horizontal alignment for text in the cell.

See also
horizontalAlignment()
setVerticalAlignment()
Since
QGIS 3.16

Definition at line 138 of file qgstablecell.cpp.

◆ setNumericFormat()

void QgsTableCell::setNumericFormat ( QgsNumericFormat format)

Sets the numeric format used for numbers in the cell, or nullptr if no specific format is set.

Ownership of format is transferred to the cell.

See also
numericFormat()

Definition at line 59 of file qgstablecell.cpp.

◆ setProperties()

void QgsTableCell::setProperties ( const QVariantMap &  properties,
const QgsReadWriteContext context 
)

Sets the properties for the cell.

See also
properties()

Definition at line 94 of file qgstablecell.cpp.

◆ setSpan()

void QgsTableCell::setSpan ( int  rowSpan,
int  columnSpan 
)

Sets the row and column span for the cell.

See also
rowSpan()
columnSpan()
Since
QGIS 3.40

Definition at line 153 of file qgstablecell.cpp.

◆ setTextFormat()

void QgsTableCell::setTextFormat ( const QgsTextFormat format)
inline

Sets the cell's text format.

Note
The text format will only be used if hasTextFormat() returns true.
See also
textFormat()
Since
QGIS 3.16

Definition at line 115 of file qgstablecell.h.

◆ setVerticalAlignment()

void QgsTableCell::setVerticalAlignment ( Qt::Alignment  alignment)

Sets the vertical alignment for text in the cell.

See also
verticalAlignment()
setHorizontalAlignment()
Since
QGIS 3.16

Definition at line 148 of file qgstablecell.cpp.

◆ textFormat()

QgsTextFormat QgsTableCell::textFormat ( ) const
inline

Returns the cell's text format.

Note
The text format will only be used if hasTextFormat() returns true.
See also
setTextFormat()
Since
QGIS 3.16

Definition at line 105 of file qgstablecell.h.

◆ verticalAlignment()

Qt::Alignment QgsTableCell::verticalAlignment ( ) const

Returns the vertical alignment for text in the cell.

See also
setVerticalAlignment()
horizontalAlignment()
Since
QGIS 3.16

Definition at line 143 of file qgstablecell.cpp.


The documentation for this class was generated from the following files: