You are not logged in.
I have been building a small GUI in Qt and have run into this issue: my widgets are not UTF-8-compatible. Here's what happens if I set my window title to "cliché:"
Does anyone have any ideas? I'm using Qt 4.5 on KDE 4.3
Last edited by tony5429 (2009-08-16 21:37:58)
Offline
The title bar of your window is not a widget, but a feature of your window manager. You can verify this by using a different window manager or changing the fonts. Openbox is working for me with default font settings; wmii does the same thing yours does.
The solution? Don't use UTF-8 in window titles. You can't predict what fonts or window managers your target audience will be using. (Real widgets, like buttons and labels, should behave.)
Last edited by Trent (2009-08-16 19:18:31)
Offline
Actually, I'm having the same problem with a QPushButton (whether I use tr() or QString()):
Any ideas? Also, in case it matters, my locale is set to 'en_GB.UTF-8 UTF-8' in /etc/locale.gen and 'en_GB.utf8' in /etc/rc.conf.
Offline
Are you sure QT is UTF-8—compatible?
(I wouldn't know, since I don't do any GUI programming.)
Last edited by Peasantoid (2009-08-16 20:20:18)
Offline
Thanks for all the tips. I found what I needed. For anyone else who comes to this page looking for the answer, it turns out you need to use "QString::fromUtf8()" to solve the problem.
Offline