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. Zooming in QTextEdit
Forum Updated to NodeBB v4.3 + New Features

Zooming in QTextEdit

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 3 Posters 3.7k 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.
  • P Offline
    P Offline
    Pauly
    wrote on last edited by
    #1

    I would like to implement a zooming scale bar for QTextEdit, which will zoom everything. The zooming is for displaying only, the actual document font, image size etc should not be changed. That is, if user saves or prints the document in zoom mode, it should be saved and printed in its original size.

    Can someone give me some idea how to achieve this? Thank you.

    1 Reply Last reply
    0
    • RatzzR Offline
      RatzzR Offline
      Ratzz
      wrote on last edited by
      #2

      @Pauly
      Did you check these
      http://doc.qt.io/qt-4.8/qtextedit.html#zoomIn
      http://doc.qt.io/qt-4.8/qtextedit.html#zoomOut

      --Alles ist gut.

      1 Reply Last reply
      2
      • P Offline
        P Offline
        Pauly
        wrote on last edited by
        #3

        Yes, I did. That seems to be changing the font size only. Another difference is that it is actually changing the document therefore printing the document is going to look different...

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

          Hi,

          Then what about using a copy of the document for printing ?

          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
          • P Offline
            P Offline
            Pauly
            wrote on last edited by
            #5

            I rather deal with one document as user may edit the document in zoom mode... Maybe I can zoom it back to 100% before printing.

            However, for the zooming part, it seems that I need to use zoomIn and zoomOut for the text, deal with the image size myself, change the wrap size according to zoom, is that right? How about QTextTable, changing the column width and row height seem to be a lot of hassle?

            All these seems to be a lot of work, I wonder if I'm going on a wrong path. How does a web browser do the zooming? Thanks.

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

              Indeed, the documentation of the methods states explicitly that it won't touch the images.

              As for an alternative, QWeb/WebEngineView might fill the bill however I don't know exactly how the zooming might be handled.

              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

              • Login

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