Remove dead code "< QT_VERSION_CHECK(5, 14, 0)"

Qt Creator required Qt 5.14 or higher. Let's removed the #idef-ed code
for building against lower Qt versions.

Add a comment in porting.h where we still need such code for sdktool.

Change-Id: Ib330275208eec4a2f285b4b9f480530c171f538a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Alessandro Portale
2021-03-09 16:56:25 +01:00
parent e960062b80
commit 93fbd5be02
25 changed files with 5 additions and 159 deletions

View File

@@ -80,11 +80,7 @@ void NavigatorGraphicsView::wheelEvent(QWheelEvent *event)
else
emit zoomOut();
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
emit moveMainViewTo(mapToScene(event->pos()));
#else
emit moveMainViewTo(mapToScene(event->position().toPoint()));
#endif
} else
QGraphicsView::wheelEvent(event);
}

View File

@@ -225,11 +225,7 @@ void layout(const QList<QGraphicsItem*> &items)
firstItem = initialItem->outputTransitions().constFirst()->connectedItem(initialItem);
int index = childItems.indexOf(firstItem);
if (index > 0)
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
childItems.swap(index, 0);
#else
childItems.swapItemsAt(index, 0);
#endif
}
// Search final-item

View File

@@ -306,19 +306,11 @@ void TransitionItem::mousePressEvent(QGraphicsSceneMouseEvent *event)
QPointF intersPoint;
QLineF line2(p, p + QPointF(SELECTION_DISTANCE, SELECTION_DISTANCE));
line2.setAngle(line.angle() + 90);
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
if (line.intersect(line2, &intersPoint) == QLineF::BoundedIntersection)
#else
if (line.intersects(line2, &intersPoint) == QLineF::BoundedIntersection)
#endif
if (line.intersects(line2, &intersPoint) == QLineF::BoundedIntersection) {
sel = true;
else {
} else {
line2.setAngle(line.angle() - 90);
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
sel = line.intersect(line2, &intersPoint) == QLineF::BoundedIntersection;
#else
sel = line.intersects(line2, &intersPoint) == QLineF::BoundedIntersection;
#endif
}
if (sel)
@@ -805,11 +797,7 @@ QPointF TransitionItem::findIntersectionPoint(ConnectableItem *item, const QLine
for (int i = 1; i < itemPolygon.count(); ++i) {
p2 = itemPolygon.at(i) + item->scenePos();
checkLine = QLineF(p1, p2);
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
if (checkLine.intersect(line, &intersectPoint) == QLineF::BoundedIntersection)
#else
if (checkLine.intersects(line, &intersectPoint) == QLineF::BoundedIntersection)
#endif
return intersectPoint;
p1 = p2;
}
@@ -1096,19 +1084,11 @@ bool TransitionItem::containsScenePoint(const QPointF &p) const
QPointF intersPoint;
QLineF line2(pp, pp + QPointF(SELECTION_DISTANCE, SELECTION_DISTANCE));
line2.setAngle(line.angle() + 90);
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
if (line.intersect(line2, &intersPoint) == QLineF::BoundedIntersection) {
#else
if (line.intersects(line2, &intersPoint) == QLineF::BoundedIntersection) {
#endif
return true;
} else {
line2.setAngle(line.angle() - 90);
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
if (line.intersect(line2, &intersPoint) == QLineF::BoundedIntersection)
#else
if (line.intersects(line2, &intersPoint) == QLineF::BoundedIntersection)
#endif
return true;
}
}