Continues migration with DDS, Common
This commit is contained in:
1 parent
9b15cee841
commit
fa48db111e
668 files changed
+111841
-2
No files matched your search
Executable
+45
@@ -0,0 +1,45 @@
|
||||
|
||||
|
||||
|
||||
#include "item.h"
|
||||
|
||||
#include <QBrush>
|
||||
#include <QPen>
|
||||
#include <QPainter>
|
||||
#include <QStyleOptionViewItem>
|
||||
#include <QModelIndex>
|
||||
|
||||
#include <QDebug>
|
||||
|
||||
|
||||
namespace LtsTimeline
|
||||
{
|
||||
|
||||
QString Item::mimetype = QStringLiteral("application/rheinmetall.timeline.item");
|
||||
|
||||
QColor Item::s_highlightColor = QRgb(0x43b0e0);
|
||||
|
||||
|
||||
Item::Item(qint64 startTime, int duration, const QColor &color, bool isEditable)
|
||||
: m_color(color)
|
||||
, m_startTime(startTime)
|
||||
, m_duration(duration)
|
||||
, m_isEditable(isEditable)
|
||||
{}
|
||||
|
||||
|
||||
|
||||
|
||||
void Item::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &, bool highlight) const
|
||||
{
|
||||
painter->save();
|
||||
if (highlight)
|
||||
painter->setPen(QPen(QBrush(s_highlightColor), 5));
|
||||
else
|
||||
painter->setPen(QPen(QBrush(Qt::black), 1));
|
||||
painter->setBrush(QBrush(m_color));
|
||||
painter->drawRect(option.rect);
|
||||
painter->restore();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user