Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Specific rotate of rectangle
Forum Updated to NodeBB v4.3 + New Features

Specific rotate of rectangle

Scheduled Pinned Locked Moved Solved QML and Qt Quick
6 Posts 3 Posters 651 Views 2 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
    dmitry1992
    wrote on last edited by
    #1

    Hi. How can I rotate a rectangle to get isosceles trapezoid?

    Pl45m4P 1 Reply Last reply
    0
    • D dmitry1992

      Hi. How can I rotate a rectangle to get isosceles trapezoid?

      Pl45m4P Offline
      Pl45m4P Offline
      Pl45m4
      wrote on last edited by Pl45m4
      #2

      @dmitry1992

      You mean rotating your rectangle around an axis until you get a trapezoid?

      Where do you want to do it? What are you using? QGraphicsView? QOpenGL?

      Edit:
      Nevermind, didnt notice the "QML"-category :)
      @IntruderExcluder `s approach looks good.


      If debugging is the process of removing software bugs, then programming must be the process of putting them in.

      ~E. W. Dijkstra

      D Pl45m4P 2 Replies Last reply
      0
      • IntruderExcluderI Offline
        IntruderExcluderI Offline
        IntruderExcluder
        wrote on last edited by
        #3

        You can at least play with transform property and Rotation:

            Rectangle {
                id: r1
                width: 100
                height: 200
                color: "blue"
                opacity: 0.5
                
                anchors.centerIn: parent
                
                transform: Rotation {
                    id: rotation
                    origin {
                        x: r1.width/2
                        y: r1.height
                    }
                    axis {
                        x: 1
                        y: 0
                        z: 0
                    }
                    angle: 45
                }
            }
        
        1 Reply Last reply
        4
        • Pl45m4P Pl45m4

          @dmitry1992

          You mean rotating your rectangle around an axis until you get a trapezoid?

          Where do you want to do it? What are you using? QGraphicsView? QOpenGL?

          Edit:
          Nevermind, didnt notice the "QML"-category :)
          @IntruderExcluder `s approach looks good.

          D Offline
          D Offline
          dmitry1992
          wrote on last edited by
          #4

          @pl45m4 Yep, rotating the rectangle around an axis until I get a trapezoid. I want do it in .qml just using QtQuick and Rotation QML Type.

          1 Reply Last reply
          0
          • Pl45m4P Pl45m4

            @dmitry1992

            You mean rotating your rectangle around an axis until you get a trapezoid?

            Where do you want to do it? What are you using? QGraphicsView? QOpenGL?

            Edit:
            Nevermind, didnt notice the "QML"-category :)
            @IntruderExcluder `s approach looks good.

            Pl45m4P Offline
            Pl45m4P Offline
            Pl45m4
            wrote on last edited by Pl45m4
            #5

            @dmitry1992

            @pl45m4 said in Specific rotate of rectangle:

            Nevermind, didnt notice the "QML"-category :)
            @IntruderExcluder `s approach looks good.

            https://doc.qt.io/qt-5/qml-qtquick-rotation.html


            If debugging is the process of removing software bugs, then programming must be the process of putting them in.

            ~E. W. Dijkstra

            1 Reply Last reply
            0
            • D Offline
              D Offline
              dmitry1992
              wrote on last edited by
              #6

              @intruderexcluder
              this is what I need. Thank you!

              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