[PyQt] How to use QDataWidgetMapper?

Arthur Pemberton pemboa at gmail.com
Sat Mar 7 19:27:33 GMT 2009


I am trying the QDataWidgetMapper and I just can't figure out hot to
use it for anything more complex than the fairly trivial examples I
have seen.

I have a QListView attached to my model. And the mapper attached to
the model. I also have several QLineEdits which are mapped to the
QDataWidgetMapper.

I have run into two problems.

When in AutoSubmit mode, I can't set a QLineEdit text programmatically
via setText(). However, Ideally, I want to use ManualSubmit, which
allows me to do setText(), but then it doesn't remember changes when I
go to the next item. I want it to remember all changes, and revert
them if I hit cancel, or keep them if I click Okay.

I tried doing a deep copy on the model itself, but that didn't seem to
work. And I couldn't find a clone() function.

I've attached a screenshot  of the dialog that I am working with.

-- 
Fedora 9 : sulphur is good for the skin
( www.pembo13.com )
-------------- next part --------------
A non-text attachment was scrubbed...
Name: featuredialog.png
Type: image/png
Size: 5982 bytes
Desc: not available
Url : http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20090307/ae70f4c6/featuredialog-0001.png


More information about the PyQt mailing list