summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@digia.com>2013-02-27 15:49:50 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-03-05 07:07:12 +0100
commita536365ad52ced4e4befe1d3717fa13d74d54072 (patch)
treec001aca4ad31e05c45f9d7a39a09cf60c9cc6a5e /tools
parent7d3bae1292ee3adfc4bcba4827d2a456c703627e (diff)
downloadqt4-tools-a536365ad52ced4e4befe1d3717fa13d74d54072.tar.gz
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> (cherry picked from qttools/3e43b158ce158dc1285593d2c7555351033fc3ce)
Diffstat (limited to 'tools')
-rw-r--r--tools/designer/src/plugins/activeqt/qaxwidgetpropertysheet.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/designer/src/plugins/activeqt/qaxwidgetpropertysheet.cpp b/tools/designer/src/plugins/activeqt/qaxwidgetpropertysheet.cpp
index fa8ecb0d8e..b7cb6808e7 100644
--- a/tools/designer/src/plugins/activeqt/qaxwidgetpropertysheet.cpp
+++ b/tools/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