Draw 10% opacity icon behind view, so as to give a better hint as to which list is which.
This commit is contained in:
@@ -23,6 +23,8 @@
|
||||
|
||||
#include "treeview.h"
|
||||
#include <QtGui/QMouseEvent>
|
||||
#include <QtGui/QPaintEvent>
|
||||
#include <QtGui/QPainter>
|
||||
#include <QtCore/QMap>
|
||||
|
||||
TreeView::TreeView(QWidget *parent)
|
||||
@@ -126,3 +128,14 @@ void TreeView::correctSelection()
|
||||
setCurrentIndex(currentIndex());
|
||||
selectionModel()->select(s, QItemSelectionModel::SelectCurrent);
|
||||
}
|
||||
|
||||
void TreeView::paintEvent(QPaintEvent *e)
|
||||
{
|
||||
QTreeView::paintEvent(e);
|
||||
|
||||
if (!pixmap.isNull()) {
|
||||
QPainter p(viewport());
|
||||
p.setOpacity(0.1);
|
||||
p.drawPixmap((width() - pixmap.width())/2, (height() - pixmap.height())/2, pixmap);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user