diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-05-13 08:05:39 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-05-28 07:48:53 +0200 |
commit | 592dcba7276b129220a27af3bef44a736ca347ba (patch) | |
tree | b5d19d615a54ff109f3fce0bea71589f971a3416 /tools | |
parent | 9bd2e8f1cc1f98a0fb613e20a971e9eee22e19ae (diff) |
Remove hard-coded QMetaObject data
Introduce QAxBaseObject and QAxBaseWidget providing
the static properties and signals of QAxObject and QAxWidget.
Rename the QAxBase methods to be called from the metacall
implementations of QAxObject and QAxWidget.
Add "classContext" as a real property on this occasion.
Change-Id: Ia4f4e45e091e2d575ed9e6b2dd212139a1146300
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/dumpcpp/main.cpp | 2 | ||||
-rw-r--r-- | tools/testcon/invokemethod.cpp | 4 | ||||
-rw-r--r-- | tools/testcon/mainwindow.cpp | 14 |
3 files changed, 9 insertions, 11 deletions
diff --git a/tools/dumpcpp/main.cpp b/tools/dumpcpp/main.cpp index d50c65d..baabdb4 100644 --- a/tools/dumpcpp/main.cpp +++ b/tools/dumpcpp/main.cpp @@ -272,7 +272,7 @@ void generateClassDecl(QTextStream &out, const QMetaObject *mo, continue; QByteArray propertyName(property.name()); - if (propertyName == "control" || propertyName == className) + if (propertyName == className) continue; if (!(category & OnlyInlines)) { diff --git a/tools/testcon/invokemethod.cpp b/tools/testcon/invokemethod.cpp index 32021ea..1651537 100644 --- a/tools/testcon/invokemethod.cpp +++ b/tools/testcon/invokemethod.cpp @@ -68,7 +68,7 @@ void InvokeMethod::setControl(QAxBase *ax) return; } - const QMetaObject *mo = activex->metaObject(); + const QMetaObject *mo = activex->axBaseMetaObject(); if (mo->methodCount()) { for (int i = mo->methodOffset(); i < mo->methodCount(); ++i) { const QMetaMethod method = mo->method(i); @@ -113,7 +113,7 @@ void InvokeMethod::on_comboMethods_textActivated(const QString &method) return; listParameters->clear(); - const QMetaObject *mo = activex->metaObject(); + const QMetaObject *mo = activex->axBaseMetaObject(); const QMetaMethod slot = mo->method(mo->indexOfSlot(method.toLatin1())); QString signature = QString::fromLatin1(slot.methodSignature()); signature.remove(0, signature.indexOf(QLatin1Char('(')) + 1); diff --git a/tools/testcon/mainwindow.cpp b/tools/testcon/mainwindow.cpp index 7bcc483..00a33a4 100644 --- a/tools/testcon/mainwindow.cpp +++ b/tools/testcon/mainwindow.cpp @@ -549,17 +549,15 @@ void MainWindow::updateGUI() const auto axw = axWidgets(); for (QAxWidget *container : axw) { - container->disconnect(SIGNAL(signal(QString,int,void*))); + disconnect(container, &QAxWidget::signal, this, nullptr); if (actionLogSignals->isChecked()) - connect(container, SIGNAL(signal(QString,int,void*)), this, SLOT(logSignal(QString,int,void*))); + connect(container, &QAxWidget::signal, this, &MainWindow::logSignal); + disconnect(container, &QAxWidget::exception, this, nullptr); + connect(container, &QAxWidget::exception, this, &MainWindow::logException); - container->disconnect(SIGNAL(exception(int,QString,QString,QString))); - connect(container, SIGNAL(exception(int,QString,QString,QString)), - this, SLOT(logException(int,QString,QString,QString))); - - container->disconnect(SIGNAL(propertyChanged(QString))); + disconnect(container, &QAxWidget::propertyChanged, this, nullptr); if (actionLogProperties->isChecked()) - connect(container, SIGNAL(propertyChanged(QString)), this, SLOT(logPropertyChanged(QString))); + connect(container, &QAxWidget::propertyChanged, this, &MainWindow::logPropertyChanged); container->blockSignals(actionFreezeEvents->isChecked()); } } |