summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qcore_foundation.mm
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/kernel/qcore_foundation.mm')
-rw-r--r--src/corelib/kernel/qcore_foundation.mm37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/corelib/kernel/qcore_foundation.mm b/src/corelib/kernel/qcore_foundation.mm
index 4998b9e35a..2291017a5d 100644
--- a/src/corelib/kernel/qcore_foundation.mm
+++ b/src/corelib/kernel/qcore_foundation.mm
@@ -496,5 +496,42 @@ QPointF QPointF::fromCGPoint(CGPoint point) Q_DECL_NOTHROW
return QPointF(point.x, point.y);
}
+// ----------------------------------------------------------------------------
+
+/*!
+ \since 5.8
+
+ Creates a CGSize from a QSize.
+
+ \sa fromCGSize()
+*/
+CGSize QSize::toCGSize() const Q_DECL_NOTHROW
+{
+ return CGSizeMake(width(), height());
+}
+
+/*!
+ \since 5.8
+
+ Creates a CGSize from a QSizeF.
+
+ \sa fromCGSize()
+*/
+CGSize QSizeF::toCGSize() const Q_DECL_NOTHROW
+{
+ return CGSizeMake(width(), height());
+}
+
+/*!
+ \since 5.8
+
+ Creates a QRectF from a CGSize.
+
+ \sa toCGSize()
+*/
+QSizeF QSizeF::fromCGSize(CGSize size) Q_DECL_NOTHROW
+{
+ return QSizeF(size.width, size.height);
+}
QT_END_NAMESPACE