forked from qt-creator/qt-creator
ExtensionManager: Avoid using QSignalMapper
Follows96085f327b
Amends81163b431e
Change-Id: Ibb23642e7f13c9101bac1f9db730865db68a4270 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
@@ -45,7 +45,6 @@
|
|||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
#include <QProgressDialog>
|
#include <QProgressDialog>
|
||||||
#include <QScrollArea>
|
#include <QScrollArea>
|
||||||
#include <QSignalMapper>
|
|
||||||
#include <QTextDocument>
|
#include <QTextDocument>
|
||||||
#include <QTextBlock>
|
#include <QTextBlock>
|
||||||
|
|
||||||
@@ -337,8 +336,6 @@ public:
|
|||||||
QHBoxLayout *layout = new QHBoxLayout(this);
|
QHBoxLayout *layout = new QHBoxLayout(this);
|
||||||
setLayout(layout);
|
setLayout(layout);
|
||||||
layout->setContentsMargins({});
|
layout->setContentsMargins({});
|
||||||
m_signalMapper = new QSignalMapper(this);
|
|
||||||
connect(m_signalMapper, &QSignalMapper::mappedString, this, &TagList::tagSelected);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void setTags(const QStringList &tags)
|
void setTags(const QStringList &tags)
|
||||||
@@ -360,8 +357,7 @@ public:
|
|||||||
for (const QString &tag : tags) {
|
for (const QString &tag : tags) {
|
||||||
QAbstractButton *tagButton = new Button(tag, Button::Tag);
|
QAbstractButton *tagButton = new Button(tag, Button::Tag);
|
||||||
connect(tagButton, &QAbstractButton::clicked,
|
connect(tagButton, &QAbstractButton::clicked,
|
||||||
m_signalMapper, qOverload<>(&QSignalMapper::map));
|
this, [this, tag] { emit tagSelected(tag); });
|
||||||
m_signalMapper->setMapping(tagButton, tag);
|
|
||||||
flow.addItem(tagButton);
|
flow.addItem(tagButton);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -376,7 +372,6 @@ signals:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
QWidget *m_container = nullptr;
|
QWidget *m_container = nullptr;
|
||||||
QSignalMapper *m_signalMapper;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class ExtensionManagerWidget final : public Core::ResizeSignallingWidget
|
class ExtensionManagerWidget final : public Core::ResizeSignallingWidget
|
||||||
|
Reference in New Issue
Block a user