| 1 | #include "CListView.h" |
| 2 | |
| 3 | void CListView::paintEvent(QPaintEvent *e) { |
| 4 | QListView::paintEvent(e); |
| 5 | |
| 6 | if (!emptyViewEnabled || (model() && model()->rowCount(rootIndex()) > 0)) |
| 7 | { |
| 8 | return; |
| 9 | } |
| 10 | |
| 11 | QPainter p(this->viewport()); |
| 12 | p.setPen(this->palette().placeholderText().color()); |
| 13 | p.drawText(rect(), Qt::AlignCenter, emptyViewTitle); |
| 14 | } |
| 15 | |
| 16 | bool CListView::getEmptyViewEnabled() const |
| 17 | { |