OSSP CVS Repository

ossp - Difference in ossp-pkg/as/as-gui/as_table.cpp versions 1.14 and 1.15
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [History

ossp-pkg/as/as-gui/as_table.cpp 1.14 -> 1.15

--- as_table.cpp 2002/12/16 17:13:17     1.14
+++ as_table.cpp 2002/12/17 16:47:30     1.15
@@ -123,3 +123,20 @@
     for (int nIter = this->numRows() - 1; nIter >= 0; nIter--)
         this->setText(nIter, TITRAQ_IDXLINE, QString::number(nIter).rightJustify(4, QChar('0')));
 }
+
+void TiTable::paintCell(QPainter *pPainter, int nRow, int nCol, const QRect &Recto, bool bSelect, const QColorGroup &Colgroup)
+{
+    QColorGroup Cgroup(Colgroup);
+
+    // Alternate color for nonmatching sort keys
+    QString Cur = this->text(nRow, this->getSortcol());
+    QString Las = this->text(nRow - 1, this->getSortcol());
+
+    // Set the base color conditionally
+    if (!Cur.isNull() && !Las.isNull() && Cur == Las)
+        Cgroup.setColor(QColorGroup::Base, QColor(248, 248, 240));
+    else
+        Cgroup.setColor(QColorGroup::Base, QColor(232, 232, 224));
+
+    QTable::paintCell(pPainter, nRow, nCol, Recto, bSelect, Cgroup);
+};

CVSTrac 2.0.1