10 #include <QGraphicsItem> 11 #include <QGraphicsScene> 27 for (
int i = 0; i < m_segments.count(); i++) {
28 QGraphicsItem *item = m_segments [i];
44 m_segments.push_back (item);
49 for (
int i = 0; i < m_segments.count(); i++) {
50 QGraphicsItem *item = m_segments [i];
51 if (item !=
nullptr) {
54 QGraphicsLineItem *itemLine = dynamic_cast<QGraphicsLineItem*> (item);
55 QGraphicsEllipseItem *itemArc = dynamic_cast<QGraphicsEllipseItem*> (item);
56 if (itemLine !=
nullptr) {
57 itemLine->setPen (pen);
58 }
else if (itemArc !=
nullptr) {
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.
#define ENGAUGE_ASSERT(cond)
Drop in replacement for Q_ASSERT if defined(QT_NO_DEBUG) && !defined(QT_FORCE_ASSERTS) define ENGAUGE...