Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Qt Academy Launch in California!

    Solved Same size of every Symbol QString

    General and Desktop
    4
    6
    436
    Loading More Posts
    • 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.
    • Engelard
      Engelard last edited by

      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. Rogina K 2 Replies Last reply Reply Quote 0
      • Pablo J. Rogina
        Pablo J. Rogina @Engelard last edited by

        @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

        Engelard 1 Reply Last reply Reply Quote 4
        • K
          koahnig @Engelard last edited by

          @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 Reply Quote 3
          • Engelard
            Engelard @Pablo J. Rogina last edited by Engelard

            @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 Reply Quote 0
            • M
              mpergand last edited by

              QFont font=QFontDatabase::systemFont(QFontDatabase::FixedFont);
              
              Engelard 1 Reply Last reply Reply Quote 4
              • Engelard
                Engelard @mpergand last edited by

                @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 Reply Quote 0
                • First post
                  Last post