[education/rkward] rkward: Fix for MSVC
Thomas Friedrichsmeier
null at kde.org
Wed Sep 24 13:56:58 BST 2025
Git commit 36fa59914e87122ffff6007e0c9b834a375d484d by Thomas Friedrichsmeier.
Committed on 24/09/2025 at 12:56.
Pushed by tfry into branch 'master'.
Fix for MSVC
M +1 -1 rkward/dialogs/rkloadlibsdialog.cpp
M +3 -2 rkward/misc/rkcompatibility.h
M +1 -1 rkward/misc/rkfindbar.cpp
M +1 -1 rkward/misc/rksaveobjectchooser.cpp
M +1 -1 rkward/plugin/rkcheckbox.cpp
M +1 -1 rkward/settings/rksettingsmodule.cpp
M +1 -1 rkward/settings/rksettingsmoduleconsole.cpp
M +1 -1 rkward/settings/rksettingsmoduleoutput.cpp
M +4 -4 rkward/settings/rksettingsmodulewatch.cpp
https://invent.kde.org/education/rkward/-/commit/36fa59914e87122ffff6007e0c9b834a375d484d
diff --git a/rkward/dialogs/rkloadlibsdialog.cpp b/rkward/dialogs/rkloadlibsdialog.cpp
index 68779b11b..4975b53ea 100644
--- a/rkward/dialogs/rkloadlibsdialog.cpp
+++ b/rkward/dialogs/rkloadlibsdialog.cpp
@@ -662,7 +662,7 @@ InstallPackagesWidget::InstallPackagesWidget(RKLoadLibsDialog *dialog) : RKLoadL
connect(filter_edit, &RKDynamicSearchLine::searchChanged, this, &InstallPackagesWidget::filterChanged);
rkward_packages_only = new QCheckBox(i18n("Show only packages providing RKWard dialogs"), this);
RKCommonFunctions::setTips(i18n("<p>Some but not all R packages come with plugins for RKWard. That means they provide a graphical user-interface in addition to R functions. Check this box to show only such packages.</p>"), rkward_packages_only);
- connect(rkward_packages_only, RKCompatibility::QCheckBox_checkStateChanged, this, &InstallPackagesWidget::filterChanged);
+ connect(rkward_packages_only, RKCompatibility::QCheckBox_checkStateChanged(), this, &InstallPackagesWidget::filterChanged);
filterChanged();
horizontalSeparator = new QFrame(this);
diff --git a/rkward/misc/rkcompatibility.h b/rkward/misc/rkcompatibility.h
index 6c7945ef8..8d9779a2a 100644
--- a/rkward/misc/rkcompatibility.h
+++ b/rkward/misc/rkcompatibility.h
@@ -15,9 +15,10 @@ This namespace holds helpers for supporting different versions of Q6/KF6, withou
*/
namespace RKCompatibility {
#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0)
-inline const constexpr auto QCheckBox_checkStateChanged = &QCheckBox::checkStateChanged;
+// NOTE: defining this as a plain (non-function) constant produces incorrect results on MSVC
+inline const constexpr auto QCheckBox_checkStateChanged() { return &QCheckBox::checkStateChanged; };
#else
-inline const constexpr auto QCheckBox_checkStateChanged = &QCheckBox::stateChanged;
+inline const constexpr auto QCheckBox_checkStateChanged() { return &QCheckBox::stateChanged; };
#endif
}; //namespace RKCompatibility
diff --git a/rkward/misc/rkfindbar.cpp b/rkward/misc/rkfindbar.cpp
index 2383d1303..cf18a03d8 100644
--- a/rkward/misc/rkfindbar.cpp
+++ b/rkward/misc/rkfindbar.cpp
@@ -97,7 +97,7 @@ QCheckBox *RKFindBar::getOption(const RKFindBar::FindOptions option) {
RK_ASSERT(false);
return nullptr;
}
- connect(action, RKCompatibility::QCheckBox_checkStateChanged, this, &RKFindBar::searchChanged);
+ connect(action, RKCompatibility::QCheckBox_checkStateChanged(), this, &RKFindBar::searchChanged);
default_actions.insert(option, action);
}
diff --git a/rkward/misc/rksaveobjectchooser.cpp b/rkward/misc/rksaveobjectchooser.cpp
index 14bc78ffc..421b42444 100644
--- a/rkward/misc/rksaveobjectchooser.cpp
+++ b/rkward/misc/rksaveobjectchooser.cpp
@@ -53,7 +53,7 @@ RKSaveObjectChooser::RKSaveObjectChooser(QWidget *parent, const QString &initial
layout->addWidget(name_edit);
overwrite_confirm = new QCheckBox(i18n("Overwrite"), this);
- connect(overwrite_confirm, RKCompatibility::QCheckBox_checkStateChanged, this, &RKSaveObjectChooser::updateState);
+ connect(overwrite_confirm, RKCompatibility::QCheckBox_checkStateChanged(), this, &RKSaveObjectChooser::updateState);
overwrite_warn = new KMessageWidget(i18n("The given object name already exists"));
overwrite_warn->setCloseButtonVisible(false);
hlayout = new QHBoxLayout();
diff --git a/rkward/plugin/rkcheckbox.cpp b/rkward/plugin/rkcheckbox.cpp
index ba927bc72..4ef326e33 100644
--- a/rkward/plugin/rkcheckbox.cpp
+++ b/rkward/plugin/rkcheckbox.cpp
@@ -30,7 +30,7 @@ RKCheckBox::RKCheckBox(const QDomElement &element, RKComponent *parent_component
checkbox = new QCheckBox(xml->i18nStringAttribute(element, QStringLiteral("label"), QString(), DL_WARNING), this);
vbox->addWidget(checkbox);
checkbox->setChecked(xml->getBoolAttribute(element, QStringLiteral("checked"), false, DL_INFO));
- connect(checkbox, RKCompatibility::QCheckBox_checkStateChanged, this, &RKCheckBox::changedStateFromUi);
+ connect(checkbox, RKCompatibility::QCheckBox_checkStateChanged(), this, &RKCheckBox::changedStateFromUi);
// initialize
updating = false;
diff --git a/rkward/settings/rksettingsmodule.cpp b/rkward/settings/rksettingsmodule.cpp
index b587e2eab..2168716a7 100644
--- a/rkward/settings/rksettingsmodule.cpp
+++ b/rkward/settings/rksettingsmodule.cpp
@@ -47,7 +47,7 @@ template <>
QCheckBox *RKConfigValue<bool, bool>::makeCheckbox(const QString &label, RKSettingsModuleWidget *module) {
QCheckBox *ret = new QCheckBox(label);
ret->setChecked(value);
- QObject::connect(ret, RKCompatibility::QCheckBox_checkStateChanged, module, &RKSettingsModuleWidget::change);
+ QObject::connect(ret, RKCompatibility::QCheckBox_checkStateChanged(), module, &RKSettingsModuleWidget::change);
QObject::connect(module, &RKSettingsModuleWidget::apply, module, [ret, this]() { this->value = ret->isChecked(); });
return ret;
}
diff --git a/rkward/settings/rksettingsmoduleconsole.cpp b/rkward/settings/rksettingsmoduleconsole.cpp
index 4ab7a03e1..dcc63c241 100644
--- a/rkward/settings/rksettingsmoduleconsole.cpp
+++ b/rkward/settings/rksettingsmoduleconsole.cpp
@@ -71,7 +71,7 @@ class RKSettingsPageConsole : public RKSettingsModuleWidget {
{(int)RKSettingsModuleConsole::AlwaysAdd, i18n("Add all commands")}}),
this);
add_piped_commands_to_history_box->setEnabled(pipe_user_commands_through_console_box->isChecked());
- connect(pipe_user_commands_through_console_box, RKCompatibility::QCheckBox_checkStateChanged, add_piped_commands_to_history_box, [add_piped_commands_to_history_box](int state) {
+ connect(pipe_user_commands_through_console_box, RKCompatibility::QCheckBox_checkStateChanged(), add_piped_commands_to_history_box, [add_piped_commands_to_history_box](int state) {
add_piped_commands_to_history_box->setEnabled(state);
});
vbox->addWidget(add_piped_commands_to_history_box);
diff --git a/rkward/settings/rksettingsmoduleoutput.cpp b/rkward/settings/rksettingsmoduleoutput.cpp
index eba7802a1..b857ee9ed 100644
--- a/rkward/settings/rksettingsmoduleoutput.cpp
+++ b/rkward/settings/rksettingsmoduleoutput.cpp
@@ -116,7 +116,7 @@ class RKSettingsPageOutput : public RKSettingsModuleWidget {
auto auto_raise_box = RKSettingsModuleOutput::auto_raise.makeCheckbox(i18n("raise window on new output"), this);
group_layout->addWidget(auto_raise_box);
auto_raise_box->setEnabled(RKSettingsModuleOutput::auto_show);
- connect(auto_show_box, RKCompatibility::QCheckBox_checkStateChanged, auto_raise_box, [auto_raise_box](int state) {
+ connect(auto_show_box, RKCompatibility::QCheckBox_checkStateChanged(), auto_raise_box, [auto_raise_box](int state) {
auto_raise_box->setEnabled(state);
});
diff --git a/rkward/settings/rksettingsmodulewatch.cpp b/rkward/settings/rksettingsmodulewatch.cpp
index 1499d534e..c22f8da10 100644
--- a/rkward/settings/rksettingsmodulewatch.cpp
+++ b/rkward/settings/rksettingsmodulewatch.cpp
@@ -207,22 +207,22 @@ class RKSettingsPageWatch : public RKSettingsModuleWidget {
filter_boxes.input = new QCheckBox();
filter_boxes.input->setChecked(state & RKSettingsModuleWatch::ShowInput);
- connect(filter_boxes.input, RKCompatibility::QCheckBox_checkStateChanged, this, &RKSettingsPageWatch::changedSetting);
+ connect(filter_boxes.input, RKCompatibility::QCheckBox_checkStateChanged(), this, &RKSettingsPageWatch::changedSetting);
layout->addWidget(filter_boxes.input, row, 1);
filter_boxes.output = new QCheckBox();
filter_boxes.output->setChecked(state & RKSettingsModuleWatch::ShowOutput);
- connect(filter_boxes.output, RKCompatibility::QCheckBox_checkStateChanged, this, &RKSettingsPageWatch::changedSetting);
+ connect(filter_boxes.output, RKCompatibility::QCheckBox_checkStateChanged(), this, &RKSettingsPageWatch::changedSetting);
layout->addWidget(filter_boxes.output, row, 2);
filter_boxes.error = new QCheckBox();
filter_boxes.error->setChecked(state & RKSettingsModuleWatch::ShowError);
- connect(filter_boxes.error, RKCompatibility::QCheckBox_checkStateChanged, this, &RKSettingsPageWatch::changedSetting);
+ connect(filter_boxes.error, RKCompatibility::QCheckBox_checkStateChanged(), this, &RKSettingsPageWatch::changedSetting);
layout->addWidget(filter_boxes.error, row, 3);
filter_boxes.raise = new QCheckBox();
filter_boxes.raise->setChecked(state & RKSettingsModuleWatch::RaiseWindow);
- connect(filter_boxes.raise, RKCompatibility::QCheckBox_checkStateChanged, this, &RKSettingsPageWatch::changedSetting);
+ connect(filter_boxes.raise, RKCompatibility::QCheckBox_checkStateChanged(), this, &RKSettingsPageWatch::changedSetting);
layout->addWidget(filter_boxes.raise, row, 4);
return filter_boxes;
More information about the rkward-tracker
mailing list