summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qstring_mac.mm
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>2016-05-02 19:01:55 +0200
committerTor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>2016-05-03 15:20:30 +0000
commit224db5e6eb07154ba2e974a96ee617bf7d740134 (patch)
tree4fba1c56f9ef01bf1723ca07da297283004746cb /src/corelib/tools/qstring_mac.mm
parent597df79c27a2573d540e231bb7b88baf40e5e58e (diff)
darwin: Move conversion function documentation to function definition
It's easier to maintain the function and the docs when they live together. Change-Id: I1e047b4ac1eb61a36849188da560dd899e05509f Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Diffstat (limited to 'src/corelib/tools/qstring_mac.mm')
-rw-r--r--src/corelib/tools/qstring_mac.mm29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/corelib/tools/qstring_mac.mm b/src/corelib/tools/qstring_mac.mm
index 7b3d6b53c0..81cbb91e6c 100644
--- a/src/corelib/tools/qstring_mac.mm
+++ b/src/corelib/tools/qstring_mac.mm
@@ -43,6 +43,13 @@
QT_BEGIN_NAMESPACE
+/*! \fn QString QString::fromCFString(CFStringRef string)
+ \since 5.2
+
+ Constructs a new QString containing a copy of the \a string CFString.
+
+ \note this function is only available on OS X and iOS.
+*/
QString QString::fromCFString(CFStringRef string)
{
if (!string)
@@ -60,11 +67,26 @@ QString QString::fromCFString(CFStringRef string)
return ret;
}
+/*! \fn CFStringRef QString::toCFString() const
+ \since 5.2
+
+ Creates a CFString from a QString. The caller owns the CFString and is
+ responsible for releasing it.
+
+ \note this function is only available on OS X and iOS.
+*/
CFStringRef QString::toCFString() const
{
return CFStringCreateWithCharacters(0, reinterpret_cast<const UniChar *>(unicode()), length());
}
+/*! \fn QString QString::fromNSString(const NSString *string)
+ \since 5.2
+
+ Constructs a new QString containing a copy of the \a string NSString.
+
+ \note this function is only available on OS X and iOS.
+*/
QString QString::fromNSString(const NSString *string)
{
if (!string)
@@ -75,6 +97,13 @@ QString QString::fromNSString(const NSString *string)
return qstring;
}
+/*! \fn NSString QString::toNSString() const
+ \since 5.2
+
+ Creates a NSString from a QString. The NSString is autoreleased.
+
+ \note this function is only available on OS X and iOS.
+*/
NSString *QString::toNSString() const
{
return [NSString stringWithCharacters: reinterpret_cast<const UniChar*>(unicode()) length: length()];