From d933aebd1b1be0eba68d7ba4d85f144bad839a8d Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 6 Nov 2013 16:50:18 +0100 Subject: 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 (cherry picked from qttools/611ac50c1ed80bd6c6c15f2b39e720b6f7c1acb8) --- tools/designer/src/plugins/activeqt/qaxwidgetpropertysheet.cpp | 9 +++++++++ tools/designer/src/plugins/activeqt/qaxwidgetpropertysheet.h | 1 + 2 files changed, 10 insertions(+) diff --git a/tools/designer/src/plugins/activeqt/qaxwidgetpropertysheet.cpp b/tools/designer/src/plugins/activeqt/qaxwidgetpropertysheet.cpp index b7cb680..d8a2558 100644 --- a/tools/designer/src/plugins/activeqt/qaxwidgetpropertysheet.cpp +++ b/tools/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/tools/designer/src/plugins/activeqt/qaxwidgetpropertysheet.h b/tools/designer/src/plugins/activeqt/qaxwidgetpropertysheet.h index 0bd4b87..402ef59 100644 --- a/tools/designer/src/plugins/activeqt/qaxwidgetpropertysheet.h +++ b/tools/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; -- cgit v0.12