]> git.lyx.org Git - lyx.git/commitdiff
* GuiPrefs.cpp (PrefShortcuts::setItemType): compilation fix for
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Mon, 22 Oct 2007 13:56:59 +0000 (13:56 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Mon, 22 Oct 2007 13:56:59 +0000 (13:56 +0000)
qt 4.1 and some simplification.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21118 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/GuiPrefs.cpp

index 3dcefaf175e95787f8727805725a874984f40b9e..d859096983fd5ba8aaf92f5be0499e10f6bbe14c 100644 (file)
@@ -1821,41 +1821,30 @@ void PrefShortcuts::updateShortcutsTW()
 void PrefShortcuts::setItemType(QTreeWidgetItem * item, item_type tag)
 {
        item->setData(0, Qt::UserRole, QVariant(tag));
+       QString color;
 
        switch (tag) {
        case System:
-#if QT_VERSION >= 0x040200
-               item->setForeground(0, QBrush("black"));
-               item->setForeground(1, QBrush("black"));
-#else
-               item->setTextColor(QColor("black"));
-#endif
+               color = "black";
                break;
        case UserBind:
-#if QT_VERSION >= 0x040200
-               item->setForeground(0, QBrush("green"));
-               item->setForeground(1, QBrush("green"));
-#else
-               item->setTextColor(QColor("green"));
-#endif
+               color = "green";
                break;
        case UserUnbind:
-#if QT_VERSION >= 0x040200
-               item->setForeground(0, QBrush("red"));
-               item->setForeground(1, QBrush("red"));
-#else
-               item->setTextColor(QColor("red"));
-#endif
+               color = "red";
                break;
        case UserExtraUnbind:
+               color = "purple";
+               break;
+       }
+
 #if QT_VERSION >= 0x040200
-               item->setForeground(0, QBrush("purple"));
-               item->setForeground(1, QBrush("purple"));
+       item->setForeground(0, QBrush(color));
+       item->setForeground(1, QBrush(color));
 #else
-               item->setTextColor(QColor("purple"));
+       item->setTextColor(0, QColor(color));
+       item->setTextColor(1, QColor(color));
 #endif
-               break;
-       }
 }