Compile without RTTI support
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
Tue, 3 Jul 2012 12:10:20 +0000 (14:10 +0200)
committerQt by Nokia <qt-info@nokia.com>
Wed, 4 Jul 2012 08:12:10 +0000 (10:12 +0200)
We need to be able to compile without RTTI support. Fortunately
QPaintEngine has built-in type info. No RTTI support is the
default configuration on Windows with MSVC2010, so this is
required to fix the build there.

Change-Id: I89b1ed4879fd0e8e0d61ef12d77f6961fd0b07e5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
src/quick/designer/designersupport.cpp
src/quick/items/context2d/qquickcontext2dcommandbuffer.cpp

index d389190..006843a 100644 (file)
@@ -199,7 +199,9 @@ 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));
     QQuickAnchors *anchors = fromItemPrivate->anchors();
     return anchors->fill() == toItem
index d231609..196981d 100644 (file)
@@ -465,8 +465,10 @@ void QQuickContext2DCommandBuffer::replay(QPainter* p, QQuickContext2D::State& s
                     sr.setTop(srBottom);
 
                     tex->bind();
-                    QOpenGL2PaintEngineEx *engine = dynamic_cast<QOpenGL2PaintEngineEx *>(p->paintEngine());
-                    engine->drawTexture(dr, tex->textureId(), tex->textureSize(), sr);
+                    if (p->paintEngine()->type() == QPaintEngine::OpenGL2) {
+                        QOpenGL2PaintEngineEx *engine = static_cast<QOpenGL2PaintEngineEx *>(p->paintEngine());
+                        engine->drawTexture(dr, tex->textureId(), tex->textureSize(), sr);
+                    }
                 }
             }
             break;