@@ -155,7 +155,8 @@ QWidget* LegacyControllerBooleanSetting::buildInputWidget(QWidget* pParent) {
155155 // We want to format the checkbox label with html styles. This is not possible
156156 // so we attach a separate QLabel and, in order to get a clickable label like
157157 // with QCheckBox, we associate the label with the checkbox (buddy).
158- // When the label is clicked we toggle the checkbox in eventFilter().
158+ // When the label is clicked we toggle the checkbox in the function
159+ // eventFilter() of helper class ToggleCheckboxEventFilter.
159160 auto pLabelWidget = make_parented<QLabel>(pWidget);
160161 pLabelWidget->setSizePolicy (QSizePolicy::Preferred, QSizePolicy::Maximum);
161162 pLabelWidget->setText (label ());
@@ -187,6 +188,11 @@ bool LegacyControllerBooleanSetting::match(const QDomElement& element) {
187188
188189bool LegacyControllerBooleanSetting::ToggleCheckboxEventFilter::eventFilter (
189190 QObject* pObj, QEvent* pEvent) {
191+ // eventFilter was a method of LegacyControllerBooleanSetting, but this
192+ // doesn't work, as LegacyControllerBooleanSetting is created from a
193+ // different thread, and Qt cannot filter events for objects in a
194+ // different thread.
195+
190196 QLabel* pLabel = qobject_cast<QLabel*>(pObj);
191197 if (pLabel && pEvent->type () == QEvent::MouseButtonPress) {
192198 QCheckBox* pCheckBox = qobject_cast<QCheckBox*>(pLabel->buddy ());
0 commit comments