QmlDesigner: Don't instance MediaPlayer

Task-number: QTCREATORBUG-11323
Change-Id: I37629f9d6cdcb1ff12bc86ed9296e8d5af744ac4
Hotfix: 3.1
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
This commit is contained in:
Marco Bubke
2014-03-20 18:21:10 +01:00
parent 8fd5f15e83
commit d59f5c1955
@@ -1056,6 +1056,16 @@ static bool isWindowMetaObject(const QMetaObject *metaObject)
return false;
}
static bool isCrashingType(QQmlType *type)
{
if (type) {
if (type->qmlTypeName() == QStringLiteral("QtMultimedia/MediaPlayer"))
return true;
}
return false;
}
static QObject *createDummyWindow(QQmlContext *context, const QUrl &sourceUrl)
{
QQmlComponent component(context->engine());
@@ -1086,7 +1096,9 @@ QObject *ObjectNodeInstance::createPrimitive(const QString &typeName, int majorN
QObject *object = 0;
QQmlType *type = getQmlType(typeName, majorNumber, minorNumber);
if (type) {
if (isCrashingType(type)) {
object = new QObject;
} else if (type) {
#if (QT_VERSION >= QT_VERSION_CHECK(5, 2, 0)) // TODO remove hack later if we only support >= 5.2
if ( type->isComposite()) {
object = createComponent(type->sourceUrl(), context);