Project

General

Profile

Actions

Improvements #9264

closed
RS KD

Document that WRadioButton does not emit unChecked

Improvements #9264: Document that WRadioButton does not emit unChecked

Added by Roel Standaert almost 5 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Korneel Dumon
Target version:
Start date:
10/28/2021
Due date:
% Done:

100%

Estimated time:

Description

When one WRadioButton A is checked, and the user clicks on another WRadioButton B in the same WButtonGroup, this will emit WAbstractToggleButton::checked() for B, but not unChecked() for A.

This was an observation made by Stefan on the forum: https://redmine.emweb.be/boards/2/topics/17259

This is a consequence of the fact that the browser only emits the change event for the radio button that was clicked, not the one that is now automatically unchecked as a result.

I also looked at Qt's behavior:

  • clicked is emitted only for the one that has been clicked
  • toggled is emitted whenever the checked state changes

Since it's not straightforward to make WRadioButton emit unChecked (an EventSignal), and since this would be a change in existing behavior we should simply add some documentation to clarify that unChecked will not be emitted, and suggest using WButtonGroup::checkedChanged.

KD Updated by Korneel Dumon over 4 years ago Actions #1

  • Status changed from New to InProgress
  • Assignee set to Korneel Dumon

KD Updated by Korneel Dumon over 4 years ago Actions #2

  • Status changed from InProgress to Implemented @Emweb

RS Updated by Roel Standaert over 4 years ago Actions #3

  • Status changed from Implemented @Emweb to Resolved
  • % Done changed from 0 to 100

RS Updated by Roel Standaert over 4 years ago Actions #4

  • Status changed from Resolved to Closed
Actions

Also available in: PDF Atom