[PyQt] simplewidgetmapper.py, customsortfiltermodel.py, combowidgetmapper.py examples

Hans-Peter Jansen hpj at urpla.net
Sat Nov 27 18:08:49 GMT 2010


Hi Phil, hi *,

attached are a few missing itemview examples for the collection.

While simplewidgetmapper.py and combowidgetmapper.py differ only in 
minor details, the customsortfiltermodel.py differs from the original 
in a major aspect: it actually works unlike the original ;-) 
 - the filters are applied on startup (UI shows consistent values)
 - the date limiter contain sane values
 - the date filter works properly

The last issue in MySortFilterProxyModel.dateInRange() results from a 
slight inconsistency in Qt: comparing QDate with QDateTime values 
doesn't work (at least not in a way, what would humans expect), hence 
the value has to be converted to a QDate before the comparison.

Enjoy,
Pete
-------------- next part --------------
A non-text attachment was scrubbed...
Name: simplewidgetmapper.py
Type: application/x-python
Size: 5261 bytes
Desc: not available
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20101127/fc965abd/attachment-0003.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: customsortfiltermodel.py
Type: application/x-python
Size: 10843 bytes
Desc: not available
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20101127/fc965abd/attachment-0004.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: combowidgetmapper.py
Type: application/x-python
Size: 5459 bytes
Desc: not available
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20101127/fc965abd/attachment-0005.bin>


More information about the PyQt mailing list