ExtensionManager: Avoid using QSignalMapper

Follows 96085f327b
Amends 81163b431e

Change-Id: Ibb23642e7f13c9101bac1f9db730865db68a4270
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
Jarek Kobus
2024-08-23 07:43:42 +02:00
parent a76e23434b
commit 43fce05a68

View File

@@ -45,7 +45,6 @@
#include <QPainter>
#include <QProgressDialog>
#include <QScrollArea>
#include <QSignalMapper>
#include <QTextDocument>
#include <QTextBlock>
@@ -337,8 +336,6 @@ public:
QHBoxLayout *layout = new QHBoxLayout(this);
setLayout(layout);
layout->setContentsMargins({});
m_signalMapper = new QSignalMapper(this);
connect(m_signalMapper, &QSignalMapper::mappedString, this, &TagList::tagSelected);
}
void setTags(const QStringList &tags)
@@ -360,8 +357,7 @@ public:
for (const QString &tag : tags) {
QAbstractButton *tagButton = new Button(tag, Button::Tag);
connect(tagButton, &QAbstractButton::clicked,
m_signalMapper, qOverload<>(&QSignalMapper::map));
m_signalMapper->setMapping(tagButton, tag);
this, [this, tag] { emit tagSelected(tag); });
flow.addItem(tagButton);
}
@@ -376,7 +372,6 @@ signals:
private:
QWidget *m_container = nullptr;
QSignalMapper *m_signalMapper;
};
class ExtensionManagerWidget final : public Core::ResizeSignallingWidget