summaryrefslogtreecommitdiffstats
path: root/tools/designer/src/plugins/activeqt
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@digia.com>2014-03-18 15:22:50 (GMT)
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-03-19 13:23:01 (GMT)
commit7fb4fefc037deac4864beb6b17476191c0b13f36 (patch)
tree54370b94d034f45072dd79695bf834af4d8e88c8 /tools/designer/src/plugins/activeqt
parentc1d177d52cfffe61198cfa5ec76bae0c2f44a362 (diff)
downloadQt-7fb4fefc037deac4864beb6b17476191c0b13f36.zip
Qt-7fb4fefc037deac4864beb6b17476191c0b13f36.tar.gz
Qt-7fb4fefc037deac4864beb6b17476191c0b13f36.tar.bz2
Store changed status of the QAxWidget's "control" property correctly.
Handle the case of it being PropertySheetStringValue. Task-number: QTBUG-37602 Change-Id: Iff54d6409ffabf48406fcfec96289848a42b3e55 Reviewed-by: Jarek Kobus <jaroslaw.kobus@digia.com> (cherry picked from qttools/9ee8213c7becfdf906ca781df4895e18b273e023)
Diffstat (limited to 'tools/designer/src/plugins/activeqt')
-rw-r--r--tools/designer/src/plugins/activeqt/qaxwidgetpropertysheet.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/tools/designer/src/plugins/activeqt/qaxwidgetpropertysheet.cpp b/tools/designer/src/plugins/activeqt/qaxwidgetpropertysheet.cpp
index d8a2558..6b1f249 100644
--- a/tools/designer/src/plugins/activeqt/qaxwidgetpropertysheet.cpp
+++ b/tools/designer/src/plugins/activeqt/qaxwidgetpropertysheet.cpp
@@ -58,6 +58,13 @@ QT_BEGIN_NAMESPACE
const char *QAxWidgetPropertySheet::controlPropertyName = "control";
+static QString designerPropertyToString(const QVariant &value)
+{
+ return value.canConvert<qdesigner_internal::PropertySheetStringValue>() ?
+ qvariant_cast<qdesigner_internal::PropertySheetStringValue>(value).value() :
+ value.toString();
+}
+
QAxWidgetPropertySheet::QAxWidgetPropertySheet(QDesignerAxWidget *object, QObject *parent) :
QDesignerPropertySheet(object, parent),
m_controlProperty(controlPropertyName),
@@ -121,9 +128,7 @@ void QAxWidgetPropertySheet::setProperty(int index, const QVariant &value)
}
// Loading forms: Reload
if (name == m_controlProperty) {
- const QString clsid = value.canConvert<qdesigner_internal::PropertySheetStringValue>() ?
- qvariant_cast<qdesigner_internal::PropertySheetStringValue>(value).value() :
- value.toString();
+ const QString clsid = designerPropertyToString(value);
if (clsid.isEmpty() || !axWidget()->loadControl(clsid))
reset(index);
else
@@ -182,7 +187,7 @@ void QAxWidgetPropertySheet::reloadPropertySheet(const struct SavedProperties &p
continue;
}
if (name == QLatin1String(controlPropertyName)) {
- sheet->setChanged(index, !i.value().toString().isEmpty());
+ sheet->setChanged(index, !designerPropertyToString(i.value()).isEmpty());
continue;
}
sheet->setChanged(index, true);