enum class
This commit is contained in:
@@ -321,13 +321,13 @@ BlockBusItem::PointInfo BlockBusItem::pointInfo(QPointF pos) const {
|
|||||||
testPoint(pos, &pi, & si);
|
testPoint(pos, &pi, & si);
|
||||||
if (pi < 0 && si < 0) return ret;
|
if (pi < 0 && si < 0) return ret;
|
||||||
if (si >= 0) {
|
if (si >= 0) {
|
||||||
ret.type = PointInfo::tSegment;
|
ret.type = PointInfo::Type::Segment;
|
||||||
} else {
|
} else {
|
||||||
if (endpoints().contains(pi)) {
|
if (endpoints().contains(pi)) {
|
||||||
ret.type = PointInfo::tEndpoint;
|
ret.type = PointInfo::Type::Endpoint;
|
||||||
ret.pin = connections_.value(pi, nullptr);
|
ret.pin = connections_.value(pi, nullptr);
|
||||||
} else
|
} else
|
||||||
ret.type = PointInfo::tNode;
|
ret.type = PointInfo::Type::Node;
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,13 +35,13 @@ public:
|
|||||||
~BlockBusItem() {;}
|
~BlockBusItem() {;}
|
||||||
|
|
||||||
struct QAD_BLOCKVIEW_EXPORT PointInfo {
|
struct QAD_BLOCKVIEW_EXPORT PointInfo {
|
||||||
enum Type {
|
enum class Type {
|
||||||
tNone,
|
None,
|
||||||
tNode, // point > 2 segments
|
Node, // point > 2 segments
|
||||||
tEndpoint,
|
Endpoint,
|
||||||
tSegment
|
Segment
|
||||||
};
|
};
|
||||||
Type type = tNone;
|
Type type = Type::None;
|
||||||
BlockItemPin * pin = nullptr; // if tEndpoint and pin connected
|
BlockItemPin * pin = nullptr; // if tEndpoint and pin connected
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user