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. How to write a top-to-bottom text?
Forum Updated to NodeBB v4.3 + New Features

How to write a top-to-bottom text?

Scheduled Pinned Locked Moved Unsolved General and Desktop
10 Posts 3 Posters 1.5k 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.
  • R Offline
    R Offline
    RazrFalcon
    wrote on last edited by
    #1

    E.g.

    日
    本
    

    Instead of 日本. And not manually, but rather by using something like pango's gravity option.

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

      Hi
      Where do you want to write it ?
      You could use a custom widget like here
      https://stackoverflow.com/questions/9183050/vertical-qlabel-or-the-equivalent

      1 Reply Last reply
      2
      • R Offline
        R Offline
        RazrFalcon
        wrote on last edited by
        #3

        I want to draw this via QPainter.

        You could use a custom widget like here

        It's not what I want. It simply rotates the text.

        mrjjM 1 Reply Last reply
        0
        • R RazrFalcon

          I want to draw this via QPainter.

          You could use a custom widget like here

          It's not what I want. It simply rotates the text.

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

          @RazrFalcon
          ok. but you are not providing much information of what you want then. :)
          In a TextEdit or where you want to type it then ?

          R 1 Reply Last reply
          0
          • R RazrFalcon

            E.g.

            日
            本
            

            Instead of 日本. And not manually, but rather by using something like pango's gravity option.

            J.HilkJ Offline
            J.HilkJ Offline
            J.Hilk
            Moderators
            wrote on last edited by
            #5

            @RazrFalcon said in How to write a top-to-bottom text?:

            gravity

            hi,

            have you tried to enabling WordWrap of your QLabel, that should force new characters in a new line, if you restrict the with of the QLabel and enable vertical expanding (if needed)


            Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


            Q: What's that?
            A: It's blue light.
            Q: What does it do?
            A: It turns blue.

            R 1 Reply Last reply
            3
            • J.HilkJ J.Hilk

              @RazrFalcon said in How to write a top-to-bottom text?:

              gravity

              hi,

              have you tried to enabling WordWrap of your QLabel, that should force new characters in a new line, if you restrict the with of the QLabel and enable vertical expanding (if needed)

              R Offline
              R Offline
              RazrFalcon
              wrote on last edited by
              #6

              Word wrap is a completely different thing.

              1 Reply Last reply
              0
              • mrjjM mrjj

                @RazrFalcon
                ok. but you are not providing much information of what you want then. :)
                In a TextEdit or where you want to type it then ?

                R Offline
                R Offline
                RazrFalcon
                wrote on last edited by
                #7

                @mrjj I don't want to type them. I want to draw them. Similar to the CSS Writing Modes.

                mrjjM 1 Reply Last reply
                0
                • R RazrFalcon

                  @mrjj I don't want to type them. I want to draw them. Similar to the CSS Writing Modes.

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

                  @RazrFalcon
                  Hi
                  Ah, yes, rotating text is not good enough
                  as each char is wrong orientation then.

                  The TabWidget can draw top-buttom it seems but im afraid im not sure
                  how it does it.

                  alt text

                  1 Reply Last reply
                  0
                  • R Offline
                    R Offline
                    RazrFalcon
                    wrote on last edited by
                    #9

                    The TabWidget can draw top-buttom

                    No, it can't. It just rotates the text.

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

                      Hi
                      Well TextEdit can sort of do it using @J-Hilk idea.

                      alt text

                      using
                      alt text

                      alt text

                      1 Reply Last reply
                      3

                      • Login

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