[Kde-finance-apps] Porting KLocale::formatMoney()/readMoney() to Qt5/KF5, best practise?

Tomas Mecir mecirt at gmail.com
Wed Jan 6 19:13:13 UTC 2016


2016-01-06 19:46 GMT+01:00 Friedrich W. H. Kossebau <kossebau at kde.org>:

> For BIC though this might need some overloads of the method, changing the
> signature of existing methods, even if only appending an argument to the
> list
> of arguments, does not work, or?
> Given there are already 8 overloads for the different numeric types, well,
> that needs possibly more thinking still.
>
>
Yeah, this would require overloads to stay BIC, adding an argument with a
default value breaks it per techbase. Not perfect, but if we can't have
anything better, and it Qt accepts it, it seems workable. Or failing that,
adding functions that export the locale data (format string etc), so we can
do our own formatMoney clone. Would just be simple getters, don't even need
setters really.


> Yes, QLocale being readonly is a third issue in the list of blockers. And
> not
> only for the currency related methods. So our issues are:
> - no currency string parsing method
> - string formatting method toCurrencyString() does not allow
>   to control precision
> - no option to extend/overwrite/customize locale data
>

Well, write-only is my issue, really. We can ask it to format things for
us, but we can't pull the locale data out of it. If we could, we could
simply be using QLocale and write our own formatting routine on top of it.

/ Tomas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-finance-apps/attachments/20160106/e6c228fa/attachment.html>


More information about the Kde-finance-apps mailing list