wrong characters are shown instead of dots in password QLineEdit
-
I set echoMode as password and expect dots like that
but I got thisto be clear I build it in sandbox debian7 with its own QT 4.8 and launch in mint 17
when I build it in Mint with QT 4.9, all looks finemaibe something relaited with native xcb?
-
Qt 4.9? There is no such version.
Weird issue, I'd suspect maybe something to do with fonts? Have you tried with some newer Qt version (5.6 or 5.9) if the problem persists?
-
I'm sorry 5.8 and 5.9 of course =)
and I forgot to mention that the characters which are returned by displayText() are '\u25cf'
so it is dot, but why does it look so strange -
Then it points even stronger to some issue with fonts - the default one seemingly lacks the dot character.
Do other texts in the application look different in both app builds?
-
@Paul-Busovikov a wild guess based a recent experience:
Remove the italic from the font. -
Also it isn't matter what font I choose.
I took "Ubuntu" font and there were rectangles which look as undefined characters looks like
U+25cf is displayed like that, everywhere ( label lineEdit etc. ) during I build my project in sandbox -
Weird! Sorry, but I ran out of ideas how to help here :-(
I've looked through known Qt bugs, the only one remotely related is https://bugreports.qt.io/browse/QTBUG-23626?jql=text ~ "echoMode" but I don't think that's it.
-
@Paul-Busovikov Are you changing anything related to fonts and style in your app? For example style-sheets?
-
@jsulm yes, I have style-sheet for those widgets, but I've tried same sheets for the build where I have no problem
that is the one of them, can it spoil something?
.QLineEdit { min-height: 32px; qtproperty-hsizetype="Maximum"; border-radius: 2px; border-style: solid; border-width: 1px; border-color: rgb(0,0,0,25%); margin-top: 4px; margin-bottom: 4px; } .QLineEdit::focus { border-color: rgb(0,147,196, 85%); } .QLineEdit:hover { border-color: rgb(0,0,0,40%); } .QLineEdit:disabled { border-color: rgb(0,0,0,25%); background-color: rgb(255,255,255, 50%); color: rgb(0,0,0, 50%); }
-
@Paul-Busovikov I would try without this style-sheet to be sure
-
@Paul-Busovikov When you start your app do you see any warnings/errors? You build your app on Debian but execute on Mint: did you deploy it (http://doc.qt.io/qt-5/linux-deployment.html)? Could be that it doesn't find the font and falls back to some other font.
-
@jsulm it does find the font, I saw the differences and features of particular fonts
I deploy it by coping qt libraries (which were used during the compilation in sandbox) and their dependencies and qtplugins and fonts into a path available for app
During the work there are no warnings or errorsCan it be some codec problem? I suppose it is UTF-8 in both cases. How can I check it?
Just printed 10000 characters to see how it looks likeQString s; for ( int i = 1; i < 10000; ++i ) { s.append( QChar(i) ); } ui->textEdit->setText(s);
There are 2 variants
-
@Paul-Busovikov In the second output you can see that much less characters can be properly shown. To me it really looks like a font issue. Internally QString uses UTF-16.
-
@jsulm you are right
QFontDatabase().families().join(" | ")
gave me some clue
The first app returned whole list of families and the second one returned the only one which I deployedQFontDatabase::addApplicationFont( "fontDir/myFont.ttf" );
but I don't understand where both apps are looking for fonts
how can I force the app to look for in /usr/local/fonts not only in my deployed font directory? -
And for what reason qt would not use fontconfig ?
-
I don't figure out why fontconfig don't work
But I have solved this particular issue by adding path to free fonts in QT_QPA_FONTDIR -
@Paul-Busovikov said in wrong characters are shown instead of dots in password QLineEdit:
And for what reason qt would not use fontconfig ?
For example because it was built without fontconfig support. Did you build Qt by yourself?
-
@jsulm Thanks for answer. No, I didn't, but I have a log of building
So, as far as I understood it is the reason
[18:57:36] : [Step 2/2] [exec] Qt Gui: [18:57:36] : [Step 2/2] [exec] FreeType ............................... yes [18:57:36] : [Step 2/2] [exec] Using system FreeType ................ no [18:57:36] : [Step 2/2] [exec] HarfBuzz ............................... yes [18:57:36] : [Step 2/2] [exec] Using system HarfBuzz ................ no [18:57:36] : [Step 2/2] [exec] Fontconfig ............................. no [18:57:36] : [Step 2/2] [exec] Image formats: [18:57:36] : [Step 2/2] [exec] GIF .................................. yes [18:57:36] : [Step 2/2] [exec] ICO .................................. yes [18:57:36] : [Step 2/2] [exec] JPEG ................................. yes [18:57:36] : [Step 2/2] [exec] Using system libjpeg ............... no [18:57:36] : [Step 2/2] [exec] PNG .................................. yes [18:57:36] : [Step 2/2] [exec] Using system libpng ................ no
Also for the people who got similar issue there is the way to change password character by style-sheet
lineedit-password-character: 42;