26 : mContent( other.mContent )
27 , mBackgroundColor( other.mBackgroundColor )
28 , mForegroundColor( other.mForegroundColor )
29 , mFormat( other.mFormat ? other.mFormat->clone() : nullptr )
36 mContent = other.mContent;
37 mBackgroundColor = other.mBackgroundColor;
38 mForegroundColor = other.mForegroundColor;
39 mFormat.reset( other.mFormat ? other.mFormat->clone() : nullptr );
50 mFormat.reset( format );
56 res.insert( QStringLiteral(
"content" ), mContent );
57 res.insert( QStringLiteral(
"foreground" ), mForegroundColor );
58 res.insert( QStringLiteral(
"background" ), mBackgroundColor );
61 res.insert( QStringLiteral(
"format_type" ), mFormat->id() );
62 res.insert( QStringLiteral(
"format" ), mFormat->configuration( context ) );
69 mContent = properties.value( QStringLiteral(
"content" ) );
70 mForegroundColor = properties.value( QStringLiteral(
"foreground" ) ).value< QColor >();
71 mBackgroundColor = properties.value( QStringLiteral(
"background" ) ).value< QColor >();
72 if ( properties.contains( QStringLiteral(
"format_type" ) ) )
76 properties.value( QStringLiteral(
"format" ) ).toMap(),
The class is used as a container of context for various read/write operations on other objects...
QgsTableCell & operator=(const QgsTableCell &other)
Encapsulates the contents and formatting of a single table cell.
static QgsNumericFormatRegistry * numericFormatRegistry()
Gets the registry of available numeric formats.
void setProperties(const QVariantMap &properties, const QgsReadWriteContext &context)
Sets the properties for the cell.
void setNumericFormat(QgsNumericFormat *format)
Sets the numeric format used for numbers in the cell, or nullptr if no specific format is set...
QgsTableCell(const QVariant &content=QVariant())
Constructor for QgsTableCell, with the specified content.
QVariantMap properties(const QgsReadWriteContext &context) const
Returns the properties of the cell.
const QgsNumericFormat * numericFormat() const
Returns the numeric format used for numbers in the cell, or nullptr if no format is set...