PDA

View Full Version : öüä not working in qt4-apps on linux



niko
4th April 2007, 19:31
Hello,

I'm using Qt 4.2.2 on Gentoo Linux. My problem is that I can't insert öüä characters in textboxes. Characters like é Ã* (using ´+e) work.

I have no problems in all KDE-Applications.

Any tipps how I can find the cause of this problem?

thanks, niko

PS: This is my very simple test-code:


#include <QtGui>
int main(int argc, char** argv) {
QApplication app(argc, argv);
QLineEdit lineEdit;
lineEdit.show();
return app.exec();
}

wysota
4th April 2007, 19:46
Are you able to copy & paste those characters into the lineedit?

niko
4th April 2007, 20:03
no - doesn't work either.
i copied the title of this thread in it and go the attached result.

tanks for your help...
niko

wysota
4th April 2007, 21:02
The problem is probably with your system then. I can paste the characters fine here on Linux. Maybe you're using a font that doesn't have these glyphs?

niko
5th April 2007, 07:20
i didn't change default fonts anywhere.
qtconfig says "Sans Serif"
and in kde sans serif has these characters.

I tried the same thing on another desktop (also gentoo) - no problem there!

niko
6th April 2007, 06:12
I changed the default font to Times New Roman in qtconfig.
No change.

patrik08
6th April 2007, 08:08
I changed the default font to Times New Roman in qtconfig.
No change.

Ist this QT build from your self? on system locale latin utf-8 ... sample german utf-8?
Or ist this an emerge gentoo ready package... ? configured on only utf-8?


wahts happen wenn you start èèèè char as argumen 1 and 2

./app üöäüöä öäìüöä

on this ....
on pro file...
CONFIG += console


#include <QApplication>
#include <QtGui>
#include <QtCore>
#include <QDebug>

int main(int argc, char** argv) {

QApplication app(argc, argv);

QString argument_1, argument_2;
argument_1 = QString::fromLatin1(argv[1]);
argument_2 = argv[2];
qDebug() << "fargument_1 -> " << argument_1;
qDebug() << "argument_2 -> " << argument_2;


QLineEdit lineEdit;
lineEdit.setText (argument_1+argument_2);

lineEdit.show();
return 0;
}

wysota
6th April 2007, 08:49
Can you run the character map example (bundled with Qt) and see if the glyphs you seek are present there?

niko
6th April 2007, 15:07
Ist this QT build from your self? on system locale latin utf-8 ... sample german utf-8?
Or ist this an emerge gentoo ready package... ? configured on only utf-8?

It is the current stable gentoo-package built with:

[ebuild R ] x11-libs/qt-4.2.2 USE="cups dbus debug doc examples gif jpeg opengl png qt3support sqlite xinerama zlib -accessibility -firebird -glib -mng -mysql -nas -nis -odbc -pch -postgres -sqlite3" INPUT_DEVICES="-wacom" 0 kB

nothing else is special configured.

my /etc/locale.gen file:

en_US ISO-8859-1
en_US.UTF-8 UTF-8
de_DE ISO-8859-1
de_DE@euro ISO-8859-15
de_DE.UTF-8 UTF-8
de_AT ISO-8859-1
de_AT@euro ISO-8859-15
de_AT.UTF-8 UTF-8

Where else can I configure something?
(I don't remember I did)


./app testüöäüöätest testöäìüöätest
gives me this:

fargument_1 -> "testtest"
argument_2 -> "testtest"



Can you run the character map example (bundled with Qt) and see if the glyphs you seek are present there?
see screenshot - i think these are the right ones. (qt4 on the left, kcharselect on the right)

thanks,
niko

patrik08
6th April 2007, 16:40
It is the current stable gentoo-package built with:

[ebuild R ] x11-libs/qt-4.2.2 USE="cups dbus debug doc examples gif
my /etc/locale.gen file:
[code]en_US ISO-8859-1
en_US.UTF-8 UTF-8
de_DE ISO-8859-1
de_DE@euro ISO-8859-15
de_DE.UTF-8 UTF-8
de_AT ISO-8859-1
de_AT@euro ISO-8859-15
de_AT.UTF-8 UTF-8


./app testüöäüöätest testöäìüöätest
gives me this:

fargument_1 -> "testtest"
argument_2 -> "testtest"
niko

this is my result on XUBUNTU Linux feysy or so....



./app testüöäüöätest testöäìüöätest
fargument_1 -> "testüöäüöà¤test"
argument_2 -> "testöäìüöà¤test"


utf-8 out ...


Your default font locale not speak utf-8?? configured to qt... and bypass unknow char....

QFont f( QApplication::font () );
qDebug() << "### default font -> " << f.family (); /* this font is buggy */

### default font -> "Sans Serif" work on my OS


i am sure if you rebuild qt4.2 from normal method .... all running ...
whitout emerge or so....

niko
7th April 2007, 11:41
I found the issue, I did't have LANG set and so this bug effected me:
http://www.trolltech.com/developer/task-tracker/index_html?method=entry&id=136174

solution: upgrade to 4.2.3
or set LANG enviroment variable

thanks for your help!
niko