Qt 2.3.x should now compile happily, JMarc, and you'll still get a red label

when you try and input an invalid LyXLength in the external dialog.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8215 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Angus Leeming 2003-12-09 10:33:55 +00:00
parent e9d4ce6e7b
commit 234da14623
2 changed files with 21 additions and 4 deletions

View File

@ -1,3 +1,9 @@
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

View File

@ -26,14 +26,25 @@ void addCheckedLineEdit(BCView & bcview,
namespace {
void setWarningColor(QWidget * widget)
{
// 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)
{
QColor const red(255, 0, 0);
if (valid)
input->unsetPalette();
else
input->setPaletteForegroundColor(red);
setWarningColor(input);
if (!label)
return;
@ -41,7 +52,7 @@ void setWidget(bool valid, QLineEdit * input, QLabel * label)
if (valid)
label->unsetPalette();
else
label->setPaletteForegroundColor(red);
setWarningColor(label);
}
} // namespace anon