Interval Sidebar show Interval Color

.. using same kind of decoration as the ride list
   with a small bar to indicate the chosen color
   for the interval.
This commit is contained in:
Mark Liversedge
2015-05-27 15:37:45 +01:00
parent 9484b9ea6e
commit 62f937e6b2
2 changed files with 50 additions and 0 deletions

View File

@@ -25,6 +25,7 @@
#include <QStyle>
#include <QStyleFactory>
#include <QScrollBar>
#include <QStyledItemDelegate>
IntervalTreeView::IntervalTreeView(Context *context) : context(context)
@@ -43,6 +44,9 @@ IntervalTreeView::IntervalTreeView(Context *context) : context(context)
setMouseTracking(true);
invisibleRootItem()->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
// we want the color rectangle
setItemDelegate(new IntervalColorDelegate(this));
connect(this, SIGNAL(itemEntered(QTreeWidgetItem*,int)), this, SLOT(mouseHover(QTreeWidgetItem*,int)));
}
@@ -139,3 +143,4 @@ IntervalTreeView::mimeData (const QList<QTreeWidgetItem *> items) const
returning->setData("application/x-gc-intervals", rawData);
return returning;
}