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. Problem in text browser
Forum Updated to NodeBB v4.3 + New Features

Problem in text browser

Scheduled Pinned Locked Moved Solved General and Desktop
8 Posts 4 Posters 633 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.
  • H Offline
    H Offline
    hihanna14
    wrote on last edited by
    #1

    Hello

    I have problem as below when I click arrow button in text browser's scroll bar.
    log.PNG

    I don't want to cut the text. Is there any solution?

    1 Reply Last reply
    0
    • JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by JonB
      #2

      What is it you don't like/want in the picture? You want to make the window higher so that more is shown? You don't like that scrolling might cause a line to be shown cut in half vertically? You want to control the scrolling so that it only scrolls a complete line at a time? Do you store HTML in the QTextBrowser or only plain text?

      1 Reply Last reply
      0
      • H Offline
        H Offline
        hihanna14
        wrote on last edited by
        #3

        Thank you for reply.

        I want that when I clicked arrow button like this arrow.PNG , the text line should not cut vertically.
        I need to output 3 plain text lines in the text browser.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Hi,

          Do you mean you want to scroll per line or per three lines ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • H Offline
            H Offline
            hihanna14
            wrote on last edited by hihanna14
            #5

            Hello,

            Thank you for reply.
            I mean I want to scroll per 1 line.

            JonBJ 1 Reply Last reply
            0
            • kkoehneK Offline
              kkoehneK Offline
              kkoehne
              Moderators
              wrote on last edited by
              #6

              I'm not sure how to do this with QTextEdit, but if it's just plain text (like in your example) you can consider using QPlainTextEdit instead. This AFAIK scrolls by lines only by default.

              Director R&D, The Qt Company

              1 Reply Last reply
              2
              • H hihanna14

                Hello,

                Thank you for reply.
                I mean I want to scroll per 1 line.

                JonBJ Offline
                JonBJ Offline
                JonB
                wrote on last edited by JonB
                #7

                @hihanna14
                If you can change like @kkoehne said that's easiest.

                Otherwise, you'll have to catch the scrollbar command. And then I imagine, because QTextBrowser accepts HTML not just plain text (I asked you earlier about this), you'll have to do something like measure the font's line height and multiple by 3 to get what you want (or be lazy and hard-code a figure!).

                1 Reply Last reply
                2
                • H Offline
                  H Offline
                  hihanna14
                  wrote on last edited by
                  #8

                  I changed 'Textbrowser' to 'PlainTextEdit'.
                  It works!!. Thank you, @JonB & @kkoehne .
                  Merry Christmas!!

                  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