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. change different font size of different widget at a time
Forum Updated to NodeBB v4.3 + New Features

change different font size of different widget at a time

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 3 Posters 2.0k Views 2 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.
  • S Offline
    S Offline
    saber
    wrote on last edited by saber
    #1

    Is there any way to change the fonts of the whole app's widgets,label,pushbutton with just one spinbox ??

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi
      Well there is QApplication::setFont(font);

      S 1 Reply Last reply
      3
      • mrjjM mrjj

        Hi
        Well there is QApplication::setFont(font);

        S Offline
        S Offline
        saber
        wrote on last edited by
        #3

        @mrjj

        problem is i used mixed font in different widgets . like some button has font size 11 and some has 10.

        so i guess i have to set one number to all??

        thanks .

        mrjjM 1 Reply Last reply
        0
        • S saber

          @mrjj

          problem is i used mixed font in different widgets . like some button has font size 11 and some has 10.

          so i guess i have to set one number to all??

          thanks .

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @saber
          It depends on what goal is.
          Use same size on all or what you want.
          Else you will to handle the buttons manually.
          So yes, one size is easier.

          if you already are using style sheets, it could also be an option.

          S 1 Reply Last reply
          1
          • mrjjM mrjj

            @saber
            It depends on what goal is.
            Use same size on all or what you want.
            Else you will to handle the buttons manually.
            So yes, one size is easier.

            if you already are using style sheets, it could also be an option.

            S Offline
            S Offline
            saber
            wrote on last edited by
            #5

            @mrjj
            i don't know what is best for that.
            i have to use different font size .
            i used the font option in qtdesigner . but if i could get the different font size with style sheets , i will do that.

            1 Reply Last reply
            0
            • N Offline
              N Offline
              nkiy
              wrote on last edited by nkiy
              #6

              maybe you could try with stylesheet ? like "QWidget { font-family: xxxx }" ?

              UPDATE:
              well I just found that QWidget only supports background style properties, useless suggestion, plz ignore me.

              mrjjM 1 Reply Last reply
              2
              • N nkiy

                maybe you could try with stylesheet ? like "QWidget { font-family: xxxx }" ?

                UPDATE:
                well I just found that QWidget only supports background style properties, useless suggestion, plz ignore me.

                mrjjM Offline
                mrjjM Offline
                mrjj
                Lifetime Qt Champion
                wrote on last edited by
                #7

                @nkiy
                Hi, you can use fonts :)
                alt text

                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