QT 4.4 and timedelta

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • admoore

    QT 4.4 and timedelta

    Maybe I'm missing something obvious, but is there a QT object to
    represent time intervals, a la datetime.timede lta?

    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.timede lta
    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?
  • Mohamed Yousef

    #2
    Re: QT 4.4 and timedelta

    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@alandmoore. comwrote:
    Maybe I'm missing something obvious, but is there a QT object to
    represent time intervals, a la datetime.timede lta?
    >
    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.timede lta
    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?
    --

    >

    Comment

    Working...