Active X plugin: Fix setting a control by task menu.
authorFriedemann Kleint <Friedemann.Kleint@digia.com>
Wed, 27 Feb 2013 14:49:50 +0000 (15:49 +0100)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Fri, 1 Mar 2013 19:44:49 +0000 (20:44 +0100)
The property is a QString when set by the menu or a
PropertySheetStringValue when loading the form.

Breakage introduced by
8695c1753964eeb06b5d9306010b56be5fc151c0 .

Task-number: QTBUG-29234

Change-Id: I84c3de80b99c8a20aaf1f8f7289882b0092d6a0a
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
src/designer/src/plugins/activeqt/qaxwidgetpropertysheet.cpp

index 354943f..2917f58 100644 (file)
@@ -112,8 +112,9 @@ void QAxWidgetPropertySheet::setProperty(int index, const QVariant &value)
     }
     // Loading forms: Reload
     if (name == m_controlProperty) {
-        const qdesigner_internal::PropertySheetStringValue sv = qvariant_cast<qdesigner_internal::PropertySheetStringValue>(value);
-        const QString clsid = sv.value();
+        const QString clsid = value.canConvert<qdesigner_internal::PropertySheetStringValue>() ?
+            qvariant_cast<qdesigner_internal::PropertySheetStringValue>(value).value() :
+            value.toString();
         if (clsid.isEmpty() || !axWidget()->loadControl(clsid))
             reset(index);
         else