Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. wrong characters are shown instead of dots in password QLineEdit
Forum Updated to NodeBB v4.3 + New Features

wrong characters are shown instead of dots in password QLineEdit

Scheduled Pinned Locked Moved Solved General and Desktop
21 Posts 4 Posters 6.8k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • sierdzioS Offline
    sierdzioS Offline
    sierdzio
    Moderators
    wrote on last edited by
    #4

    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?

    (Z(:^

    1 Reply Last reply
    2
    • P Paul Busovikov

      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

      J.HilkJ Offline
      J.HilkJ Offline
      J.Hilk
      Moderators
      wrote on last edited by
      #5

      @Paul-Busovikov a wild guess based a recent experience:
      Remove the italic from the font.


      Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


      Q: What's that?
      A: It's blue light.
      Q: What does it do?
      A: It turns blue.

      1 Reply Last reply
      2
      • P Offline
        P Offline
        Paul Busovikov
        wrote on last edited by
        #6

        @sierdzio no, texts in both app look identically
        I checked the font and the dot character there is

        @J-Hilk doesn't help unfortunately

        1 Reply Last reply
        0
        • P Offline
          P Offline
          Paul Busovikov
          wrote on last edited by
          #7

          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

          jsulmJ 1 Reply Last reply
          0
          • sierdzioS Offline
            sierdzioS Offline
            sierdzio
            Moderators
            wrote on last edited by
            #8

            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.

            (Z(:^

            1 Reply Last reply
            0
            • P Paul Busovikov

              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

              jsulmJ Offline
              jsulmJ Offline
              jsulm
              Lifetime Qt Champion
              wrote on last edited by
              #9

              @Paul-Busovikov Are you changing anything related to fonts and style in your app? For example style-sheets?

              https://forum.qt.io/topic/113070/qt-code-of-conduct

              P 1 Reply Last reply
              0
              • jsulmJ jsulm

                @Paul-Busovikov Are you changing anything related to fonts and style in your app? For example style-sheets?

                P Offline
                P Offline
                Paul Busovikov
                wrote on last edited by
                #10

                @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%);
                }
                
                jsulmJ 1 Reply Last reply
                0
                • P Paul Busovikov

                  @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%);
                  }
                  
                  jsulmJ Offline
                  jsulmJ Offline
                  jsulm
                  Lifetime Qt Champion
                  wrote on last edited by
                  #11

                  @Paul-Busovikov I would try without this style-sheet to be sure

                  https://forum.qt.io/topic/113070/qt-code-of-conduct

                  P 1 Reply Last reply
                  0
                  • jsulmJ jsulm

                    @Paul-Busovikov I would try without this style-sheet to be sure

                    P Offline
                    P Offline
                    Paul Busovikov
                    wrote on last edited by
                    #12

                    @jsulm I've tried without style-sheets, the problem still here

                    jsulmJ 1 Reply Last reply
                    0
                    • P Paul Busovikov

                      @jsulm I've tried without style-sheets, the problem still here

                      jsulmJ Offline
                      jsulmJ Offline
                      jsulm
                      Lifetime Qt Champion
                      wrote on last edited by
                      #13

                      @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.

                      https://forum.qt.io/topic/113070/qt-code-of-conduct

                      1 Reply Last reply
                      0
                      • P Offline
                        P Offline
                        Paul Busovikov
                        wrote on last edited by
                        #14

                        @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 errors

                        Can 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 like

                        QString s;
                        for ( int i = 1; i < 10000; ++i )
                        {
                             s.append( QChar(i) );
                        }
                        ui->textEdit->setText(s);
                        

                        There are 2 variants0_1501070905064_55.png

                        0_1501070871065_12.png

                        jsulmJ 1 Reply Last reply
                        0
                        • P Paul Busovikov

                          @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 errors

                          Can 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 like

                          QString s;
                          for ( int i = 1; i < 10000; ++i )
                          {
                               s.append( QChar(i) );
                          }
                          ui->textEdit->setText(s);
                          

                          There are 2 variants0_1501070905064_55.png

                          0_1501070871065_12.png

                          jsulmJ Offline
                          jsulmJ Offline
                          jsulm
                          Lifetime Qt Champion
                          wrote on last edited by
                          #15

                          @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.

                          https://forum.qt.io/topic/113070/qt-code-of-conduct

                          P 1 Reply Last reply
                          0
                          • jsulmJ jsulm

                            @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.

                            P Offline
                            P Offline
                            Paul Busovikov
                            wrote on last edited by Paul Busovikov
                            #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 deployed

                            QFontDatabase::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?

                            1 Reply Last reply
                            0
                            • P Offline
                              P Offline
                              Paul Busovikov
                              wrote on last edited by
                              #17

                              And for what reason qt would not use fontconfig ?

                              jsulmJ 1 Reply Last reply
                              0
                              • P Offline
                                P Offline
                                Paul Busovikov
                                wrote on last edited by
                                #18

                                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

                                1 Reply Last reply
                                0
                                • P Paul Busovikov

                                  And for what reason qt would not use fontconfig ?

                                  jsulmJ Offline
                                  jsulmJ Offline
                                  jsulm
                                  Lifetime Qt Champion
                                  wrote on last edited by
                                  #19

                                  @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?

                                  https://forum.qt.io/topic/113070/qt-code-of-conduct

                                  P 1 Reply Last reply
                                  0
                                  • jsulmJ jsulm

                                    @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?

                                    P Offline
                                    P Offline
                                    Paul Busovikov
                                    wrote on last edited by
                                    #20

                                    @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;
                                    
                                    jsulmJ 1 Reply Last reply
                                    0
                                    • P Paul Busovikov

                                      @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;
                                      
                                      jsulmJ Offline
                                      jsulmJ Offline
                                      jsulm
                                      Lifetime Qt Champion
                                      wrote on last edited by
                                      #21

                                      @Paul-Busovikov If you would like to know why fontconfig was built execute configure again with additional -v parameter and check the output. I guess you're missing fontconfig header files (dev package).

                                      https://forum.qt.io/topic/113070/qt-code-of-conduct

                                      1 Reply Last reply
                                      0

                                      • Login

                                      • Login or register to search.
                                      • First post
                                        Last post
                                      0
                                      • Categories
                                      • Recent
                                      • Tags
                                      • Popular
                                      • Users
                                      • Groups
                                      • Search
                                      • Get Qt Extensions
                                      • Unsolved