QT 4.4 and timedelta

Mohamed Yousef harrrrpo at gmail.com
Mon Aug 25 12:57:04 EDT 2008


I'm not very sure about this , but it's logicallay enough to be said
i think the QTableView ordering mechanism must provide some overriding
functionality through accepting a comparing function from you
check it

On Mon, Aug 25, 2008 at 7:48 PM, admoore <me at alandmoore.com> wrote:
> Maybe I'm missing something obvious, but is there a QT object to
> represent time intervals, a la datetime.timedelta?
>
> I'm working on a utility that displays database query results from a
> postgres database (using psycopg2) in a QTableView.  For columns
> created using "age(some_date_column)", I get a datetime.timedelta
> object from psycopg2.
>
> What I'd like is to be able to format this column in a friendly way
> (say "7 years, 2 months, 4 days"), yet have the QTableView treat it
> properly (e.g. for sorting purposes, not sorting it lexically but by
> the actual length of time).
>
> Anyone have any input or ideas on this?
> --
> http://mail.python.org/mailman/listinfo/python-list
>



More information about the Python-list mailing list