diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-05-25 12:06:57 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-06-03 07:22:11 +0000 |
commit | 0666b552bfc145b2a880ca83a1a72a8dfdce477e (patch) | |
tree | 7b5078f3a1cfb60ae9771c803204ec1c6261bff1 | |
parent | a6d21ccb86b10840be7cc5e3287a31c4e72d6c47 (diff) |
Qt Designer/Active Qt Plugin: Adapt to newly introduced base classes
There is now a QAxBaseWidget, which needs to be handled.
Change-Id: I9e69e23c2af441d2edb1b27e84ae50095ac9bced
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
3 files changed, 18 insertions, 4 deletions
diff --git a/src/designer/src/plugins/activeqt/qaxwidgetpropertysheet.cpp b/src/designer/src/plugins/activeqt/qaxwidgetpropertysheet.cpp index e1236b274..f6e2e2639 100644 --- a/src/designer/src/plugins/activeqt/qaxwidgetpropertysheet.cpp +++ b/src/designer/src/plugins/activeqt/qaxwidgetpropertysheet.cpp @@ -70,6 +70,12 @@ bool QAxWidgetPropertySheet::isEnabled(int index) const return QDesignerPropertySheet::isEnabled(index); } +bool QAxWidgetPropertySheet::isVisible(int index) const +{ + // classContext is ulong, which the property editor does not support + return propertyName(index) != QLatin1String("classContext"); +} + bool QAxWidgetPropertySheet::dynamicPropertiesAllowed() const { return false; diff --git a/src/designer/src/plugins/activeqt/qaxwidgetpropertysheet.h b/src/designer/src/plugins/activeqt/qaxwidgetpropertysheet.h index 93ff577aa..8bea29a4e 100644 --- a/src/designer/src/plugins/activeqt/qaxwidgetpropertysheet.h +++ b/src/designer/src/plugins/activeqt/qaxwidgetpropertysheet.h @@ -53,6 +53,7 @@ public: explicit QAxWidgetPropertySheet(QDesignerAxWidget *object, QObject *parent = 0); bool isEnabled(int index) const override; + bool isVisible(int index) const override; QVariant property(int index) const override; void setProperty(int index, const QVariant &value) override; bool reset(int index) override; diff --git a/src/designer/src/plugins/activeqt/qdesigneraxwidget.cpp b/src/designer/src/plugins/activeqt/qdesigneraxwidget.cpp index d0170d899..6aff47f47 100644 --- a/src/designer/src/plugins/activeqt/qdesigneraxwidget.cpp +++ b/src/designer/src/plugins/activeqt/qdesigneraxwidget.cpp @@ -206,6 +206,12 @@ static QString msgComException(const QObject *o, const QMetaObject::Call call, i #endif // QT_NO_EXCEPTIONS +static bool isInheritedCall(const QMetaObject *mo, QMetaObject::Call call, int id) +{ + return call == QMetaObject::InvokeMetaMethod + ? (id < mo->methodOffset()) : (id < mo->propertyOffset()); +} + int QDesignerAxPluginWidget::qt_metacall(QMetaObject::Call call, int signal, void **argv) { QAxWidget *aw = axobject(); @@ -215,10 +221,11 @@ int QDesignerAxPluginWidget::qt_metacall(QMetaObject::Call call, int signal, voi const QMetaObject *mo = metaObject(); // Have base class handle inherited stuff (geometry, enabled...) - const bool inherited = call == QMetaObject::InvokeMetaMethod ? - (signal < mo->methodOffset()) : (signal < mo->propertyOffset()); - if (inherited) - return QDesignerAxWidget::qt_metacall(call, signal, argv); + if (isInheritedCall(mo, call, signal)) { + // Skip over QAxBaseWidget + return isInheritedCall(mo->superClass(), call, signal) + ? QDesignerAxWidget::qt_metacall(call, signal, argv) : -1; + } int rc = -1; #ifndef QT_NO_EXCEPTIONS |