[PyQt] QDataWidgetMapper

2007-11-26 Thread Daniel Lundqvist
Hey, I've been struggling to get the above to work correctly. I've looked around but haven't found a solution to my problem yet. The issue I'm having is I can't get the mapper to update the widgets at all. Not even when I call setCurrentIndex(n). I'm attaching my sample project that shows the pr

[PyQt] QDataWidgetMapper

2008-02-06 Thread Iacopo Spalletti
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 = sel

Re: [PyQt] QDataWidgetMapper

2007-11-27 Thread Sibylle Koczian
Am Montag, 26. November 2007 13:59:52 schrieb Daniel Lundqvist: > Hey, > > I've been struggling to get the above to work correctly. I've looked > around but haven't found a solution to my problem yet. > > The issue I'm having is I can't get the mapper to update the widgets at > all. Not even when I

Re: [PyQt] QDataWidgetMapper

2007-11-27 Thread Sibylle Koczian
Am Dienstag, 27. November 2007 20:02:51 schrieb Sibylle Koczian: > > I'm just playing with the QDataWidgetMapper myself, so I looked at your > project and tried some changes. Changing the model to a QStandardItemModel, > QSqlQueryModel, QSqlTableModel (with a SQLite memory "database") didn't > help

Re: [PyQt] QDataWidgetMapper

2007-12-02 Thread Sibylle Koczian
Hello, Daniel, Am Montag, 26. November 2007 13:59:52 schrieb Daniel Lundqvist: > Hey, > > I've been struggling to get the above to work correctly. I've looked > around but haven't found a solution to my problem yet. > > The issue I'm having is I can't get the mapper to update the widgets at > all.

Re: [PyQt] QDataWidgetMapper

2007-12-02 Thread Daniel Lundqvist
On Sun, 2007-12-02 at 12:00 +0100, Sibylle Koczian wrote: > Hello, Daniel, > > Am Montag, 26. November 2007 13:59:52 schrieb Daniel Lundqvist: > > Hey, > > > > I've been struggling to get the above to work correctly. I've looked > > around but haven't found a solution to my problem yet. > > > > T

Re: [PyQt] QDataWidgetMapper

2007-12-03 Thread Sibylle Koczian
Am Montag, 3. Dezember 2007 08:45:43 schrieben Sie: > On Sun, 2007-12-02 at 12:00 +0100, Sibylle Koczian wrote: > > Did you solve your problem? I've tried several variations, but the only > > one that did help was putting your data into a QStandardItemModel. > > Yes, sorry for not getting back here

[PyQt] QDataWidgetMapper and default values

2009-07-05 Thread Scott Frankel
Hello, Is there a way to specify a default value for a Data Widget Mapper if a user leaves a mapped field empty? The mapper appears to ignore the db schema's default declarations. Ideally, I'd like to insert Null. Something analogous to this: test=# INSERT INTO gear (name, ad

[PyQt] QDataWidgetMapper null values/ beforeInsert problem

2010-03-06 Thread bar tomas
Hi, I'm using a QDataWidgetMapper to map the fields in a database table to the fields in a form. If a field in the form is left empty I would like a null value to be inserted in the database field. However, empty fields are given a 0 value for numeric fields and an empty string value for text fiel

[PyQt] QDataWidgetMapper and addMapping with a custom property name: setProperty never called

2010-11-09 Thread TP
Hello, I currently use QDataWidgetMapper with a custom property name: self.mapper.addMapping( widget, index, propertyName ) Now let us look at the private method populate() of src/gui/itemviews/qdatawidgetmapper.cpp (Qt source code): // void QDataWidgetMapperPrivate::populate(WidgetMapper

Re: [PyQt] QDataWidgetMapper and addMapping with a custom property name: setProperty never called

2010-11-09 Thread Phil Thompson
On Tue, 9 Nov 2010 20:29:43 +0100, TP wrote: > Hello, > > I currently use QDataWidgetMapper with a custom property name: > > self.mapper.addMapping( widget, index, propertyName ) > > Now let us look at the private method populate() of > src/gui/itemviews/qdatawidgetmapper.cpp (Qt source code):

Re: [PyQt] QDataWidgetMapper and addMapping with a custom property name: setProperty never called

2010-11-09 Thread TP
Phil Thompson wrote: > setProperty() isn't virtual so you can't reimplement it in Python. Thanks a lot. And neither can I reimplement it in C++, if I am right. I am not very familiar to C++ programming, now I know what a virtual function is! Julien _

Re: [PyQt] QDataWidgetMapper and addMapping with a custom property name: setProperty never called

2010-11-10 Thread TP
If I am right, none of the properties of QTextEdit is virtual. So none can be reimplemented... It is not easy to change the default behavior in these conditions. Finally I have found a solution: using QPlainTextEdit instead of QTextEdit: the default property is "plainText", not "html" as in QTex