Sync Bufferswitches via QDataWidgetMapper
Currently bufferswitches are handled somewhat crude.
I just learned about QDataWidgetMapper, wich allows to map different data of an AbstractModel to Widgets.
Since the buffers are already wrapped into a BufferModel this facility should allow us to sync the bufferswitches somewhat automagically.
Syncing applies to:
- input line
- chatwidget (obviously)
#1 Updated by EgS over 12 years ago
Ok QDataWidgetmapper basically sucks. At least for what I had in mind to do with it.
Wrote my own Class to take care of this now: ModelPropertyMapper:
it can be easily used to map a specific column of a model to a property of qobject using a specific Role:
for example the following line maps the DisplayRole of Column 0 to the "topic" property of the topic widget:
Client::bufferModel()->mapProperty(0, Qt::DisplayRole, topicwidget, "topic");