I just had Claude add it:
Run pixi run example geometry to see an example:
Overloads are listed by the name you call: for example, painter%drawLine(p1, p2).
use qt)
All have public components, structure constructors and Qtβs methods.
qt_geometry)
| Type | Components | Extra constructors | Methods |
|---|---|---|---|
QPoint |
x, y |
isNull ,manhattanLength ,transposed ,toPointF |
|
QPointF |
x, y |
QPointF(QPoint) |
isNull ,manhattanLength ,transposed ,toPoint |
QSize |
width, height |
isNull ,isEmpty ,isValid ,transposed ,expandedTo ,boundedTo ,scaled(size [, mode]) ,grownBy ,shrunkBy ,toSizeF |
|
QSizeF |
width, height |
QSizeF(QSize) |
isNull ,isEmpty ,isValid ,transposed ,expandedTo ,boundedTo ,scaled ,toSize |
QMargins |
left, top, right, bottom |
isNull |
|
QRect |
x, y, width, height |
QRect(topLeft, size) ,QRect(topLeft, bottomRight) |
left ,top ,right ,bottom ,topLeft ,topRight ,bottomLeft ,bottomRight ,center ,size ,isNull ,isEmpty ,isValid ,normalized ,contains(point or rect [, proper]) ,intersects ,intersected ,united ,translated(dx, dy or point) ,adjusted ,marginsAdded ,marginsRemoved ,moveTo ,moveCenter ,toRectF |
QRectF |
x, y, width, height |
QRectF(topLeft, size) ,QRectF(topLeft, bottomRight) ,QRectF(QRect) |
same as QRect without the margins methods, plustoRect andtoAlignedRect |
QLineF |
x1, y1, x2, y2 |
QLineF(p1, p2) |
p1 ,p2 ,dx ,dy ,isNull ,length ,setLength ,angle ,setAngle ,angleTo ,center ,pointAt ,unitVector ,normalVector ,intersects(line [, point]) ,translated |
QPointF_dotProduct, QLineF_fromPolar`` QLineF_NoIntersection, QLineF_BoundedIntersection, QLineF_UnboundedIntersection, Qt_IgnoreAspectRatio, Qt_KeepAspectRatio, Qt_KeepAspectRatioByExpanding``+ and - (including unary minus) for points, sizes and margins; rect + margins and rect - margins``* and / by a number; for the integer types == and /=`` qt_vectors)
| Type | Components | Extra constructors | Methods |
|---|---|---|---|
QVector2D |
x, y |
QVector2D(array) ,QVector2D(QPoint) ,QVector2D(QPointF) |
isNull ,length ,lengthSquared ,normalized ,normalize ,distanceToPoint ,distanceToLine ,toVector3D([z]) ,toVector4D ,toPoint ,toPointF ,toArray |
QVector3D |
x, y, z |
QVector3D(array) ,QVector3D(vector2d [, z]) |
same as QVector2D , plusdistanceToPlane(point, normal) ordistanceToPlane(p1, p2, p3) ,toVector2D ,toVector4D([w]) |
QVector4D |
x, y, z, w |
QVector4D(array) ,QVector4D(vector3d [, w]) ,QVector4D(vector2d [, z, w]) |
isNull ,length ,lengthSquared ,normalized ,normalize ,toVector2D ,toVector2DAffine ,toVector3D ,toVector3DAffine ,toPoint ,toPointF ,toArray |
QQuaternion |
scalar, x, y, z (identity by default) |
QQuaternion(scalar, vector3d) ,QQuaternion(vector4d) |
isNull ,isIdentity ,vector ,length ,lengthSquared ,normalized ,normalize ,conjugated ,inverted ,rotatedVector ,getAxisAndAngle ,toEulerAngles ,toRotationMatrix ,toVector4D |
QVector2D_dotProduct, QVector3D_dotProduct, QVector3D_crossProduct, QVector3D_normal(v1, v2) or QVector3D_normal(v1, v2, v3), QVector4D_dotProduct`` QQuaternion_dotProduct, QQuaternion_fromAxisAndAngle(axis, angle) or (x, y, z, angle), QQuaternion_fromEulerAngles(pitch, yaw, roll) or (vector3d)`` QQuaternion_fromRotationMatrix, QQuaternion_fromAxes, QQuaternion_fromDirection, QQuaternion_rotationTo, QQuaternion_slerp, QQuaternion_nlerp`` QVector3D (rotates the vector)QMatrix4x4 additionstranslate(QVector3D), scale(QVector3D), rotate(angle, QVector3D), rotate(QQuaternion), lookAt(eye, center, up) with map(QVector3D) and map(QVector4D)`` mapVector(v(3) or QVector3D) is new: it applies the 3x3 part only, with no translationmatrix * QVector4D, matrix * QVector3D`` QVector3D_project(obj, modelView, projection, viewport) and QVector3D_unproject(win, modelView, projection, viewport)
QWidget, inherited by every widget:
pos() β QPoint, size() β QSize`` geometry(), frameGeometry(), rect(), contentsRect() β QRect`` sizeHint(), minimumSize(), maximumSize() β QSize`` contentsMargins() β QMargins``setGeometry(QRect)`` move(QPoint), resize(QSize), setMinimumSize(QSize), setMaximumSize(QSize), setFixedSize(QSize), setContentsMargins(QMargins)`` mapToGlobal, mapFromGlobal, mapToParent, mapFromParent (all QPoint β QPoint); mapTo(ancestor, QPoint), mapFrom(ancestor, QPoint)`` childAt(QPoint) β QWidget
`QLayout`:` contentsMargins() β QMargins`, `setContentsMargins(QMargins)`
`QMenu`:` popup(QPoint)`, `exec(QPoint) β QAction`
`QtfPaintCell`:` rect() β QRect`
QPainter:
drawPoint(QPointF)`` drawLine(p1, p2) and drawLine(QLineF)`` drawRect(QRectF)``drawEllipse(QRectF) and drawEllipse(center, rx, ry)`` drawText(QPointF, text) and drawText(QRectF, flags, text)`` fillRect(QRectF, color), setClipRect(QRectF)
QPainterPath:
`moveTo(QPointF)`, `lineTo(QPointF)`, `addRect(QRectF)`, `addEllipse(QRectF)`, `containsPoint(QPointF)`` currentPosition() β QPointF`, `pointAtPercent(t) β QPointF`, `boundingRect() β QRectF`
`QTransform`:` map(QPointF) β QPointF`, `mapRect(QRectF) β QRectF`
`QFontMetrics`:` boundingRect(text) β QRect`, `size(flags, text) β QSize`
`QImage`, `QPixmap`:` size() β QSize`
QWindow:
`position() β QPoint`, `setPosition(QPoint)`` geometry() β QRect`, `mapToGlobal(QPoint)`, `mapFromGlobal(QPoint)`
`QScreen`:` geometry()`, `availableGeometry() β QRect`; `size() β QSize`; `physicalSize() β QSizeF`
`QDrag`:` setHotSpot(QPoint)`
Events:
QMouseEvent: position(), globalPosition() β QPointF`` QWheelEvent: position() β QPointF, angleDelta(), pixelDelta() β QPoint`` QResizeEvent: size(), oldSize() β QSize`` QContextMenuEvent: pos(), globalPos() β QPoint`` QDropEvent: QOpenGLShaderProgram: setUniformValue(name, x, y) (vec2), and setUniformValue(name, QVector2D, QVector3D or QVector4D)
**Free function:** `QCursor_pos() β QPoint`
All the existing scalar versions (`move(x, y)`, `drawLine(x1, y1, x2, y2)`, `mapX`/` mapY`, and so on) are unchanged.