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.
  • 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 Online
      J Online
      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 Online
          J Online
          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 Online
              J Online
              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 Online
                      J Online
                      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 Online
                          J Online
                          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

                          19/21

                          28 Jul 2017, 05:11

                          • Login

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