PDA

View Full Version : sometime lack string (QtEmbedded Qt4.5, linux)



muny
19th November 2009, 15:54
Hello.
When I display string by using QLabel, missing string sometime occur.
My environment is embedded(mips & Linux), and I use additional true type font.
I do not understand a cause.



QLabel* title1 = new QLabel(this);
title1->setText("ABCDE");
title1->setGeometry(100, 100, 100, 30);
title1->setFont(QFont("myFontFamilyName", 18));

QLabel* title2 = new QLabel(this);
title2->setText("VWXYZ");
title2->setGeometry(100, 200, 100, 30);
title2->setFont(QFont("myFontFamilyName", 18));


The code result have 4 cases.
case 1(about 10%):
BCDE on title1 label and WXYZ on title2 label.
case 2(about 30%):
ABCDE on title1 label and WXYZ on title2 label.
case 3(about 30%):
BCDE on title1 label and VWXYZ on title2 label.
case 4(about 30%):this is success case.
ABCDE on title1 label and VWXYZ on title2 label.

I hope that this code result always is case 4(success).
Do you know a cause of this problem?

Thanks.

squidge
19th November 2009, 20:08
What happens if you put it in a layout rather than setting a fixed geometry yourself?

muny
22nd November 2009, 16:51
Hi, fatjuicymole.
Thank you for your response.

The cause of this problem is font familyname.
My two font files are ...
1. they have the same familyname.
2. one of my font files has only number(0 - 9).
3. the other has only alphabet(a-z, A-Z).

Maybe, Qt(or freetype) confuse.
I bond these fonts together, I get 100% success case.