Remove bogus dynamic and static casts.
authorSérgio Martins <sergio.martins@kdab.com>
Tue, 26 May 2015 10:01:01 +0000 (11:01 +0100)
committerSérgio Martins <sergio.martins@kdab.com>
Sat, 6 Jun 2015 11:06:46 +0000 (11:06 +0000)
QQuickItemPrivate::get() already returns the correct type.

Change-Id: I580d78e72f2ac20abb575dac7ffe468ab10b5c40
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
src/quick/designer/designersupport.cpp

index 56d2badb628a82963a2cd89e90524a45fe5ad009..3f66e81ea7c01b607ea3d846368e40d62db054b1 100644 (file)
@@ -213,10 +213,7 @@ bool isValidAnchorName(const QString &name)
 
 bool DesignerSupport::isAnchoredTo(QQuickItem *fromItem, QQuickItem *toItem)
 {
-#ifndef QT_NO_DYNAMIC_CAST
-    Q_ASSERT(dynamic_cast<QQuickItemPrivate*>(QQuickItemPrivate::get(fromItem)));
-#endif
-    QQuickItemPrivate *fromItemPrivate = static_cast<QQuickItemPrivate*>(QQuickItemPrivate::get(fromItem));
+    QQuickItemPrivate *fromItemPrivate = QQuickItemPrivate::get(fromItem);
     QQuickAnchors *anchors = fromItemPrivate->anchors();
     return anchors->fill() == toItem
             || anchors->centerIn() == toItem
@@ -246,7 +243,7 @@ bool DesignerSupport::areChildrenAnchoredTo(QQuickItem *fromItem, QQuickItem *to
 
 QQuickAnchors *anchors(QQuickItem *item)
 {
-    QQuickItemPrivate *itemPrivate = static_cast<QQuickItemPrivate*>(QQuickItemPrivate::get(item));
+    QQuickItemPrivate *itemPrivate = QQuickItemPrivate::get(item);
     return itemPrivate->anchors();
 }
 
@@ -398,7 +395,7 @@ QList<QObject*> DesignerSupport::statesForItem(QQuickItem *item)
 
 bool DesignerSupport::isComponentComplete(QQuickItem *item)
 {
-    return static_cast<QQuickItemPrivate*>(QQuickItemPrivate::get(item))->componentComplete;
+    return QQuickItemPrivate::get(item)->componentComplete;
 }
 
 int DesignerSupport::borderWidth(QQuickItem *item)