7 #include "EngaugeAssert.h" 10 #include <QGraphicsItem> 11 #include <QGraphicsScene> 18 GridLine::~GridLine ()
22 for (
int i = 0; i < m_segments.count(); i++) {
23 QGraphicsItem *item = m_segments [i];
32 ENGAUGE_ASSERT (
false);
37 ENGAUGE_ASSERT (
false);
44 m_segments.push_back (item);
49 for (
int i = 0; i < m_segments.count(); i++) {
50 QGraphicsItem *item = m_segments [i];
54 QGraphicsLineItem *itemLine =
dynamic_cast<QGraphicsLineItem*
> (item);
55 QGraphicsEllipseItem *itemArc =
dynamic_cast<QGraphicsEllipseItem*
> (item);
57 itemLine->setPen (pen);
58 }
else if (itemArc != 0) {
59 itemArc->setPen (pen);
67 for (
int i = 0; i < m_segments.count(); i++) {
68 QGraphicsItem *item = m_segments [i];
69 item->setVisible (visible);
GridLine()
Default constructor for storage in containers.
GridLine & operator=(GridLine &other)
Assignment constructor. This will assert if called since copying of pointer containers is problematic...
void setPen(const QPen &pen)
Set the pen style.
Single grid line drawn a straight or curved line.
void setVisible(bool visible)
Set each grid line as visible or hidden.
void add(QGraphicsItem *item)
Add graphics item which represents one segment of the line.