Bug 170285 - krosspython: QDate, QTime and QDateTime aren't converted to native Python data types
Summary: krosspython: QDate, QTime and QDateTime aren't converted to native Python dat...
Status: RESOLVED FIXED
Alias: None
Product: bindings
Classification: Developer tools
Component: general (show other bugs)
Version: unspecified
Platform: unspecified All
: NOR normal
Target Milestone: ---
Assignee: kdelibs bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-03 01:25 UTC by Jan Kundrát
Modified: 2024-05-06 17:55 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Kundrát 2008-09-03 01:25:54 UTC
Even though Python has native data types for such purposes, the Qt values are converted to string. This makes working with them hard. I'd like to see, for example, a QDateTime converted to a datetime.datetime instance.

(I hope kdelibs is the correct product here, as I wasn't able to find a better one.)
Comment 1 Sebastian Sauer 2008-10-03 08:31:05 UTC
Hi Jan,

yes, that would be really more comfortable. The problem with changing it from string to datetime would be, that it changes the behavior and would break existing scripts/solutions that relay on the current implementation.

In fact the work to return and take python's datetime is already done (see the commented out QDateTime code in http://websvn.kde.org/trunk/KDE/kdebindings/python/krosspython/pythonvariant.h?view=markup and works fine. But cause of the requirment to don't change prev behavior and existing scripts, it's disabled and not used.

Well, it may an idea to introduce some kind of switch to let consumers optional enable it explicit. Not sure there how that could be done but guess it would be the only way how it can be done :-/
Comment 2 Jan Kundrát 2008-10-03 21:33:37 UTC
Hi Sebastian,
well, are you sure there are any custom scripts relying on this behavior? I'd say that as nobody bothered to report this issue (which *is* a bug), it probably isn't used that much.

For example, In Gentoo, we aren't shipping Python bindings yet, and I'm the only one who seems to be interested in this stuff.
Comment 3 Jan Kundrát 2010-03-07 23:46:01 UTC
Sebastian, could we perhaps add an extra function to Kross which, when called, would set a flag and cause QDateTime passing to work as expected?
Comment 4 Sebastian Sauer 2010-03-09 00:25:18 UTC
@Jan
Yes, that would be an idea. Maybe we just need some flag in Kross::Manager that is then evaluated at the backend. The problem is, that this is interpreter dependent. Maybe we could just add an InterpreterInfo::Option?
Comment 5 Justin Zobel 2021-03-09 05:24:45 UTC
Thank you for the bug report.

As this report hasn't seen any changes in 5 years or more, we ask if you can please confirm that the issue still persists.

If this bug is no longer persisting or relevant please change the status to resolved.
Comment 6 Christoph Cullmann 2024-05-06 17:55:28 UTC
Kross got removed in KF6, that solves this, naturally no like anticipated, but
that never took of, sorry.