From 611ac50c1ed80bd6c6c15f2b39e720b6f7c1acb8 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 6 Nov 2013 16:50:18 +0100 Subject: [PATCH] Qt Designer: Implement property() for QAxWidgetPropertySheet. Access the control property of the QAxWidget directly. Task-number: QTBUG-34592 Change-Id: I7d0971ad8fc265d0443da7ae72330e2b7f3a8d70 Reviewed-by: Oliver Wolff Reviewed-by: Joerg Bornemann Reviewed-by: Friedemann Kleint --- src/designer/src/plugins/activeqt/qaxwidgetpropertysheet.cpp | 9 +++++++++ src/designer/src/plugins/activeqt/qaxwidgetpropertysheet.h | 1 + 2 files changed, 10 insertions(+) diff --git a/src/designer/src/plugins/activeqt/qaxwidgetpropertysheet.cpp b/src/designer/src/plugins/activeqt/qaxwidgetpropertysheet.cpp index 2917f58..f2c12eb 100644 --- a/src/designer/src/plugins/activeqt/qaxwidgetpropertysheet.cpp +++ b/src/designer/src/plugins/activeqt/qaxwidgetpropertysheet.cpp @@ -100,6 +100,15 @@ bool QAxWidgetPropertySheet::reset(int index) return true; } +QVariant QAxWidgetPropertySheet::property(int index) const +{ + // QTBUG-34592, accessing the 'control' property via meta object system + // may cause crashes during loading for some controls. + return propertyName(index) == m_controlProperty ? + QVariant(axWidget()->control()) : + QDesignerPropertySheet::property(index); +} + void QAxWidgetPropertySheet::setProperty(int index, const QVariant &value) { diff --git a/src/designer/src/plugins/activeqt/qaxwidgetpropertysheet.h b/src/designer/src/plugins/activeqt/qaxwidgetpropertysheet.h index 0bd4b87..402ef59 100644 --- a/src/designer/src/plugins/activeqt/qaxwidgetpropertysheet.h +++ b/src/designer/src/plugins/activeqt/qaxwidgetpropertysheet.h @@ -66,6 +66,7 @@ public: explicit QAxWidgetPropertySheet(QDesignerAxWidget *object, QObject *parent = 0); virtual bool isEnabled(int index) const; + virtual QVariant property(int index) const; virtual void setProperty(int index, const QVariant &value); virtual bool reset(int index); int indexOf(const QString &name) const; -- 2.7.4