[go: up one dir, main page]

Menu

[d56ae5]: / ebetable.cpp  Maximize  Restore  History

Download this file

38 lines (33 with data), 878 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include "ebetable.h"
EbeTable::EbeTable(QWidget *parent)
: QTableWidget(parent)
{
}
void EbeTable::setText ( int r, int c, QString t, bool highlight )
{
QTableWidgetItem *it = item(r,c);
QString old = it->text();
//qDebug() << old << t;
if ( highlight && old!= "" && old != t ) {
it->setForeground(QBrush(QColor(ebe["next_fg"].toString())));
} else {
it->setForeground(QBrush(QColor("black")));
}
it->setText(t);
}
EbeTableItem::EbeTableItem ( QString t )
: QTableWidgetItem(t)
{
}
void EbeTableItem::updateText ( QString t, bool highlight )
{
QString old = text();
//qDebug() << old << t;
//if ( old != "" && old != t ) {
if ( highlight && old != t ) {
setForeground(QBrush(QColor(ebe["next_fg"].toString())));
} else {
setForeground(QBrush(QColor("black")));
}
setText(t);
}