Qt-fortran questions A developer used Anthropic's Claude to generate Qt-fortran, a Fortran binding to Qt's geometry and vector types, runnable via `pixi run example geometry`. The binding exposes Qt types including QPoint, QPointF, QSize, QSizeF, QMargins, QRect, QRectF, QLineF, QVector2D, QVector3D, QVector4D and QQuaternion, each with public components, structure constructors and Qt methods, plus operators such as `+` and `-` for points, sizes and margins and `rect + margins`/`rect - margins`. The release also adds QMatrix4x4 methods `translate(QVector3D)`, `scale(QVector3D)`, `rotate(angle, QVector3D)`, `rotate(QQuaternion)` and `lookAt(eye, center, up)`, along with `map(QVector3D)` and `map(QVector4D)`, and a new `mapVector` for vectors. 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, plus toRect and toAlignedRect | | 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 , plus distanceToPlane point, normal or distanceToPlane 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 additions translate 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 translation matrix 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.