MCPcopy Create free account
hub / github.com/KDE/labplot / showWillSettings

Method showWillSettings

src/frontend/datasources/ImportFileWidget.cpp:2964–2987  ·  view source on GitHub ↗

! * \brief Shows the mqtt will settings widget, which allows the user to modify the will settings */

Source from the content-addressed store, hash-verified

2962 * \brief Shows the mqtt will settings widget, which allows the user to modify the will settings
2963 */
2964void ImportFileWidget::showWillSettings() {
2965 QMenu menu;
2966
2967 QVector<QTreeWidgetItem*> children;
2968 for (int i = 0; i < m_subscriptionWidget->subscriptionCount(); ++i)
2969 MQTTSubscriptionWidget::findSubscriptionLeafChildren(children, m_subscriptionWidget->topLevelSubscription(i));
2970
2971 QVector<QString> topics;
2972 for (const auto& child : children)
2973 topics.append(child->text(0));
2974
2975 MQTTWillSettingsWidget willSettingsWidget(&menu, m_willSettings, topics);
2976
2977 connect(&willSettingsWidget, &MQTTWillSettingsWidget::applyClicked, [this, &menu, &willSettingsWidget]() {
2978 m_willSettings = willSettingsWidget.will();
2979 menu.close();
2980 });
2981 auto* widgetAction = new QWidgetAction(this);
2982 widgetAction->setDefaultWidget(&willSettingsWidget);
2983 menu.addAction(widgetAction);
2984
2985 const QPoint pos(ui.bLWT->sizeHint().width(), ui.bLWT->sizeHint().height());
2986 menu.exec(ui.bLWT->mapToGlobal(pos));
2987}
2988
2989void ImportFileWidget::enableWill(bool enable) {
2990 ui.bLWT->setEnabled(enable);

Callers

nothing calls this directly

Calls 10

subscriptionCountMethod · 0.80
topLevelSubscriptionMethod · 0.80
appendMethod · 0.80
willMethod · 0.80
heightMethod · 0.80
execMethod · 0.80
textMethod · 0.45
closeMethod · 0.45
widthMethod · 0.45
sizeHintMethod · 0.45

Tested by

no test coverage detected