+2003-12-09 Angus Leeming <leeming@lyx.org>
+
+ * checkedwidgets.C (setWarningColor): new function that should
+ work also with Qt 2.3.x.
+ (setWidget): call setWarningColor, not setPaletteForegroundColor.
+
2003-12-08 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
* QExternal.C: add using directive
namespace {
-void setWidget(bool valid, QLineEdit * input, QLabel * label)
+void setWarningColor(QWidget * widget)
{
- QColor const red(255, 0, 0);
+ // Qt 2.3 does not have
+ // widget->setPaletteForegroundColor(QColor(255, 0, 0));
+ // So copy the appropriate parts of the function here:
+ QPalette pal = widget->palette();
+ pal.setColor(QPalette::Active,
+ QColorGroup::Foreground,
+ QColor(255, 0, 0));
+ widget->setPalette(pal);
+}
+
+void setWidget(bool valid, QLineEdit * input, QLabel * label)
+{
if (valid)
input->unsetPalette();
else
- input->setPaletteForegroundColor(red);
+ setWarningColor(input);
if (!label)
return;
if (valid)
label->unsetPalette();
else
- label->setPaletteForegroundColor(red);
+ setWarningColor(label);
}
} // namespace anon