From 3e43b158ce158dc1285593d2c7555351033fc3ce Mon Sep 17 00:00:00 2001 From: Friedemann Kleint <Friedemann.Kleint@digia.com> Date: Wed, 27 Feb 2013 15:49:50 +0100 Subject: [PATCH] Active X plugin: Fix setting a control by task menu. 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 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/designer/src/plugins/activeqt/qaxwidgetpropertysheet.cpp b/src/designer/src/plugins/activeqt/qaxwidgetpropertysheet.cpp index 354943ff5..2917f586b 100644 --- a/src/designer/src/plugins/activeqt/qaxwidgetpropertysheet.cpp +++ b/src/designer/src/plugins/activeqt/qaxwidgetpropertysheet.cpp @@ -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 -- GitLab