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. Problem with text characters not showing with msvc relases
Forum Updated to NodeBB v4.3 + New Features

Problem with text characters not showing with msvc relases

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 4 Posters 970 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.
  • Q Offline
    Q Offline
    Q139
    wrote on last edited by Q139
    #1

    When code below get build with msvc 2015 64 then instead of "████▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬" , is displayed ?????????????????????????????????? , problem does not exist with mingw compiler.
    Other regular text like numbers and regular chars is displayed fine.

     // thread info
        QString info;
        info.append(QString::number(TESTER.threadPtrVec.size())+"\n");
        for(int e=0; e<TESTER.threadPtrVec.size(); e++){
            RUNNER * ptr = TESTER.threadPtrVec[e];
    
            double progress = ptr->L_kaugus/data_size;
    
            QString bar;
    
            if(progress<0.5){
            if(progress<0.05){
                bar="▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬";
            }else if(progress<0.1){
                bar="█▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬";
            }else if(progress<0.15){
                bar="██▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬";
            }else if(progress<0.2){
                bar="███▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬";
            }else if(progress<0.25){
                bar="████▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬";
            }else if(progress<0.3){
                bar="█████▬▬▬▬▬▬▬▬▬▬▬▬▬▬";
            }else if(progress<0.35){
                bar="██████▬▬▬▬▬▬▬▬▬▬▬▬▬";
            }else if(progress<0.4){
                bar="███████▬▬▬▬▬▬▬▬▬▬▬▬";
            }else if(progress<0.45){
                bar="████████▬▬▬▬▬▬▬▬▬▬▬";
            }else if(progress<0.5){
                bar="█████████▬▬▬▬▬▬▬▬▬▬";
            }
            }else{
            if(progress<0.55){
                bar="██████████▬▬▬▬▬▬▬▬▬";
            }else if(progress<0.60){
                bar="███████████▬▬▬▬▬▬▬▬";
            }else if(progress<0.65){
                bar="████████████▬▬▬▬▬▬▬";
            }else if(progress<0.70){
                bar="█████████████▬▬▬▬▬▬";
            }else if(progress<0.75){
                bar="██████████████▬▬▬▬▬";
            }else if(progress<0.80){
                bar="███████████████▬▬▬▬";
            }else if(progress<0.85){
                bar="████████████████▬▬▬";
            }else if(progress<0.90){
                bar="█████████████████▬▬";
            }else if(progress<0.95){
                bar="██████████████████▬";
            }else if(progress>0.95){
                bar="██████████████████▌";
            }
            }
    
    
         //  bar=QString::number((int)(progress*100));
    
            double num = ptr->prev_result;
            QString numQ;
            if(num>0){
                numQ=" "+QString::number(num);
            }else{
                numQ=QString::number(num);
            }
    
             info += bar+" "+numQ +"\n";
    
    
        }
    
        ui->tester_info->setText(info); // tester_info is qlabel
    
    raven-worxR 1 Reply Last reply
    0
    • jsulmJ Online
      jsulmJ Online
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Which characters do you use exactly? Unicode?

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

      1 Reply Last reply
      0
      • VRoninV Offline
        VRoninV Offline
        VRonin
        wrote on last edited by VRonin
        #3

        try declaring the string as wide:

        bar=QString::fromWCharArray(L"██████████████████▌");
        

        http://www.joelonsoftware.com/articles/Unicode.html

        "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
        ~Napoleon Bonaparte

        On a crusade to banish setIndexWidget() from the holy land of Qt

        1 Reply Last reply
        0
        • Q Q139

          When code below get build with msvc 2015 64 then instead of "████▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬" , is displayed ?????????????????????????????????? , problem does not exist with mingw compiler.
          Other regular text like numbers and regular chars is displayed fine.

           // thread info
              QString info;
              info.append(QString::number(TESTER.threadPtrVec.size())+"\n");
              for(int e=0; e<TESTER.threadPtrVec.size(); e++){
                  RUNNER * ptr = TESTER.threadPtrVec[e];
          
                  double progress = ptr->L_kaugus/data_size;
          
                  QString bar;
          
                  if(progress<0.5){
                  if(progress<0.05){
                      bar="▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬";
                  }else if(progress<0.1){
                      bar="█▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬";
                  }else if(progress<0.15){
                      bar="██▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬";
                  }else if(progress<0.2){
                      bar="███▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬";
                  }else if(progress<0.25){
                      bar="████▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬";
                  }else if(progress<0.3){
                      bar="█████▬▬▬▬▬▬▬▬▬▬▬▬▬▬";
                  }else if(progress<0.35){
                      bar="██████▬▬▬▬▬▬▬▬▬▬▬▬▬";
                  }else if(progress<0.4){
                      bar="███████▬▬▬▬▬▬▬▬▬▬▬▬";
                  }else if(progress<0.45){
                      bar="████████▬▬▬▬▬▬▬▬▬▬▬";
                  }else if(progress<0.5){
                      bar="█████████▬▬▬▬▬▬▬▬▬▬";
                  }
                  }else{
                  if(progress<0.55){
                      bar="██████████▬▬▬▬▬▬▬▬▬";
                  }else if(progress<0.60){
                      bar="███████████▬▬▬▬▬▬▬▬";
                  }else if(progress<0.65){
                      bar="████████████▬▬▬▬▬▬▬";
                  }else if(progress<0.70){
                      bar="█████████████▬▬▬▬▬▬";
                  }else if(progress<0.75){
                      bar="██████████████▬▬▬▬▬";
                  }else if(progress<0.80){
                      bar="███████████████▬▬▬▬";
                  }else if(progress<0.85){
                      bar="████████████████▬▬▬";
                  }else if(progress<0.90){
                      bar="█████████████████▬▬";
                  }else if(progress<0.95){
                      bar="██████████████████▬";
                  }else if(progress>0.95){
                      bar="██████████████████▌";
                  }
                  }
          
          
               //  bar=QString::number((int)(progress*100));
          
                  double num = ptr->prev_result;
                  QString numQ;
                  if(num>0){
                      numQ=" "+QString::number(num);
                  }else{
                      numQ=QString::number(num);
                  }
          
                   info += bar+" "+numQ +"\n";
          
          
              }
          
              ui->tester_info->setText(info); // tester_info is qlabel
          
          raven-worxR Offline
          raven-worxR Offline
          raven-worx
          Moderators
          wrote on last edited by
          #4

          @Q139
          Since you are using plain strings also make sure you did not save your file in some special encoding.

          Does the problem also occur when you specifying the unicode values for the characters directly?

          --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
          If you have a question please use the forum so others can benefit from the solution in the future

          1 Reply Last reply
          0
          • Q Offline
            Q Offline
            Q139
            wrote on last edited by
            #5

            bar=QString::fromWCharArray(L"██████████████████▌"); solved the problem.
            Thanks

            File was saved without obfuscations or any encoding.
            On mingw compiler text displayed correct by default .
            Maybe due to some compiler differences or autofix to problem.

            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