Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. PInch Zoom
Forum Updated to NodeBB v4.3 + New Features

PInch Zoom

Scheduled Pinned Locked Moved Mobile and Embedded
18 Posts 3 Posters 6.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.
  • C Offline
    C Offline
    clouca
    wrote on last edited by
    #1

    Does anyone knows how to implement Pinch Zoom in Qt? this link
    http://qt-project.org/doc/qt-4.8/touch-pinchzoom-main-cpp.html can't help me because i can't find classes like viewport() etc. Has anyone experience about that ?
    Thanks.

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      What are you interested in? QGraphicsView or QtQuick?

      In QtQuick, you just need to use PinchArea element. No need to implement anything special.

      (Z(:^

      1 Reply Last reply
      0
      • C Offline
        C Offline
        clouca
        wrote on last edited by
        #3

        I have a widget with image. And i want to use it on android.! In the example i have i my first post.. i can't understand what's happening. furthermore i get the error error: QGraphicsScene: No such file or directory
        thanks for fast reply!

        1 Reply Last reply
        0
        • sierdzioS Offline
          sierdzioS Offline
          sierdzio
          Moderators
          wrote on last edited by
          #4

          The include is wrong, it should be:
          @
          #include <QGraphicsView>
          @

          (Z(:^

          1 Reply Last reply
          0
          • C Offline
            C Offline
            clouca
            wrote on last edited by
            #5

            i am sorry i paste the wrong sentence. yes i used #include <QGraphicsView> and get this error..

            1 Reply Last reply
            0
            • sierdzioS Offline
              sierdzioS Offline
              sierdzio
              Moderators
              wrote on last edited by
              #6

              Add #include <QGraphicsScene> too, then ;) Or the whole <QtGui>, to make things simpler and slower.

              (Z(:^

              1 Reply Last reply
              0
              • C Offline
                C Offline
                clouca
                wrote on last edited by
                #7

                i tried!. useless.! it is very bad that they upload a non working example.!! nevertheless my intention is to user pinch zoom, despite the fact that the example is wrong

                1 Reply Last reply
                0
                • sierdzioS Offline
                  sierdzioS Offline
                  sierdzio
                  Moderators
                  wrote on last edited by
                  #8

                  Please, before blaming others make sure you are not doing something wrong. Maybe you are using Qt 5, and not Qt 4 (this example is for Qt4, which does not support Android at all).

                  (Z(:^

                  1 Reply Last reply
                  0
                  • C Offline
                    C Offline
                    clouca
                    wrote on last edited by
                    #9

                    I am using Qt 5.1.1 and i am trying to compile first for desktop. this #include <QGraphicsView> is not working on Qt 5 ? Is there any example for Qt5 pinch and android ?

                    1 Reply Last reply
                    0
                    • sierdzioS Offline
                      sierdzioS Offline
                      sierdzio
                      Moderators
                      wrote on last edited by
                      #10

                      You may be missing the include of widgets in your .pro file. it is required in Qt5 if you are using widgets. That is why your header include is not working. Add this to your .pro file:
                      @
                      QT += widgets
                      @

                      Transition from Qt 4 to Qt 5 is easy in general, but it might be hard for newcomers. I recommend only using examples for the version you are using.

                      (Z(:^

                      1 Reply Last reply
                      0
                      • C Offline
                        C Offline
                        clouca
                        wrote on last edited by
                        #11

                        I agree with you. Is there any example for Qt 5.1.1 ? for this purpose ?

                        1 Reply Last reply
                        0
                        • sierdzioS Offline
                          sierdzioS Offline
                          sierdzio
                          Moderators
                          wrote on last edited by
                          #12

                          Sorry, I don't know, I did not have any need for it yet.

                          (Z(:^

                          1 Reply Last reply
                          0
                          • C Offline
                            C Offline
                            clouca
                            wrote on last edited by
                            #13

                            Did you use pinch zoom for android in Qt 5.1.1 ? Anyone else tried to do it ?

                            1 Reply Last reply
                            0
                            • sierdzioS Offline
                              sierdzioS Offline
                              sierdzio
                              Moderators
                              wrote on last edited by
                              #14

                              No, last time I've tried was with Qt 4.8 and Necessitas Android port. Worked flawlessly (but in QML, not QWidgets), and I suspect the same is true for Qt 5. I have not seen any bugs reported on that.

                              (Z(:^

                              1 Reply Last reply
                              0
                              • C Offline
                                C Offline
                                clouca
                                wrote on last edited by
                                #15

                                I know.. but i can't change the whole application to QML now.. it will duplicate the work hours.

                                1 Reply Last reply
                                0
                                • C Offline
                                  C Offline
                                  clouca
                                  wrote on last edited by
                                  #16

                                  Finally i make the pinchzoom example work on android. Simulator and real device. The problem is that i want to transfer the functionality of pinchzoom to my app which is working with PinchZoom example.

                                  1 Reply Last reply
                                  0
                                  • T Offline
                                    T Offline
                                    Tsweti
                                    wrote on last edited by
                                    #17

                                    It is good to share what the problem was. Other people may have the same problem.

                                    1 Reply Last reply
                                    0
                                    • C Offline
                                      C Offline
                                      clouca
                                      wrote on last edited by
                                      #18

                                      the problem is QT += widgets in the .pro file. Clean - qmake - rebuild and then run. Now i am trying to copy the functionality to my project. I will keep all people here get informed.

                                      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