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
QtWS25 Last Chance

wrong characters are shown instead of dots in password QLineEdit

Scheduled Pinned Locked Moved Solved General and Desktop
21 Posts 4 Posters 6.7k Views
  • 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.
  • S Offline
    S Offline
    sierdzio
    Moderators
    wrote on 25 Jul 2017, 10:50 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
      25 Jul 2017, 10:47

      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 Offline
      J Offline
      J.Hilk
      Moderators
      wrote on 25 Jul 2017, 10:50 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 25 Jul 2017, 12:41 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 25 Jul 2017, 17:02 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

          J 1 Reply Last reply 26 Jul 2017, 05:19
          0
          • S Offline
            S Offline
            sierdzio
            Moderators
            wrote on 26 Jul 2017, 05:09 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
              25 Jul 2017, 17:02

              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

              J Offline
              J Offline
              jsulm
              Lifetime Qt Champion
              wrote on 26 Jul 2017, 05:19 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 26 Jul 2017, 07:31
              0
              • J jsulm
                26 Jul 2017, 05:19

                @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 26 Jul 2017, 07:31 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%);
                }
                
                J 1 Reply Last reply 26 Jul 2017, 07:44
                0
                • P Paul Busovikov
                  26 Jul 2017, 07:31

                  @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%);
                  }
                  
                  J Offline
                  J Offline
                  jsulm
                  Lifetime Qt Champion
                  wrote on 26 Jul 2017, 07:44 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 26 Jul 2017, 08:53
                  0
                  • J jsulm
                    26 Jul 2017, 07:44

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

                    P Offline
                    P Offline
                    Paul Busovikov
                    wrote on 26 Jul 2017, 08:53 last edited by
                    #12

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

                    J 1 Reply Last reply 26 Jul 2017, 10:57
                    0
                    • P Paul Busovikov
                      26 Jul 2017, 08:53

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

                      J Offline
                      J Offline
                      jsulm
                      Lifetime Qt Champion
                      wrote on 26 Jul 2017, 10:57 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 26 Jul 2017, 12:13 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

                        J 1 Reply Last reply 26 Jul 2017, 12:22
                        0
                        • P Paul Busovikov
                          26 Jul 2017, 12:13

                          @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

                          J Offline
                          J Offline
                          jsulm
                          Lifetime Qt Champion
                          wrote on 26 Jul 2017, 12:22 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 26 Jul 2017, 15:40
                          0
                          • J jsulm
                            26 Jul 2017, 12:22

                            @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 26 Jul 2017, 15:40 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 27 Jul 2017, 09:10 last edited by
                              #17

                              And for what reason qt would not use fontconfig ?

                              J 1 Reply Last reply 28 Jul 2017, 05:11
                              0
                              • P Offline
                                P Offline
                                Paul Busovikov
                                wrote on 27 Jul 2017, 11:48 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
                                  27 Jul 2017, 09:10

                                  And for what reason qt would not use fontconfig ?

                                  J Offline
                                  J Offline
                                  jsulm
                                  Lifetime Qt Champion
                                  wrote on 28 Jul 2017, 05:11 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 28 Jul 2017, 08:05
                                  0
                                  • J jsulm
                                    28 Jul 2017, 05:11

                                    @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 28 Jul 2017, 08:05 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;
                                    
                                    J 1 Reply Last reply 28 Jul 2017, 08:10
                                    0
                                    • P Paul Busovikov
                                      28 Jul 2017, 08:05

                                      @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;
                                      
                                      J Offline
                                      J Offline
                                      jsulm
                                      Lifetime Qt Champion
                                      wrote on 28 Jul 2017, 08:10 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

                                      13/21

                                      26 Jul 2017, 10:57

                                      • Login

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