@@ -4,6 +4,7 | |||||
4 | #include <QPainter> |
|
4 | #include <QPainter> | |
5 | #include <QGraphicsScene> |
|
5 | #include <QGraphicsScene> | |
6 | #include <QGraphicsSceneMouseEvent> |
|
6 | #include <QGraphicsSceneMouseEvent> | |
|
7 | #include <QGraphicsDropShadowEffect> | |||
7 | #include <QDebug> |
|
8 | #include <QDebug> | |
8 | #include <QTime> |
|
9 | #include <QTime> | |
9 |
|
10 | |||
@@ -13,8 +14,6 ScatterPresenter::ScatterPresenter(QScatterSeries *series, QGraphicsObject *pare | |||||
13 | ChartItem(parent), |
|
14 | ChartItem(parent), | |
14 | m_series(series), |
|
15 | m_series(series), | |
15 | m_boundingRect(), |
|
16 | m_boundingRect(), | |
16 | //m_markerColor(QColor()), |
|
|||
17 | // m_markerColor(QColor(255, 0, 0)), |
|
|||
18 | m_visibleChartArea() |
|
17 | m_visibleChartArea() | |
19 | { |
|
18 | { | |
20 | if (parent) |
|
19 | if (parent) | |
@@ -23,6 +22,10 ScatterPresenter::ScatterPresenter(QScatterSeries *series, QGraphicsObject *pare | |||||
23 | if (series) { |
|
22 | if (series) { | |
24 | connect(series, SIGNAL(changed()), this, SLOT(handleModelChanged())); |
|
23 | connect(series, SIGNAL(changed()), this, SLOT(handleModelChanged())); | |
25 | } |
|
24 | } | |
|
25 | ||||
|
26 | QGraphicsDropShadowEffect *dropShadow = new QGraphicsDropShadowEffect(); | |||
|
27 | dropShadow->setOffset(2.0); | |||
|
28 | setGraphicsEffect(dropShadow); | |||
26 | } |
|
29 | } | |
27 |
|
30 | |||
28 | void ScatterPresenter::handleDomainChanged(const Domain& domain) |
|
31 | void ScatterPresenter::handleDomainChanged(const Domain& domain) | |
@@ -60,14 +63,6 void ScatterPresenter::paint(QPainter *painter, const QStyleOptionGraphicsItem * | |||||
60 | painter->setPen(pen); |
|
63 | painter->setPen(pen); | |
61 | painter->drawPath(m_path); |
|
64 | painter->drawPath(m_path); | |
62 |
|
65 | |||
63 | // TODO: how to draw a drop shadow? |
|
|||
64 | QPen dropShadowPen(QColor(0, 0, 0, 70)); |
|
|||
65 | dropShadowPen.setWidth(3); |
|
|||
66 | painter->setPen(dropShadowPen); |
|
|||
67 | painter->setBrush(Qt::NoBrush); |
|
|||
68 | painter->setRenderHint(QPainter::Antialiasing); |
|
|||
69 | painter->drawPath(m_path.translated(2, 2)); |
|
|||
70 |
|
||||
71 | painter->restore(); |
|
66 | painter->restore(); | |
72 | } |
|
67 | } | |
73 |
|
68 |
General Comments 0
You need to be logged in to leave comments.
Login now