When configuring qt, what does -icu do?



  • Hi,

    I have a Qt4 project I am porting to Qt5. The original programmer used ICU 4.6.1 for some stuff, so we build that and link it with our application.

    I notice Qt5 configure has a -ICU option. What does that do? I have been quite confused about where/how ICU fits in with Qt. Apparently, at one time Qt5 was going to depend on ICU, but now it's "not":http://qt-project.org/wiki/Qt-5-ICU.

    Does that mean the -icu flag is obsolete? If not, what does it do? Not sure if I should use it, or just configure qt without it and keep using my own compilation of ICU. Actually, I'd like to update to the latest ICU version, in the hope that it will fix some bugs with Burmese and a couple other languages. Not sure if the configure -icu flag will help me?

    David


  • Moderators

    Hi,

    Qt 5 still uses ICU for localization. The "official builds":http://qt-project.org/downloads all depend on ICU, but you can create a custom build without it.

    I don't know how the "-icu" flag works, but I imagine it's to enable ICU support. Your toolchain will need to be able to find the ICU dev libraries, of course.

    To check if you've done it correctly, run your configure script and then check its output. It will list what features are enabled/disabled.



  • Thanks - I'm still a bit unclear:

    Did the official builds of 5.2.1 all used the -icu configure option?

    Maybe the -icu option adds some Qt wrappers around the ICU4C API? If so, it would be great to know what they are and where to find them!

    Is Qt 5.2.1 pegged to a specific version of ICU? If so, what version?

    I'm not sure what you mean by "enable ICU support" - our application was built with our own build of Qt 4.8.4 (with a few patches), and we did not configure it with an -icu option (I believe that option is new in Qt5). Our application uses ICU and works fine under Qt 4.8.4. No "enabling ICU support" necessary.

    So now that I'm porting our application to Qt5, I'm not clear what the -icu configure option does for us, if anything?


  • Moderators

    [quote author="davidb" date="1393341972"]Did the official builds of 5.2.1 all used the -icu configure option?[/quote]Yes.

    [quote]Maybe the -icu option adds some Qt wrappers around the ICU4C API? If so, it would be great to know what they are and where to find them![/quote]No, Qt does not provide any wrappers for the ICU API. It simply uses ICU internally (i.e. Qt calls ICU4C functions).

    [quote]Is Qt 5.2.1 pegged to a specific version of ICU? If so, what version?[/quote]The ICU files that come bundled with Qt 5.2.1 (MSVC 2012 version) have names like "icudt51.dll", which suggests that Qt is using ICU 51.

    When I right-clicked the DLL to examine its properties, I'm told that the "file version is "51.1.0.0".

    (Qt 5.0 used ICU 49)

    [quote]I'm not sure what you mean by "enable ICU support" - our application was built with our own build of Qt 4.8.4 (with a few patches), and we did not configure it with an -icu option (I believe that option is new in Qt5). Our application uses ICU and works fine under Qt 4.8.4. No "enabling ICU support" necessary.[/quote]Qt 4 did not use ICU. When you used ICU in your Qt 4 application, you brought in ICU as an external, 3rd-party library; ICU4C functions are only called from your code.

    With Qt 5, Qt itself calls ICU4C functions if ICU is enabled. If disabled, Qt will refrain from calling those functions.

    The "-icu" (or "-no-icu") flag tells Qt itself to (not) use ICU. This has no bearing on your application's ability to use ICU. If you tell Qt not to use ICU, Qt won't use ICU, but your application is still free to use ICU.

    [quote]So now that I'm porting our application to Qt5, I'm not clear what the -icu configure option does for us, if anything?[/quote]I think the answer is "not much", unless your application uses Qt WebKit. ICU is a compulsory component for that module, but contributes very little to the rest of Qt at the moment.

    Have a look at these:



  • Thanks, that's very helpful!


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.