19#include "moc_qgslayouttablebackgroundcolorsdialog.cpp"
30 : QDialog( parent, flags )
36 connect( buttonBox, &QDialogButtonBox::accepted,
this, &QgsLayoutTableBackgroundColorsDialog::buttonBox_accepted );
37 connect( buttonBox, &QDialogButtonBox::rejected,
this, &QgsLayoutTableBackgroundColorsDialog::buttonBox_rejected );
38 connect( buttonBox, &QDialogButtonBox::helpRequested,
this, &QgsLayoutTableBackgroundColorsDialog::showHelp );
60 connect( buttonBox->button( QDialogButtonBox::Apply ), &QAbstractButton::clicked,
this, &QgsLayoutTableBackgroundColorsDialog::apply );
62 setGuiElementValues();
65void QgsLayoutTableBackgroundColorsDialog::apply()
71 for (
auto checkBoxIt = mCheckBoxMap.constBegin(); checkBoxIt != mCheckBoxMap.constEnd(); ++checkBoxIt )
74 style.
enabled = checkBoxIt.value()->isChecked();
75 if (
QgsColorButton *button = mColorButtonMap.value( checkBoxIt.key() ) )
86void QgsLayoutTableBackgroundColorsDialog::buttonBox_accepted()
92void QgsLayoutTableBackgroundColorsDialog::buttonBox_rejected()
97void QgsLayoutTableBackgroundColorsDialog::showHelp()
99 QgsHelp::openHelp( QStringLiteral(
"print_composer/composer_items/composer_attribute_table.html#appearance" ) );
102void QgsLayoutTableBackgroundColorsDialog::setGuiElementValues()
107 for (
auto it = mCheckBoxMap.constBegin(); it != mCheckBoxMap.constEnd(); ++it )
120 mDefaultColorButton->setAllowOpacity(
true );
121 mDefaultColorButton->setColorDialogTitle( tr(
"Select Background Color" ) );
122 mDefaultColorButton->setShowNoColor(
true );
123 mDefaultColorButton->setNoColorString( tr(
"No Background" ) );
static void enableAutoGeometryRestore(QWidget *widget, const QString &key=QString())
Register the widget to allow its position to be automatically saved and restored when open and closed...
static void openHelp(const QString &key)
Opens help topic for the given help key using default system web browser.
void endCommand()
Completes the current item command and push it onto the layout's undo stack.
void beginCommand(const QString &commandText, UndoCommand command=UndoNone)
Starts new undo command for this item.
void update()
Forces a redraw of all child frames.
@ UndoTableCellStyle
Table cell style.
QgsLayoutTableBackgroundColorsDialog(QgsLayoutTable *table, QWidget *parent=nullptr, Qt::WindowFlags flags=Qt::WindowFlags())
Constructor for QgsLayoutTableBackgroundColorsDialog.
Styling option for a layout table cell.
QColor cellBackgroundColor
Cell background color.
bool enabled
Whether the styling option is enabled.
A class to display a table in the print layout, and allow the table to span over multiple frames.
QColor backgroundColor() const
Returns the color used for the background of the table.
void setBackgroundColor(const QColor &color)
Sets the color used for background of table.
@ FirstRow
Style first row only.
@ EvenColumns
Style even numbered columns.
@ EvenRows
Style even numbered rows.
@ HeaderRow
Style header row.
@ OddColumns
Style odd numbered columns.
@ FirstColumn
Style first column only.
@ LastColumn
Style last column only.
@ LastRow
Style last row only.
@ OddRows
Style odd numbered rows.
void setCellStyle(CellStyleGroup group, const QgsLayoutTableStyle &style)
Sets the cell style for a cell group.
const QgsLayoutTableStyle * cellStyle(CellStyleGroup group) const
Returns the cell style for a cell group.