Comment 1 for bug 881613

Revision history for this message
Bogdan Marinov (daggerstab) wrote :

The problem seems to stem from the behavior of the "Uses as default" checkbox - when it is checked, it is disabled. Apparently at some point Qt decided that disabled controls can't hold input focus, so the focus is passed to the next controls in the "tab stop" order. These are the "Delete" and "Add to list" buttons (tab stop numbers 3 and 4), but for locations in the default list, they are also disabled at this point. Thus, the focus is set to tab stop number 5, the "Latitude" spin box. The spin box for some reason interprets receiving the focus as having its value changed and triggers the LocationDialog::valueChanged() slot, which overwrites the Name field with "New Location".

Possible solutions:
a) use LocationDialog::disconnectSignals() and connectSignals() before and after disabling the checkbox.
b) modify the custom AngleSpinBox code or just use in LocationDialog another type of signal that is not triggered by receiving the focus.
c) change the tab stop order.