[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [PyQt] Model/view: values of type Decimal not shown
From:       "Hans-Peter Jansen" <hpj () urpla ! net>
Date:       2012-07-27 12:33:51
Message-ID: 201207271433.51692.hpj () urpla ! net
[Download RAW message or body]

Am Thursday 26 July 2012 20:24:13 schrieb Sibylle Koczian:
> Hello,
>
> I don't know how to get numeric data from my model to my GUI, if they
> aren't floats but decimal.Decimal. In the following example the last
> column of the view and the last QLineEdit of the form both stay
> empty. The model data are printed to the console and it can be seen
> that the model contains the correct data for the last column and that
> they have the right type. But the GUI doesn't show them. What should
> I change?

You need to supply a QStyledItemDelegate to handle decimals. It might be 
feasible to wrap QDoubleSpinBox as editor widget and access the value 
with cleanText...

I contributed the star delegate demo to demonstrate the delegation 
facility.

Hth,
Pete
_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic