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. Zoom - what is the best way to do this?
Qt 6.11 is out! See what's new in the release blog

Zoom - what is the best way to do this?

Scheduled Pinned Locked Moved General and Desktop
11 Posts 3 Posters 3.8k 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.
  • D Offline
    D Offline
    DerManu
    wrote on last edited by
    #2

    You could place your whole UI in a QGraphicsView and use "QGraphicsProxyWidget":http://qt-project.org/doc/qt-4.8/qgraphicsproxywidget.html#details to embed QWidgets there. Then zooming should be as easy as calling scale on the graphicsview/scene.

    1 Reply Last reply
    0
    • D Offline
      D Offline
      Dolphin
      wrote on last edited by
      #3

      Fab, I will try that :-)

      1 Reply Last reply
      0
      • Q Offline
        Q Offline
        qxoz
        wrote on last edited by
        #4

        Or you can zoom by changing font size:
        @void Dialog::on_pushButton_clicked()
        {
        QFont ff = this->font();
        ff.setPointSize(22);
        this->setFont(ff);
        this->resize(sizeHint());
        }@

        1 Reply Last reply
        0
        • D Offline
          D Offline
          DerManu
          wrote on last edited by
          #5

          [quote author="qxoz" date="1338807631"]Or you can zoom by changing font size[/quote]

          Since this would only work on controls with text on them, I'm not sure it's a good idea for increasing accessibility for partially sight-disabled. You'd need to take care of all other controls with individual hacks (tool-buttons, controls with custom paint event, labels that show images, etc.).

          1 Reply Last reply
          0
          • Q Offline
            Q Offline
            qxoz
            wrote on last edited by
            #6

            [quote author="Dolphin" date="1338212821"] (Currently just had a listWidget and a couple of buttons, purpose-built very simple UI).[/quote]

            and I proposed this.

            1 Reply Last reply
            0
            • D Offline
              D Offline
              DerManu
              wrote on last edited by
              #7

              bq. Currently.

              This may change in the future. And apart from that, he was asking for elegant solutions. Elegant solutions partly are elegant because they catch corner cases implicitly.

              1 Reply Last reply
              0
              • D Offline
                D Offline
                Dolphin
                wrote on last edited by
                #8

                Morning people, hope you had a good looooooooong weekend.

                Have not managed to get this working yet but been side tracked (and on holiday) - thanks for your thoughts. I will try them out.

                I'm a girl by the way ;-)

                1 Reply Last reply
                0
                • Q Offline
                  Q Offline
                  qxoz
                  wrote on last edited by
                  #9

                  [quote author="Dolphin" date="1339057298"]
                  I'm a girl by the way ;-)[/quote]
                  I'm a boy, just in case :)

                  1 Reply Last reply
                  0
                  • D Offline
                    D Offline
                    Dolphin
                    wrote on last edited by
                    #10

                    DerManu - sorry to be a pain but do you have a simple example? I have been through about 10 different examples and not got anything working (putting everything in the a QGraphicsView and scaling the view).

                    1 Reply Last reply
                    0
                    • D Offline
                      D Offline
                      Dolphin
                      wrote on last edited by
                      #11

                      Never mind - I was being dim, my view was going out of scope.

                      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