Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved
    1. Home
    2. Tags
    3. rotation

    Log in to post
    • All categories
    • L

      Unsolved rotated qgraphicssceneitem bounding rect
      General and Desktop • qgraphicsscene qgraphicsitem qpolygon qrect rotation • • Loc888

      3
      0
      Votes
      3
      Posts
      317
      Views

      T

      Hey, not sure if you found the solution yet. But you can try this:

      QGraphicsPixmapItem *pixmapItem = new QGraphicsPixmapItem; pixmapItem->setPixmap(QPixmap(":/images/pixmap.png")); _scene->addItem(pixmapItem); pixmapItem->setRotation(pixmapItem->rotation() + 45.0); QGraphicsRectItem *boundingRect = new QGraphicsRectItem(pixmapItem->sceneBoundingRect()); QPen outlinePen; outlinePen.setWidth(2); outlinePen.setColor(Qt::red); boundingRect->setPen(outlinePen); _scene->addItem(boundingRect);

      I believe what you want is the sceneBoundingRect() and not the boundingRect().

    • N

      Unsolved Duplicating the orientation of a graph on to a mesh
      General and Desktop • scene3d rotation scatter3d • • new.qt_user-2022

      1
      0
      Votes
      1
      Posts
      100
      Views

      No one has replied

    • H

      Unsolved Bad performance on Embedded device when rotating qml scene
      Mobile and Embedded • beaglebone linuxfb opengl rotation • • HSK_Developer

      1
      0
      Votes
      1
      Posts
      289
      Views

      No one has replied

    • M

      Solved How to rotate a Pixmap around bottom, right corner?
      General and Desktop • pixmap rotati rotation qtransform qgraphicspixma qgraphics • • michelmadeira

      2
      0
      Votes
      2
      Posts
      326
      Views

      Christian Ehrlicher

      @michelmadeira said in How to rotate a Pixmap around bottom, right corner?:

      How to change anchor point of a pixmap rotation?

      By modifying your QTransform to set 0/0 to the bottom right corner because the Qt coordinate system starts with 0/0 in the upper left.

    • G

      Unsolved Mirroring a Pixmap Item around an axis
      General and Desktop • qgraphicspixmap transform rotation c++ qt5 • • Giuseppe97

      12
      0
      Votes
      12
      Posts
      1428
      Views

      SGaist

      Did you already read the Graphics View Overview in Qt's documentation ?

    • H

      Unsolved understanding transform
      QML and Qt Quick • transform rotation origin axis • • houmingc

      2
      0
      Votes
      2
      Posts
      426
      Views

      T

      @houmingc You took that example straight from the documentation page for Rotation, which shows a picture of exactly what will happen. What more do you need? "Default angle" makes no sense. If you don't specify one there will be no rotation. It rotates around the origin along the axis. If you still don't understand, make a quick example and play around with it.

    • L

      Unsolved Getting screen orientation in Windows
      QML and Qt Quick • surface windows rotation orientation qml • • larkei15

      1
      0
      Votes
      1
      Posts
      430
      Views

      No one has replied

    • M

      Unsolved Screen rotation - Beaglebone QT5/Eglfs
      Mobile and Embedded • eglfs beaglebone bbb rotation qt 5.7 qt5 • • m.esmaeelpour

      1
      1
      Votes
      1
      Posts
      828
      Views

      No one has replied

    • L

      Unsolved Can't shoot bullets from the tip of the turret after calling setRotation()
      Game Development • qt5 qgraphicspixmap rotation rotate • • Liviu

      3
      0
      Votes
      3
      Posts
      1341
      Views

      Navca Lin

      you can try this :

      https://github.com/sunnyfulin/TankWar.git

      a little game, almost the same with yours. not finished yet.

      use keys: w , s , a , d to move the tank and mouse to control the turrent direction, and mouse's left button click to fire a bullet.
      mouse's right button pressed for locking the turrent direction.

    • S

      Rotating a QLabel
      General and Desktop • qimage qwidget rotation scale qgraphicsitem • • sunil.nair

      3
      0
      Votes
      3
      Posts
      3614
      Views

      ?

      You can add a widget to the scene using QGraphicsProxyWidget *QGraphicsScene::addWidget(QWidget *widget, Qt::WindowFlags wFlags = Qt::WindowFlags()).

    • Lulu31

      Unsolved How to make the map object rotates like a navigation system do ?
      General and Desktop • qml map rotation positionsource • • Lulu31

      1
      0
      Votes
      1
      Posts
      574
      Views

      No one has replied

    • P

      [SOLVED] Different transformOrigin point during RotationAnimaton other than the one Item provides
      QML and Qt Quick • rotation animation transform • • Piyush Gupta

      3
      0
      Votes
      3
      Posts
      1390
      Views

      P

      Thanks that did exactly what I needed.

    • H

      Not able to rotate a QPixmap
      General and Desktop • rotation • • houmingc

      2
      0
      Votes
      2
      Posts
      1552
      Views

      Chris Kawa

      First of all while(1) in a UI thread is a very bad idea. This effectively freezes your ui.
      A quick fix is to add qApp->processEvents(); at the end of the loop, but that's really just a band-aid.

      Instead of the loop I would suggest to start a timer at reasonable interval (not shorter than an average monitor can actually display). You wouldn't need the processEvents hack with that.
      Another thing is that you're loading an image, setting painter hints and recreating two pixmaps and a painter every step of the animation. That's terribly inefficient. Take them all out of the loop and just redo the painting, not the whole shabang.