[PyQt] QDataWidgetMapper

Iacopo Spalletti programmazione at iast.it
Wed Feb 6 17:28:18 GMT 2008


I'm playing with QDataWidgetMapper and i found an unexpected behaviour on 
adding new record in the underlying model; i can't understand if it's a bug 
or the intended behaviour.

I setup a proof-of-concept (if you want i can send it), but basically when i 
add a new record via
        newRow = self.model.rowCount()
        self.mapper.submit()
        self.model.insertRow(newRow)
        self.mapper.setCurrentIndex(newRow)

The mapper does not update widgets (QLineEdit, in this simple example) with 
empty values but "remembers" the values of previously loaded records, so i 
have to clear all the widgets explicitly.

Am i doing something wrong or is the way to use QDataWidgetMapper?

Regards
-- 

IS
Iacopo Spalletti
i dot spalletti at iast dot it
PGP key block: http://www.nephila.it/pgp


More information about the PyQt mailing list