I am trying to check collisions between a QPolygon and a QRect by turning the QRect into a QPolygon. However, the rectangle might also have a rotation that I have added, so I am wondering how I would turn that QRect into a QPolygon taking into account the rotation?
Turn a rotated QRect into a QPolygon
1.9k Views Asked by Tom Leese At
1
There are 1 best solutions below
Related Questions in QT
- C++ template using pointer and non pointer arguments in a QVector
- Using QPointer and QObject::connect with C++11
- qt How to style a QToolBar > QToolButton overflow button?
- Qt - Repeatedly write at beginning of file
- C++ Mongodb driver, not working
- deletion and cleanup of worker thread in Qt crashes
- How to drap item from QTableView to QPushButton?
- get image type from qimage
- C++ QT Getting part from QString
- How to connect a destroyed signal of C++ object from QML?
- How to get shader version from QOpenGLShader?
- Size of Qt QRadioButton able to get smaller, but not larger than default
- error WinSock.h has already been included Boost Windows Qt
- How to call a non-class member function with pointers as parameters with QtConcurrent::run?
- What is the difference between MinGW SEH and MinGW SJLJ?
Related Questions in COLLISION-DETECTION
- simple collision detection for edge animate program
- Collison Detection between two point clouds using PCL
- Math/Physics: Given angle and vector find point of intersection?
- How to check for collisions in ThreeJS?
- javafx collision issue between path(line) with thick stroke and circle
- ThreeJS collisions with SAT missaligned collision boxes
- isInside not working for btConvexHullShape of Bullet Physics library
- Swift: score increases twice because collision is detected twice?
- C# XNA Collision Detection with list of objects
- Collision Detection with an NSMutable array of Objects
- Partial Collision Error
- cocos2d-x: can not create callback from onContactBegin
- LibGDX - Tilemap Wall Collision Detection issues
- Collision detection between rectangles (no overlap) - libgdx
- Collision detection between two rectangles in java
Related Questions in QPOLYGON
- PyQt5: Filling in the holes in QPolygon // Increasing the size (height) of a qpolygon
- How calculate QPolygon area
- QGraphicsPolygonItem - How to change Points coordinates
- How draw Polygon from MouseEvents on top of Image in Qlabel
- Turn a rotated QRect into a QPolygon
- A bad spatial partitioning using quadtree
- Scaling an already drawn QPolygonF in drawing
- How to know if a point is on the perimeter of a QPolygon (PyQt4)
- Qt/C++ Inheritance from QPolygonF as QList item
- Qt C++ Error when drawing a simple polygon
- Intersection of QPolygons' edges / Getting all the points on Qpolygon's Edge
- Qt rotated image -> polygon
- How to draw Convex Rectangle in combination with ellipsoids by using Qt4.8 (C++)? (top view of a boat)
- QPolygon transformation
- Draw arc and override boundingRect(), shape()
Related Questions in QRECT
- PyQt6, drawing shapes over loaded PDF file
- QSystemTrayIcon does not return any geometry information
- PySide metro style mousepressevent
- How to move an Item's QRect
- QT Round Edges Rectangle
- QGraphicsRotation to QRectF?
- Turn a rotated QRect into a QPolygon
- Animating a QRect with QPropertyAnimation
- how to work with Geom in QT?
- PyQt5 extending lines past the image being drawn. How can I prevent this from occuring?
- QWidget framing
- How to move a child window relative to a parent window in PyQt5?
- Making A QPushButton round C++
- Problem in drawing Rectangle with mouse event in QGraphicScene
- How to resize a QGraphicsRectItem using the mouse
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
I think you can convert
QRectintoQPolygonusingQMatrix::mapToPolygon.Here is the description: http://doc.qt.io/qt-5/qmatrix.html#mapToPolygon
I believe you will be able to convert your
QRectintoQPolygontaking the rotation matrix into account.Edit: Actually
QTransform::mapToPolygoncan be more suitable in this case. Please try:http://doc.qt.io/qt-5/qtransform.html#mapToPolygon
as well.