Solved List of all currencies
-
I want to write a program that will be able to link currency symbol to its ISO code. So
USD
and$
should be both recognized as US Dollar.QLocale
is able to return both symbol and code for a given country, but I couldn't find a way to get list of all possible currencies or even symbol-ISO converter.Can this be done automatically using Qt or would I have to create list manually?
-
Hi,
From the top of my head, you'd have to implement a loop to go through all of QLocale's possibilities and from that generate the map you want.
-
@SGaist said in List of all currencies:
you'd have to implement a loop to go through all of QLocale's possibilities
How do I do that though? I can't get collection of all currencies or even countries from
Qlocale
, so there's nothing to loop through. -
@HalfTough
http://doc.qt.io/qt-5/qlocale.html#matchingLocalesGetting a list of all locales:
QList<QLocale> allLocales = QLocale::matchingLocales(QLocale::AnyLanguage, QLocale::AnyScript, QLocale::AnyCountry);