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. find string width
Forum Updated to NodeBB v4.3 + New Features

find string width

Scheduled Pinned Locked Moved Unsolved General and Desktop
8 Posts 4 Posters 2.1k 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.
  • R Offline
    R Offline
    Rameshguru
    wrote on last edited by
    #1

    how to find QString widthor change QString Width

    Venkatesh VV 1 Reply Last reply
    0
    • VRoninV Offline
      VRoninV Offline
      VRonin
      wrote on last edited by
      #2

      http://doc.qt.io/qt-5/qstring.html#size
      http://doc.qt.io/qt-5/qstring.html#resize

      "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
      2
      • R Offline
        R Offline
        Rameshguru
        wrote on last edited by
        #3

        Vronin, I want change the size like hello world,HELLO WORLD

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

          http://doc.qt.io/qt-5/qstring.html#toUpper

          "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
          1
          • R Offline
            R Offline
            Rameshguru
            wrote on last edited by
            #5

            Vronin not convert to uppercase ,width of string
            example:
            font:times new romen
            size:12 or 15 or 20

            JohanSoloJ 1 Reply Last reply
            0
            • R Rameshguru

              Vronin not convert to uppercase ,width of string
              example:
              font:times new romen
              size:12 or 15 or 20

              JohanSoloJ Offline
              JohanSoloJ Offline
              JohanSolo
              wrote on last edited by
              #6

              @Rameshguru said in find string width:

              Vronin not convert to uppercase ,width of string
              example:
              font:times new romen
              size:12 or 15 or 20

              Then this has nothing to do with QString: QString is only a container for a string. It knows nothing about how to render the contained data. How are you displaying your "hello world"?

              `They did not know it was impossible, so they did it.'
              -- Mark Twain

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

                The only thing QString can do is hope you use it in a rich text widget. see bottom of page 11 of http://www.bogotobogo.com/cplusplus/files/c-gui-programming-with-qt-4-2ndedition.pdf

                "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
                • R Rameshguru

                  how to find QString widthor change QString Width

                  Venkatesh VV Offline
                  Venkatesh VV Offline
                  Venkatesh V
                  wrote on last edited by
                  #8

                  @Rameshguru
                  Hi,

                  Qstring is just a container class, i think you wanted to change the widget text size, for that you can change the size of text using setstylesheet() method. by using this method you can change font family and size or else you can use setFont() method.

                  1 Reply Last reply
                  1

                  • Login

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