Skip to content

Commit 254ecfa

Browse files
committed
member m_altColor made private
1 parent 1251e15 commit 254ecfa

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

src/qconstraints.cpp

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
#include <Eigen/Core>
3737

3838
#include <cassert>
39-
#include <cfloat>
4039
#include <cmath>
4140
#include <memory>
4241

@@ -71,14 +70,12 @@ QConstraintBase::QConstraintBase()
7170
}
7271

7372
QConstraintBase::QConstraintBase(const QConstraintBase &other)
74-
: // QGraphicsItem(),
75-
m_altColor(other.m_altColor)
76-
, m_pen_req(other.m_pen_req)
73+
: m_pen_req(other.m_pen_req)
7774
, m_pen_red(other.m_pen_red)
7875
, m_is_required(other.m_is_required)
7976
, m_is_enforced(other.m_is_enforced)
77+
, m_altColor(other.m_altColor)
8078
{
81-
// qDebug() << Q_FUNC_INFO << m_sc;
8279
setVisible( s_show);
8380

8481
setFlag(ItemIsSelectable, true);
@@ -215,7 +212,7 @@ void QAligned::paint( QPainter *painter,
215212
}
216213

217214
if ( showColor() ) {
218-
pen.setColor( m_altColor);
215+
pen.setColor( altColor() );
219216
}
220217

221218
painter->setPen( pen );
@@ -306,7 +303,7 @@ void QOrthogonal::paint( QPainter *painter,
306303
}
307304

308305
if ( showColor() ) {
309-
pen.setColor( m_altColor);
306+
pen.setColor( altColor() );
310307
}
311308

312309
painter->setPen( pen );
@@ -422,7 +419,7 @@ void QCopunctual::paint( QPainter *painter,
422419
QPen pen = QPen( required() ? m_pen_req : m_pen_red);
423420

424421
if ( showColor()) {
425-
pen.setColor( m_altColor);
422+
pen.setColor( altColor() );
426423
}
427424
if ( !enforced() ) {
428425
pen.setColor(Qt::red);
@@ -541,7 +538,7 @@ void QParallel::paint( QPainter *painter,
541538
QPen pen = QPen( required() ? m_pen_req : m_pen_red);
542539

543540
if ( showColor() ) {
544-
pen.setColor( m_altColor);
541+
pen.setColor( altColor() );
545542
}
546543

547544
if ( !enforced() ) {

src/qconstraints.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ class QConstraintBase : public QGraphicsItem
7373
void setLineWidth( int w); //!< Set line width
7474
void setLineStyle( int s); //!< Set line style
7575
void setAltColor( const QColor &col ); //!< Set color for automatic colorization
76+
[[nodiscard]] QColor altColor() const {return m_altColor;}
7677
void setStatus( bool isrequired, bool isenforced); //!< Set status
7778

7879
virtual void setMarkerSize ( qreal s) = 0; //!< Set marker size
@@ -111,7 +112,6 @@ class QConstraintBase : public QGraphicsItem
111112
static QPen s_defaultPenRed; //!< Default pen for redundant constraints
112113
static QPen s_penSelected; //!< Pen for selection
113114

114-
QColor m_altColor; //!< Color for automatic colorization (subtasks)
115115
QPen m_pen_req; //!< Pen for required constraint
116116
QPen m_pen_red; //!< Pen for redundant constraint
117117

@@ -126,6 +126,8 @@ class QConstraintBase : public QGraphicsItem
126126
bool m_is_required = true; //!< Constraint is required? (for painting)
127127
bool m_is_enforced = false; //!< Constraint is enforced? (for painting)
128128

129+
QColor m_altColor; //!< Color for automatic colorization of subtasks
130+
129131
static bool s_showColor;
130132
static bool s_show;
131133
};

0 commit comments

Comments
 (0)