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. Reflection Question ...

Reflection Question ...

Scheduled Pinned Locked Moved General and Desktop
10 Posts 3 Posters 2.7k Views
  • 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 Offline
    A Offline
    ahura_24
    wrote on last edited by
    #1

    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
    0
    • B Offline
      B Offline
      bodzio131
      wrote on last edited by
      #2

      What about QGraphicsItemAnimation?

      1 Reply Last reply
      0
      • Chris KawaC Online
        Chris KawaC Online
        Chris Kawa
        Lifetime Qt Champion
        wrote on last edited by
        #3

        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
        0
        • A Offline
          A Offline
          ahura_24
          wrote on last edited by
          #4

          can you explain to me please ?

          1 Reply Last reply
          0
          • Chris KawaC Online
            Chris KawaC Online
            Chris Kawa
            Lifetime Qt Champion
            wrote on last edited by
            #5

            @
            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
            0
            • A Offline
              A Offline
              ahura_24
              wrote on last edited by
              #6

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

              1 Reply Last reply
              0
              • Chris KawaC Online
                Chris KawaC Online
                Chris Kawa
                Lifetime Qt Champion
                wrote on last edited by
                #7

                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
                0
                • A Offline
                  A Offline
                  ahura_24
                  wrote on last edited by
                  #8

                  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
                  0
                  • Chris KawaC Online
                    Chris KawaC Online
                    Chris Kawa
                    Lifetime Qt Champion
                    wrote on last edited by
                    #9

                    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
                    0
                    • A Offline
                      A Offline
                      ahura_24
                      wrote on last edited by
                      #10

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

                      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