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. Same size of every Symbol QString

Same size of every Symbol QString

Scheduled Pinned Locked Moved Solved General and Desktop
6 Posts 4 Posters 858 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.
  • EngelardE Offline
    EngelardE Offline
    Engelard
    wrote on last edited by
    #1

    How can i make all symbols in my QString being same size? Because some(like 'i' or '0' are thiner then others).

    Here is the problem in screenshot below(each memory adress string have 10 element-length):

    alt text

    Pablo J. RoginaP K 2 Replies Last reply
    0
    • EngelardE Engelard

      How can i make all symbols in my QString being same size? Because some(like 'i' or '0' are thiner then others).

      Here is the problem in screenshot below(each memory adress string have 10 element-length):

      alt text

      Pablo J. RoginaP Offline
      Pablo J. RoginaP Offline
      Pablo J. Rogina
      wrote on last edited by
      #2

      @Engelard said in Same size of every Symbol QString:

      How can i make all symbols in my QString being same size?

      Use a fixed-size font ...

      Upvote the answer(s) that helped you solve the issue
      Use "Topic Tools" button to mark your post as Solved
      Add screenshots via postimage.org
      Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

      EngelardE 1 Reply Last reply
      4
      • EngelardE Engelard

        How can i make all symbols in my QString being same size? Because some(like 'i' or '0' are thiner then others).

        Here is the problem in screenshot below(each memory adress string have 10 element-length):

        alt text

        K Offline
        K Offline
        koahnig
        wrote on last edited by
        #3

        @Engelard

        Use setFont and use a Courier font for instance.
        Otherwayis with a stylesheet

        Vote the answer(s) that helped you to solve your issue(s)

        1 Reply Last reply
        3
        • Pablo J. RoginaP Pablo J. Rogina

          @Engelard said in Same size of every Symbol QString:

          How can i make all symbols in my QString being same size?

          Use a fixed-size font ...

          EngelardE Offline
          EngelardE Offline
          Engelard
          wrote on last edited by Engelard
          #4

          @Pablo-J.-Rogina said in Same size of every Symbol QString:

          @Engelard said in Same size of every Symbol QString:

          How can i make all symbols in my QString being same size?

          Use a fixed-size font ...

          I can't find no "fixed-size" in google, all i found is function which applied to QFont object

          QFont fnt;
          fnt.setPointSize(10);
          

          But it only change size of font, all string now bigger, and the length of the all that strings with 10 symbols are still different.

          I wish i could use that something like this:

          myItem->setFont(QFont::italic());
          
          1 Reply Last reply
          0
          • M Offline
            M Offline
            mpergand
            wrote on last edited by
            #5
            QFont font=QFontDatabase::systemFont(QFontDatabase::FixedFont);
            
            EngelardE 1 Reply Last reply
            4
            • M mpergand
              QFont font=QFontDatabase::systemFont(QFontDatabase::FixedFont);
              
              EngelardE Offline
              EngelardE Offline
              Engelard
              wrote on last edited by
              #6

              @mpergand said in Same size of every Symbol QString:

              QFont font=QFontDatabase::systemFont(QFontDatabase::FixedFont);

              Such a perfect answer. God bless you.

              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