| | |
| | | if(rank_val != 0){ |
| | | double rank_rate = 1 - (amount_rank.toDouble()/rank_val); |
| | | //items.append(new QStandardItem(QString::number(rank_rate))); |
| | | rank_val = amount_rank.toInt(); |
| | | |
| | | QStandardItem * amount_rank_item = new QStandardItem(QString::number(rank_rate)); |
| | | if(rank_rate > 0.9){ |
| | | amount_rank_item->setData(QColor("red"),Qt::BackgroundColorRole); |
| | | } |
| | | |
| | | if(rank_rate > 0.7 && rank_val >= 1000 && amount_rank.toInt() < 1000){ |
| | | if(rank_rate > 0.9){ |
| | | // 紫色 |
| | | amount_rank_item->setData(QColor(170, 85, 255),Qt::BackgroundColorRole); |
| | | }else{ |
| | | // 粉色 |
| | | amount_rank_item->setData(QColor("pink"),Qt::BackgroundColorRole); |
| | | } |
| | | |
| | | } |
| | | |
| | | items.append(amount_rank_item); |
| | | rank_val = amount_rank.toInt(); // 刷新排名 |
| | | |
| | | } |
| | | if(rank_val == 0 && amount_rank.toInt() != 0){ |