]> git.lyx.org Git - features.git/commitdiff
Qt 2.3.x should now compile happily, JMarc, and you'll still get a red label
authorAngus Leeming <leeming@lyx.org>
Tue, 9 Dec 2003 10:33:55 +0000 (10:33 +0000)
committerAngus Leeming <leeming@lyx.org>
Tue, 9 Dec 2003 10:33:55 +0000 (10:33 +0000)
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

src/frontends/qt2/ChangeLog
src/frontends/qt2/checkedwidgets.C

index ca3ea5b8706d36421b303f86e59abb9255a0266d..d9a81dc017b0f23dcfb09c81519475069cf5a597 100644 (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
index e01c54a2a87d3aea24600fafdd71ffccf058c645..5deef77b14e5f3861a53fd5e6a530f6d15b61176 100644 (file)
@@ -26,14 +26,25 @@ void addCheckedLineEdit(BCView & bcview,
 
 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;
@@ -41,7 +52,7 @@ void setWidget(bool valid, QLineEdit * input, QLabel * label)
        if (valid)
                label->unsetPalette();
        else
-               label->setPaletteForegroundColor(red);
+               setWarningColor(label);
 }
 
 } // namespace anon