PDA

View Full Version : QDataWidgetMapper doesn't respond to model changes



graffy
3rd January 2014, 10:37
Hello,

I've got a tricky problem that I think I've almost solved, but I've hit a wall on something that doesn't make sense... I've created a user settings framework that auto-generates views of a user settings model. The model contains a list of setting names and corresponding values. In some cases, those values are pre-determined, and I've devised a way to represent those values binarily (with radiobuttons / checkboxes) in the view. Thus, if a setting has one of three possible values, only that value will be in the source model, but all three values will be represented in the view (with only the one radiobutton / checkbox selected). Internally, I connect the views and models using QDataWidgetMappers.

EDIT:

If I could delete the post, I would. It occurred to me the columns in the submodel don't correspond to those in the source, and I was emitting dataChanged with incorrect column values to the mappers, so of course, they won't do anything. Quick fix. Works perfectly. Never mind. <sigh>