7#include "Kanoop/kanoopcommon.h"
14class KANOOP_EXPORT
Size :
public QSizeF
21 Size(
const QSizeF& other) : QSizeF(other) {}
24 Size(
const QSize& other) : QSizeF(other) {}
30 Size(
double w,
double h) : QSizeF(w, h) {}
54 QString
toString()
const {
return QString(
"%1, %2").arg(width()).arg(height()); }
A 2D rectangle extending QRectF with edge, corner, and geometric query helpers.
Extends QSizeF with convenient grow/shrink operations and Rectangle conversion.
Size(double w, double h)
Construct from explicit width and height.
Size()
Default constructor — creates a null (0x0) size.
void shrink(double amount)
Shrink both dimensions by the given amount.
Rectangle toRectangle() const
Convert this size to a Rectangle positioned at the origin.
void grow(double amount)
Grow both dimensions by the given amount.
QString toString() const
Format this size as "w, h".
Size(const QSize &other)
Construct from a QSize (integer dimensions).
Size(const QSizeF &other)
Construct from a QSizeF.
static Size fromString(const QString &value)
Parse a Size from a string produced by toString().