// a style sheet for buttons
// this is for example used for the background color setting button
-static inline QString colorButtonStyleSheet(const QColor &bgColor)
+static inline QString colorButtonStyleSheet(QColor const & bgColor)
{
- if (bgColor.isValid()) {
+ if (bgColor.isValid()) {
QString rc = QLatin1String("background:");
- rc += bgColor.name();
- return rc;
- }
- return QLatin1String("");
+ rc += bgColor.name();
+ return rc;
+ }
+ return QLatin1String("");
}
connect(pageLayoutModule->pagestyleCO, SIGNAL(activated(int)),
this, SLOT(change_adaptor()));
connect(pageLayoutModule->backgroundTB, SIGNAL(clicked()),
- this, SLOT(changeBackgroundColor()));
- connect(pageLayoutModule->delbackgroundTB, SIGNAL(clicked()),
- this, SLOT(deleteBackgroundColor()));
+ this, SLOT(changeBackgroundColor()));
+ connect(pageLayoutModule->delbackgroundTB, SIGNAL(clicked()),
+ this, SLOT(deleteBackgroundColor()));
pageLayoutModule->pagestyleCO->addItem(qt_("Default"));
pageLayoutModule->pagestyleCO->addItem(qt_("empty"));
void GuiDocument::changeBackgroundColor()
{
- const QColor newColor = QColorDialog::getColor(
+ QColor const & newColor = QColorDialog::getColor(
rgb2qcolor(set_backgroundcolor), qApp->focusWidget());
if (!newColor.isValid())
return;
// set the button color
pageLayoutModule->backgroundTB->setStyleSheet(
colorButtonStyleSheet(newColor));
- // save white as the set color
+ // save color
set_backgroundcolor = rgbFromHexName(fromqstr(newColor.name()));
changed();
}
bp_.sides == TwoSides);
pageLayoutModule->backgroundTB->setStyleSheet(
- colorButtonStyleSheet(QColor(rgb2qcolor(bp_.backgroundcolor))));
+ colorButtonStyleSheet(rgb2qcolor(bp_.backgroundcolor)));
set_backgroundcolor = bp_.backgroundcolor;
lengthToWidgets(pageLayoutModule->paperwidthLE,