Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/wimleers/qcachinglocale

QCachingLocale speeds up Qt's slow QSystemLocale::query() calls by caching the answers. This seems to be particularly necessary on Mac OS X 10.6.
https://github.com/wimleers/qcachinglocale

Last synced: 6 days ago
JSON representation

QCachingLocale speeds up Qt's slow QSystemLocale::query() calls by caching the answers. This seems to be particularly necessary on Mac OS X 10.6.

Awesome Lists containing this project

README

        

How to use in your Qt application
---------------------------------

1) Add the QCachingLocale.h file to your project, and add it to your .pro
file.
2) Create a QCachingLocale instance as soon as possible, preferably in the
main() function. This will automatically install this object as the system
locale and remove any earlier installed system locales.
All your QSystemLocale::query() calls will now be cached by QCachingLocale!

Developed by Wim Leers (http://wimleers.com/).
However, the idea comes from the very helpful user in the #Qt IRC channel with
the nickname cbreak (http://the-color-black.net). Thanks again! :)

Test case
---------
A test case has been provided: https://gist.github.com/708621. Note that this
particular test case may only be reproducible on Mac OS X 10.6.5 (it has been
reproduced with both Qt 4.6 and Qt 4.7.1).
The output will look something like this:
Without QCachingLocale:
4839 ms were necessary for parsing the date 1000 times.

With QCachingLocale:
23 ms were necessary for parsing the date 1000 times.