Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Reflection Question ...

    General and Desktop
    3
    10
    2192
    Loading More Posts
    • 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.
    • A
      ahura_24 last edited by

      hi every body . i try write "drawing window" and i use qgraphicsscene and qgraphicsitems like rectitem, ellipseitem, ....
      i want to reflect graphicsitem in relation to Y axis or X axis .
      tnx alot :)

      1 Reply Last reply Reply Quote 0
      • B
        bodzio131 last edited by

        What about QGraphicsItemAnimation?

        1 Reply Last reply Reply Quote 0
        • Chris Kawa
          Chris Kawa Moderators last edited by

          X: Scale on x axis to -1 and translate by height.
          Y: Scale on y axis to -1 and translate by width.

          1 Reply Last reply Reply Quote 0
          • A
            ahura_24 last edited by

            can you explain to me please ?

            1 Reply Last reply Reply Quote 0
            • Chris Kawa
              Chris Kawa Moderators last edited by

              @
              QPixmap batman("./batman.png");

              QGraphicsScene* scene = new QGraphicsScene();
              QGraphicsPixmapItem* normalItem = scene->addPixmap(batman);
              QGraphicsPixmapItem* mirrorItem = scene->addPixmap(batman);
              
              QGraphicsScale* scale = new QGraphicsScale(scene);
              scale->setXScale(-1.0);
              
              mirrorItem->setTransformations(QList<QGraphicsTransform*>() << scale);
              
              ui->graphicsView->setScene(scene);
              

              @
              gives you this:
              !http://img37.imageshack.us/img37/1167/batmanzq.jpg(batman picture)!

              1 Reply Last reply Reply Quote 0
              • A
                ahura_24 last edited by

                hahah too sweet :D tnx a lot
                does exist ebook about this ?

                1 Reply Last reply Reply Quote 0
                • Chris Kawa
                  Chris Kawa Moderators last edited by

                  If you ask about QGraphicsView I'd suggest reading through docs. They are really comprehensive.
                  Also check "Qt examples":http://qt-project.org/doc/qt-4.8/examples-graphicsview.html

                  As for batman I'd try "this link":http://www.dccomics.com/ :)

                  1 Reply Last reply Reply Quote 0
                  • A
                    ahura_24 last edited by

                    ok ok tnx alot :) . i have another question : how can i draw PolyLine in graphicsscene like other graphics object ? i want that can select and move it and other option like other object in graphic ?

                    i know that must create one class and inherit form QGrItem but i dont know how can i calculate bounding rect and shape and .... :(

                    1 Reply Last reply Reply Quote 0
                    • Chris Kawa
                      Chris Kawa Moderators last edited by

                      Another name for polyline is path, and there's already a class for it in Qt: "QGraphicsPathItem":http://qt-project.org/doc/qt-5.0/qtwidgets/qgraphicspathitem.html

                      1 Reply Last reply Reply Quote 0
                      • A
                        ahura_24 last edited by

                        tnx i read this tnx alot :) :) if i have question i ask you :) tnx

                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post