10 #include <QVBoxLayout>
34 if (identifier.
isEmpty()) {
return; }
42 cb->setObjectName(identifier);
43 cb->setProperty(
"pluginIdentifier", identifier);
48 pw->layout()->addWidget(cb);
53 config->setToolTip(
"Plugin configuration");
54 m_configButtonMapper->
setMapping(config, identifier);
56 pw->layout()->addWidget(config);
67 auto *cb = findChild<QCheckBox *>(identifier);
72 void CPluginSelector::handlePluginStateChange()
74 auto *cb = qobject_cast<QCheckBox *>(
sender());
78 Q_ASSERT(cb->property(
"pluginIdentifier").isValid());
79 const QString identifier = cb->property(
"pluginIdentifier").toString();
80 Q_ASSERT(!identifier.
isEmpty());
void addPlugin(const QString &identifier, const QString &name, bool hasConfig=false, bool enabled=true)
Adds the new plugin to the list.
void setEnabled(const QString &identifier, bool enabled)
Enables/disabled the given plugin.
void pluginStateChanged(const QString &identifier, bool enabled)
Emitted when user enables/disables the particular plugin.
CPluginSelector(QWidget *parent=nullptr)
Constructor.
void pluginConfigRequested(const QString &identifier)
Emitted when user clicks the "Settings" button.
static const QPixmap & wrench16()
Wrench.
void checkStateChanged(Qt::CheckState state)
void setContentsMargins(const QMargins &margins)
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
QObject * sender() const const
void setObjectName(QAnyStringView name)
void mappedString(const QString &text)
void setMapping(QObject *sender, QObject *object)
bool isEmpty() const const
#define SWIFT_VERIFY_X(COND, WHERE, WHAT)
A weaker kind of assert.