##// END OF EJS Templates
Fix color setting...
Fix color setting For some elements the brush and pen colors were set so that the default brush and pen style was used. This resulted wrong pattern for the colors. Change-Id: Ie67d954f1e6e91201a034921433e0bccf6745159 Task-number: QTRD-3736 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@theqtcompany.com>

File last commit:

r2845:ae12522d475c
r2852:5f71da41b84f
Show More
linearrowitem_p.h
77 lines | 2.1 KiB | text/x-c | CLexer
/ src / charts / axis / linearrowitem_p.h
Titta Heikkala
Updated license headers...
r2845 /******************************************************************************
Miikka Heikkinen
Add Polar chart support...
r2483 **
Titta Heikkala
Updated license headers...
r2845 ** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
Miikka Heikkinen
Add Polar chart support...
r2483 **
Titta Heikkala
Updated license headers...
r2740 ** This file is part of the Qt Charts module.
Miikka Heikkinen
Add Polar chart support...
r2483 **
Titta Heikkala
Updated license headers...
r2845 ** $QT_BEGIN_LICENSE:COMM$
Miikka Heikkinen
Add Polar chart support...
r2483 **
Titta Heikkala
Updated license headers...
r2845 ** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see http://www.qt.io/terms-conditions. For further
** information use the contact form at http://www.qt.io/contact-us.
Miikka Heikkinen
Add Polar chart support...
r2483 **
Titta Heikkala
Updated license headers...
r2845 ** $QT_END_LICENSE$
**
******************************************************************************/
Miikka Heikkinen
Add Polar chart support...
r2483
// W A R N I N G
// -------------
//
Titta Heikkala
Updated private header warning...
r2807 // This file is not part of the Qt Chart API. It exists purely as an
Miikka Heikkinen
Add Polar chart support...
r2483 // implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
#ifndef LINEARROWITEM_P_H
#define LINEARROWITEM_P_H
Titta Heikkala
Fix include syntax...
r2714 #include <private/chartaxiselement_p.h>
#include <private/qabstractaxis_p.h>
#include <QtWidgets/QGraphicsLineItem>
Miikka Heikkinen
Add Polar chart support...
r2483
Titta Heikkala
Qt Charts project file structure change...
r2712 QT_CHARTS_BEGIN_NAMESPACE
Miikka Heikkinen
Add Polar chart support...
r2483
class LineArrowItem: public QGraphicsLineItem
{
public:
explicit LineArrowItem(ChartAxisElement *axis, QGraphicsItem *parent = 0)
: QGraphicsLineItem(parent),
m_axis(axis),
m_axisOrientation(axis->axis()->orientation())
{
}
protected:
void mousePressEvent(QGraphicsSceneMouseEvent *event)
{
Q_UNUSED(event)
m_axis->axisSelected();
}
QRectF boundingRect() const
{
return shape().boundingRect();
}
QPainterPath shape() const
{
QPainterPath path = QGraphicsLineItem::shape();
QRectF rect = path.boundingRect();
path.addRect(rect.adjusted(0, 0, m_axisOrientation != Qt::Horizontal ? 8 : 0, m_axisOrientation != Qt::Vertical ? 8 : 0));
return path;
}
private:
ChartAxisElement *m_axis;
Qt::Orientation m_axisOrientation;
};
Titta Heikkala
Qt Charts project file structure change...
r2712 QT_CHARTS_END_NAMESPACE
Miikka Heikkinen
Add Polar chart support...
r2483
#endif /* LINEARROWITEM_P_H */