summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qdatetime_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/qdatetime_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/qdatetime_mac.mm')
-rw-r--r--src/corelib/tools/qdatetime_mac.mm29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/corelib/tools/qdatetime_mac.mm b/src/corelib/tools/qdatetime_mac.mm
index d61ea28636..c03c57d9f1 100644
--- a/src/corelib/tools/qdatetime_mac.mm
+++ b/src/corelib/tools/qdatetime_mac.mm
@@ -44,6 +44,13 @@
QT_BEGIN_NAMESPACE
+/*! \fn QDateTime QDateTime::fromCFDate(CFDateRef date)
+ \since 5.5
+
+ Constructs a new QDateTime containing a copy of the CFDate \a date.
+
+ \sa toCFDate()
+*/
QDateTime QDateTime::fromCFDate(CFDateRef date)
{
if (!date)
@@ -52,12 +59,27 @@ QDateTime QDateTime::fromCFDate(CFDateRef date)
+ kCFAbsoluteTimeIntervalSince1970) * 1000));
}
+/*! \fn CFDateRef QDateTime::toCFDate() const
+ \since 5.5
+
+ Creates a CFDate from a QDateTime. The caller owns the CFDate object
+ and is responsible for releasing it.
+
+ \sa fromCFDate()
+*/
CFDateRef QDateTime::toCFDate() const
{
return CFDateCreate(kCFAllocatorDefault, (static_cast<CFAbsoluteTime>(toMSecsSinceEpoch())
/ 1000) - kCFAbsoluteTimeIntervalSince1970);
}
+/*! \fn QDateTime QDateTime::fromNSDate(const NSDate *date)
+ \since 5.5
+
+ Constructs a new QDateTime containing a copy of the NSDate \a date.
+
+ \sa toNSDate()
+*/
QDateTime QDateTime::fromNSDate(const NSDate *date)
{
if (!date)
@@ -65,6 +87,13 @@ QDateTime QDateTime::fromNSDate(const NSDate *date)
return QDateTime::fromMSecsSinceEpoch(static_cast<qint64>([date timeIntervalSince1970] * 1000));
}
+/*! \fn NSDate QDateTime::toNSDate() const
+ \since 5.5
+
+ Creates an NSDate from a QDateTime. The NSDate object is autoreleased.
+
+ \sa fromNSDate()
+*/
NSDate *QDateTime::toNSDate() const
{
return [NSDate