diff options
author | Jarek Kobus <jaroslaw.kobus@qt.io> | 2023-01-30 15:00:04 +0100 |
---|---|---|
committer | Jarek Kobus <jaroslaw.kobus@qt.io> | 2023-01-30 15:39:37 +0100 |
commit | b03fd195a14e0eb103c7171284dee8a7bb176e8d (patch) | |
tree | 09f7235137d5a9dd1ca5ab081d5f6ebe59f9e12d | |
parent | 3dcf1490cb2bce34cb1f7777dfe836310f305817 (diff) | |
download | qttools-b03fd195a14e0eb103c7171284dee8a7bb176e8d.tar.gz |
QtTools: Replace string connection leftovers with typed connections
Pick-to: 6.5
Change-Id: Ib52412754f1bba53e3cd16c5aa51716e2679c0e7
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
6 files changed, 14 insertions, 22 deletions
diff --git a/src/designer/src/lib/sdk/abstractintegration.cpp b/src/designer/src/lib/sdk/abstractintegration.cpp index bc1660a2f..896d444ab 100644 --- a/src/designer/src/lib/sdk/abstractintegration.cpp +++ b/src/designer/src/lib/sdk/abstractintegration.cpp @@ -281,8 +281,6 @@ public: void updateSelection(); void updateCustomWidgetPlugins(); - void updatePropertyPrivate(const QString &name, const QVariant &value); - void initialize(); void getSelection(qdesigner_internal::Selection &s); QObject *propertyEditorObject(); @@ -320,12 +318,9 @@ void QDesignerIntegrationPrivate::initialize() QObject::connect(designerPropertyEditor, &QDesignerPropertyEditor::resetProperty, q, &QDesignerIntegration::resetProperty); QObject::connect(designerPropertyEditor, &QDesignerPropertyEditor::addDynamicProperty, - q, &QDesignerIntegration::addDynamicProperty); + q, &QDesignerIntegration::addDynamicProperty); QObject::connect(designerPropertyEditor, &QDesignerPropertyEditor::removeDynamicProperty, - q, &QDesignerIntegration::removeDynamicProperty); - } else { - QObject::connect(core->propertyEditor(), SIGNAL(propertyChanged(QString,QVariant)), - q, SLOT(updatePropertyPrivate(QString,QVariant))); // ### fixme: VS Integration leftover? + q, &QDesignerIntegration::removeDynamicProperty); } QObject::connect(core->formWindowManager(), &QDesignerFormWindowManagerInterface::formWindowAdded, diff --git a/src/shared/qtpropertybrowser/qtpropertybrowser.h b/src/shared/qtpropertybrowser/qtpropertybrowser.h index d2731feb4..623ea5d67 100644 --- a/src/shared/qtpropertybrowser/qtpropertybrowser.h +++ b/src/shared/qtpropertybrowser/qtpropertybrowser.h @@ -123,15 +123,15 @@ public: return; m_managers.insert(manager); connectPropertyManager(manager); - connect(manager, SIGNAL(destroyed(QObject *)), - this, SLOT(managerDestroyed(QObject *))); + connect(manager, &QObject::destroyed, + this, &QtAbstractEditorFactory<PropertyManager>::managerDestroyed); } void removePropertyManager(PropertyManager *manager) { if (!m_managers.contains(manager)) return; - disconnect(manager, SIGNAL(destroyed(QObject *)), - this, SLOT(managerDestroyed(QObject *))); + disconnect(manager, &QObject::destroyed, + this, &QtAbstractEditorFactory<PropertyManager>::managerDestroyed); disconnectPropertyManager(manager); m_managers.remove(manager); } diff --git a/src/shared/qtpropertybrowser/qtpropertybrowserutils.cpp b/src/shared/qtpropertybrowser/qtpropertybrowserutils.cpp index 6c2470861..1716652f2 100644 --- a/src/shared/qtpropertybrowser/qtpropertybrowserutils.cpp +++ b/src/shared/qtpropertybrowser/qtpropertybrowserutils.cpp @@ -228,7 +228,7 @@ QtBoolEdit::QtBoolEdit(QWidget *parent) : lt->setContentsMargins(0, 0, 4, 0); lt->addWidget(m_checkBox); setLayout(lt); - connect(m_checkBox, SIGNAL(toggled(bool)), this, SIGNAL(toggled(bool))); + connect(m_checkBox, &QAbstractButton::toggled, this, &QtBoolEdit::toggled); setFocusProxy(m_checkBox); m_checkBox->setText(tr("True")); } diff --git a/src/shared/qtpropertybrowser/qttreepropertybrowser.cpp b/src/shared/qtpropertybrowser/qttreepropertybrowser.cpp index e9d3c2545..95ef2736e 100644 --- a/src/shared/qtpropertybrowser/qttreepropertybrowser.cpp +++ b/src/shared/qtpropertybrowser/qttreepropertybrowser.cpp @@ -102,7 +102,7 @@ QtPropertyEditorView::QtPropertyEditorView(QWidget *parent) : QTreeWidget(parent), m_editorPrivate(0) { - connect(header(), SIGNAL(sectionDoubleClicked(int)), this, SLOT(resizeColumnToContents(int))); + connect(header(), &QHeaderView::sectionDoubleClicked, this, &QTreeView::resizeColumnToContents); } void QtPropertyEditorView::drawRow(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const @@ -273,7 +273,8 @@ QWidget *QtPropertyEditorDelegate::createEditor(QWidget *parent, if (editor) { editor->setAutoFillBackground(true); editor->installEventFilter(const_cast<QtPropertyEditorDelegate *>(this)); - connect(editor, SIGNAL(destroyed(QObject*)), this, SLOT(slotEditorDestroyed(QObject*))); + connect(editor, &QObject::destroyed, + this, &QtPropertyEditorDelegate::slotEditorDestroyed); m_propertyToEditor[property] = editor; m_editorToProperty[editor] = property; m_editedItem = item; diff --git a/tests/auto/qhelpcontentmodel/tst_qhelpcontentmodel.cpp b/tests/auto/qhelpcontentmodel/tst_qhelpcontentmodel.cpp index 7fb3cb629..b02ff2d1c 100644 --- a/tests/auto/qhelpcontentmodel/tst_qhelpcontentmodel.cpp +++ b/tests/auto/qhelpcontentmodel/tst_qhelpcontentmodel.cpp @@ -76,8 +76,7 @@ void tst_QHelpContentModel::setupContents() h.setReadOnly(false); QHelpContentModel *m = h.contentModel(); SignalWaiter w; - connect(m, SIGNAL(contentsCreated()), - &w, SLOT(stopWaiting())); + connect(m, &QHelpContentModel::contentsCreated, &w, &SignalWaiter::stopWaiting); w.start(); h.setupData(); int i = 0; @@ -102,8 +101,7 @@ void tst_QHelpContentModel::contentItemAt() h.setReadOnly(false); QHelpContentModel *m = h.contentModel(); SignalWaiter w; - connect(m, SIGNAL(contentsCreated()), - &w, SLOT(stopWaiting())); + connect(m, &QHelpContentModel::contentsCreated, &w, &SignalWaiter::stopWaiting); w.start(); h.setupData(); int i = 0; diff --git a/tests/auto/qhelpindexmodel/tst_qhelpindexmodel.cpp b/tests/auto/qhelpindexmodel/tst_qhelpindexmodel.cpp index 10dccfc40..834ce37b0 100644 --- a/tests/auto/qhelpindexmodel/tst_qhelpindexmodel.cpp +++ b/tests/auto/qhelpindexmodel/tst_qhelpindexmodel.cpp @@ -75,8 +75,7 @@ void tst_QHelpIndexModel::setupIndex() h.setReadOnly(false); QHelpIndexModel *m = h.indexModel(); SignalWaiter w; - connect(m, SIGNAL(indexCreated()), - &w, SLOT(stopWaiting())); + connect(m, &QHelpIndexModel::indexCreated, &w, &SignalWaiter::stopWaiting); w.start(); h.setupData(); int i = 0; @@ -107,8 +106,7 @@ void tst_QHelpIndexModel::filter() h.setReadOnly(false); QHelpIndexModel *m = h.indexModel(); SignalWaiter w; - connect(m, SIGNAL(indexCreated()), - &w, SLOT(stopWaiting())); + connect(m, &QHelpIndexModel::indexCreated, &w, &SignalWaiter::stopWaiting); w.start(); h.setupData(); int i = 0; |