summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/codecs/qtextcodec.cpp16
-rw-r--r--src/corelib/codecs/qtextcodec.h3
-rw-r--r--src/corelib/codecs/qutfcodec_p.h4
-rw-r--r--src/corelib/doc/snippets/code/src_corelib_tools_qeasingcurve.cpp8
-rw-r--r--src/corelib/doc/src/resource-system.qdoc1
-rw-r--r--src/corelib/global/qconfig-bootstrapped.h4
-rw-r--r--src/corelib/global/qlibraryinfo.cpp4
-rw-r--r--src/corelib/global/qlibraryinfo.h4
-rw-r--r--src/corelib/kernel/qcore_unix_p.h2
-rw-r--r--src/corelib/kernel/qobject.cpp16
-rw-r--r--src/corelib/kernel/qvariant.cpp8
-rw-r--r--src/corelib/plugin/qelfparser_p.h2
-rw-r--r--src/corelib/qtcore.tracepoints9
-rw-r--r--src/corelib/serialization/qdatastream.cpp2
-rw-r--r--src/corelib/serialization/qxmlstream.cpp2
-rw-r--r--src/corelib/thread/qfuturewatcher.cpp8
-rw-r--r--src/corelib/thread/qthread.cpp1
-rw-r--r--src/corelib/thread/qthread_win.cpp2
-rw-r--r--src/corelib/tools/qdatetime.cpp112
-rw-r--r--src/corelib/tools/qdatetime.h20
-rw-r--r--src/corelib/tools/qdatetimeparser.cpp20
-rw-r--r--src/corelib/tools/qdatetimeparser_p.h6
-rw-r--r--src/corelib/tools/qeasingcurve.cpp2
-rw-r--r--src/corelib/tools/qlocale.cpp12
-rw-r--r--src/corelib/tools/qlocale.h2
25 files changed, 159 insertions, 111 deletions
diff --git a/src/corelib/codecs/qtextcodec.cpp b/src/corelib/codecs/qtextcodec.cpp
index 7951e95db5..adb84a1856 100644
--- a/src/corelib/codecs/qtextcodec.cpp
+++ b/src/corelib/codecs/qtextcodec.cpp
@@ -1,6 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2018 The Qt Company Ltd.
+** Copyright (C) 2018 Intel Corporation.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtCore module of the Qt Toolkit.
@@ -1236,6 +1237,19 @@ bool QTextDecoder::hasFailure() const
return state.invalidChars != 0;
}
+/*!
+ \internal
+ \since 5.12
+
+ Determines whether the decoder needs more bytes to continue decoding. That
+ is, this signifies that the input string ended in the middle of a
+ multi-byte sequence. Note that it's possible some codecs do not report this.
+ */
+bool QTextDecoder::needsMoreData() const
+{
+ return state.remainingChars;
+}
+
QT_END_NAMESPACE
#endif // QT_NO_TEXTCODEC
diff --git a/src/corelib/codecs/qtextcodec.h b/src/corelib/codecs/qtextcodec.h
index 8153bebac8..09d21166d8 100644
--- a/src/corelib/codecs/qtextcodec.h
+++ b/src/corelib/codecs/qtextcodec.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2018 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtCore module of the Qt Toolkit.
@@ -162,6 +162,7 @@ public:
QString toUnicode(const QByteArray &ba);
void toUnicode(QString *target, const char *chars, int len);
bool hasFailure() const;
+ bool needsMoreData() const;
private:
const QTextCodec *c;
QTextCodec::ConverterState state;
diff --git a/src/corelib/codecs/qutfcodec_p.h b/src/corelib/codecs/qutfcodec_p.h
index 659a229dae..7405996fba 100644
--- a/src/corelib/codecs/qutfcodec_p.h
+++ b/src/corelib/codecs/qutfcodec_p.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Copyright (C) 2016 Intel Corporation.
+** Copyright (C) 2018 The Qt Company Ltd.
+** Copyright (C) 2018 Intel Corporation.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtCore module of the Qt Toolkit.
diff --git a/src/corelib/doc/snippets/code/src_corelib_tools_qeasingcurve.cpp b/src/corelib/doc/snippets/code/src_corelib_tools_qeasingcurve.cpp
index 97453e2b06..88f1e90713 100644
--- a/src/corelib/doc/snippets/code/src_corelib_tools_qeasingcurve.cpp
+++ b/src/corelib/doc/snippets/code/src_corelib_tools_qeasingcurve.cpp
@@ -48,11 +48,15 @@
**
****************************************************************************/
+//! [typedef]
+qreal myEasingFunction(qreal progress);
+//! [typedef]
+
//! [0]
QEasingCurve easing(QEasingCurve::InOutQuad);
- for (qreal t = 0.0; t < 1.0; t+=0.1)
- qWarning() << "Effective progress" << t << " is
+ for (qreal t = 0.0; t < 1.0; t += 0.1)
+ qWarning() << "Effective progress" << t << "is"
<< easing.valueForProgress(t);
//! [0]
diff --git a/src/corelib/doc/src/resource-system.qdoc b/src/corelib/doc/src/resource-system.qdoc
index e32343bb1b..9b6b613f79 100644
--- a/src/corelib/doc/src/resource-system.qdoc
+++ b/src/corelib/doc/src/resource-system.qdoc
@@ -42,6 +42,7 @@
\l rcc (Qt's resource compiler), and QFile.
\section1 Resource Collection Files (\c{.qrc})
+ \target {Resource Collection Files}
The resources associated with an application are specified in a
\c .qrc file, an XML-based file format that lists files on the
diff --git a/src/corelib/global/qconfig-bootstrapped.h b/src/corelib/global/qconfig-bootstrapped.h
index a8dbb3edcd..506c8513dc 100644
--- a/src/corelib/global/qconfig-bootstrapped.h
+++ b/src/corelib/global/qconfig-bootstrapped.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2018 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtCore module of the Qt Toolkit.
@@ -77,6 +77,7 @@
#define QT_CRYPTOGRAPHICHASH_ONLY_SHA1
#define QT_FEATURE_cxx11_random (QT_HAS_INCLUDE(<random>) ? 1 : -1)
#define QT_NO_DATASTREAM
+#define QT_FEATURE_datestring 1
#define QT_FEATURE_datetimeparser -1
#define QT_FEATURE_etw -1
#define QT_FEATURE_getauxval (QT_HAS_INCLUDE(<sys/auxv.h>) ? 1 : -1)
@@ -115,6 +116,7 @@
#define QT_NO_SYSTEMLOCALE
#define QT_FEATURE_systemsemaphore -1
#define QT_FEATURE_temporaryfile 1
+#define QT_FEATURE_textdate 1
#define QT_FEATURE_thread -1
#define QT_FEATURE_timezone -1
#define QT_FEATURE_topleveldomain -1
diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp
index 422d08f32c..e727f00c8e 100644
--- a/src/corelib/global/qlibraryinfo.cpp
+++ b/src/corelib/global/qlibraryinfo.cpp
@@ -267,7 +267,7 @@ QLibraryInfo::licensedProducts()
\deprecated
This function used to return the installation date for this build of Qt, but now returns a constant date.
*/
-#ifndef QT_NO_DATESTRING
+#if QT_CONFIG(datestring)
#if QT_DEPRECATED_SINCE(5, 5)
QDate
QLibraryInfo::buildDate()
@@ -275,7 +275,7 @@ QLibraryInfo::buildDate()
return QDate::fromString(QString::fromLatin1(qt_configure_installation + 12), Qt::ISODate);
}
#endif
-#endif //QT_NO_DATESTRING
+#endif // datestring
#if defined(Q_CC_INTEL) // must be before GNU, Clang and MSVC because ICC/ICL claim to be them
# ifdef __INTEL_CLANG_COMPILER
diff --git a/src/corelib/global/qlibraryinfo.h b/src/corelib/global/qlibraryinfo.h
index 809813d99d..80fc5bd4fc 100644
--- a/src/corelib/global/qlibraryinfo.h
+++ b/src/corelib/global/qlibraryinfo.h
@@ -56,11 +56,11 @@ public:
static QT_DEPRECATED QString licensedProducts();
#endif
-#ifndef QT_NO_DATESTRING
+#if QT_CONFIG(datestring)
#if QT_DEPRECATED_SINCE(5, 5)
static QT_DEPRECATED QDate buildDate();
#endif // QT_DEPRECATED_SINCE(5, 5)
-#endif //QT_NO_DATESTRING
+#endif // datestring
static const char * build() Q_DECL_NOTHROW;
diff --git a/src/corelib/kernel/qcore_unix_p.h b/src/corelib/kernel/qcore_unix_p.h
index cb98bef347..5a2a29a327 100644
--- a/src/corelib/kernel/qcore_unix_p.h
+++ b/src/corelib/kernel/qcore_unix_p.h
@@ -178,7 +178,7 @@ inline void qt_ignore_sigpipe()
#if defined(Q_PROCESSOR_X86_32) && defined(__GLIBC__)
# if !__GLIBC_PREREQ(2, 22)
-int qt_open64(const char *pathname, int flags, mode_t);
+Q_CORE_EXPORT int qt_open64(const char *pathname, int flags, mode_t);
# undef QT_OPEN
# define QT_OPEN qt_open64
# endif
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp
index 66afa52617..1917f318c6 100644
--- a/src/corelib/kernel/qobject.cpp
+++ b/src/corelib/kernel/qobject.cpp
@@ -3653,13 +3653,17 @@ void QMetaObject::activate(QObject *sender, int signalOffset, int local_signal_i
if (sender->d_func()->isDeclarativeSignalConnected(signal_index)
&& QAbstractDeclarativeData::signalEmitted) {
+ Q_TRACE(QMetaObject_activate_begin_declarative_signal, sender, signal_index);
QAbstractDeclarativeData::signalEmitted(sender->d_func()->declarativeData, sender,
signal_index, argv);
+ Q_TRACE(QMetaObject_activate_end_declarative_signal, sender, signal_index);
}
if (!sender->d_func()->isSignalConnected(signal_index, /*checkDeclarative =*/ false)
&& !qt_signal_spy_callback_set.signal_begin_callback
- && !qt_signal_spy_callback_set.signal_end_callback) {
+ && !qt_signal_spy_callback_set.signal_end_callback
+ && !Q_TRACE_ENABLED(QMetaObject_activate_begin_signal)
+ && !Q_TRACE_ENABLED(QMetaObject_activate_end_signal)) {
// The possible declarative connection is done, and nothing else is connected, so:
return;
}
@@ -3669,6 +3673,7 @@ void QMetaObject::activate(QObject *sender, int signalOffset, int local_signal_i
qt_signal_spy_callback_set.signal_begin_callback(sender, signal_index,
argv ? argv : empty_argv);
}
+ Q_TRACE(QMetaObject_activate_begin_signal, sender, signal_index);
{
QMutexLocker locker(signalSlotLock(sender));
@@ -3699,6 +3704,7 @@ void QMetaObject::activate(QObject *sender, int signalOffset, int local_signal_i
locker.unlock();
if (qt_signal_spy_callback_set.signal_end_callback != 0)
qt_signal_spy_callback_set.signal_end_callback(sender, signal_index);
+ Q_TRACE(QMetaObject_activate_end_signal, sender, signal_index);
return;
}
@@ -3759,7 +3765,9 @@ void QMetaObject::activate(QObject *sender, int signalOffset, int local_signal_i
c->slotObj->ref();
QScopedPointer<QtPrivate::QSlotObjectBase, QSlotObjectBaseDeleter> obj(c->slotObj);
locker.unlock();
+ Q_TRACE(QMetaObject_activate_begin_slot_functor, obj.data());
obj->call(receiver, argv ? argv : empty_argv);
+ Q_TRACE(QMetaObject_activate_end_slot_functor, obj.data());
// Make sure the slot object gets destroyed before the mutex is locked again, as the
// destructor of the slot object might also lock a mutex from the signalSlotLock() mutex pool,
@@ -3775,9 +3783,11 @@ void QMetaObject::activate(QObject *sender, int signalOffset, int local_signal_i
locker.unlock();
if (qt_signal_spy_callback_set.slot_begin_callback != 0)
qt_signal_spy_callback_set.slot_begin_callback(receiver, methodIndex, argv ? argv : empty_argv);
+ Q_TRACE(QMetaObject_activate_begin_slot, receiver, methodIndex);
callFunction(receiver, QMetaObject::InvokeMetaMethod, method_relative, argv ? argv : empty_argv);
+ Q_TRACE(QMetaObject_activate_end_slot, receiver, methodIndex);
if (qt_signal_spy_callback_set.slot_end_callback != 0)
qt_signal_spy_callback_set.slot_end_callback(receiver, methodIndex);
locker.relock();
@@ -3790,9 +3800,11 @@ void QMetaObject::activate(QObject *sender, int signalOffset, int local_signal_i
method,
argv ? argv : empty_argv);
}
+ Q_TRACE(QMetaObject_activate_begin_slot, receiver, method);
metacall(receiver, QMetaObject::InvokeMetaMethod, method, argv ? argv : empty_argv);
+ Q_TRACE(QMetaObject_activate_end_slot, receiver, method);
if (qt_signal_spy_callback_set.slot_end_callback != 0)
qt_signal_spy_callback_set.slot_end_callback(receiver, method);
@@ -3813,7 +3825,7 @@ void QMetaObject::activate(QObject *sender, int signalOffset, int local_signal_i
if (qt_signal_spy_callback_set.signal_end_callback != 0)
qt_signal_spy_callback_set.signal_end_callback(sender, signal_index);
-
+ Q_TRACE(QMetaObject_activate_end_signal, sender, signal_index);
}
/*!
diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp
index 4d1aa911f7..0b4c3f387f 100644
--- a/src/corelib/kernel/qvariant.cpp
+++ b/src/corelib/kernel/qvariant.cpp
@@ -468,7 +468,7 @@ static bool convert(const QVariant::Private *d, int t, void *result, bool *ok)
case QVariant::Double:
*str = QString::number(d->data.d, 'g', QLocale::FloatingPointShortest);
break;
-#if !defined(QT_NO_DATESTRING)
+#if QT_CONFIG(datestring)
case QVariant::Date:
*str = v_cast<QDate>(d)->toString(Qt::ISODate);
break;
@@ -617,7 +617,7 @@ static bool convert(const QVariant::Private *d, int t, void *result, bool *ok)
QDate *dt = static_cast<QDate *>(result);
if (d->type == QVariant::DateTime)
*dt = v_cast<QDateTime>(d)->date();
-#ifndef QT_NO_DATESTRING
+#if QT_CONFIG(datestring)
else if (d->type == QVariant::String)
*dt = QDate::fromString(*v_cast<QString>(d), Qt::ISODate);
#endif
@@ -632,7 +632,7 @@ static bool convert(const QVariant::Private *d, int t, void *result, bool *ok)
case QVariant::DateTime:
*t = v_cast<QDateTime>(d)->time();
break;
-#ifndef QT_NO_DATESTRING
+#if QT_CONFIG(datestring)
case QVariant::String:
*t = QTime::fromString(*v_cast<QString>(d), Qt::ISODate);
break;
@@ -645,7 +645,7 @@ static bool convert(const QVariant::Private *d, int t, void *result, bool *ok)
case QVariant::DateTime: {
QDateTime *dt = static_cast<QDateTime *>(result);
switch (d->type) {
-#ifndef QT_NO_DATESTRING
+#if QT_CONFIG(datestring)
case QVariant::String:
*dt = QDateTime::fromString(*v_cast<QString>(d), Qt::ISODate);
break;
diff --git a/src/corelib/plugin/qelfparser_p.h b/src/corelib/plugin/qelfparser_p.h
index 1d3578255f..cdf055329d 100644
--- a/src/corelib/plugin/qelfparser_p.h
+++ b/src/corelib/plugin/qelfparser_p.h
@@ -84,7 +84,7 @@ public:
int m_endian;
int m_bits;
- int m_stringTableFileOffset;
+ qelfoff_t m_stringTableFileOffset;
template <typename T>
T read(const char *s)
diff --git a/src/corelib/qtcore.tracepoints b/src/corelib/qtcore.tracepoints
index 2e78490ab5..33734a4274 100644
--- a/src/corelib/qtcore.tracepoints
+++ b/src/corelib/qtcore.tracepoints
@@ -23,3 +23,12 @@ QCoreApplication_notify_after_delivery(QObject *receiver, QEvent *event, int typ
QObject_ctor(QObject *object)
QObject_dtor(QObject *object)
+
+QMetaObject_activate_begin_signal(QObject *sender, int signalIndex)
+QMetaObject_activate_end_signal(QObject *sender, int signalIndex)
+QMetaObject_activate_begin_slot(QObject *receiver, int slotIndex)
+QMetaObject_activate_end_slot(QObject *receiver, int slotIndex)
+QMetaObject_activate_begin_slot_functor(void *slotObject)
+QMetaObject_activate_end_slot_functor(void *slotObject)
+QMetaObject_activate_begin_declarative_signal(QObject *sender, int signalIndex)
+QMetaObject_activate_end_declarative_signal(QObject *sender, int signalIndex)
diff --git a/src/corelib/serialization/qdatastream.cpp b/src/corelib/serialization/qdatastream.cpp
index 60467b4824..c81da70e61 100644
--- a/src/corelib/serialization/qdatastream.cpp
+++ b/src/corelib/serialization/qdatastream.cpp
@@ -564,7 +564,7 @@ void QDataStream::setByteOrder(ByteOrder bo)
\value Qt_5_9 Same as Qt_5_6
\value Qt_5_10 Same as Qt_5_6
\value Qt_5_11 Same as Qt_5_6
- \value Qt_5_12 Same as Qt_5_6
+ \value Qt_5_12 Version 18 (Qt 5.12)
\omitvalue Qt_DefaultCompiledVersion
\sa setVersion(), version()
diff --git a/src/corelib/serialization/qxmlstream.cpp b/src/corelib/serialization/qxmlstream.cpp
index f18c4cc8e7..5002848d83 100644
--- a/src/corelib/serialization/qxmlstream.cpp
+++ b/src/corelib/serialization/qxmlstream.cpp
@@ -3956,13 +3956,13 @@ void QXmlStreamWriter::writeCurrentToken(const QXmlStreamReader &reader)
writeEndDocument();
break;
case QXmlStreamReader::StartElement: {
+ writeStartElement(reader.namespaceUri().toString(), reader.name().toString());
QXmlStreamNamespaceDeclarations namespaceDeclarations = reader.namespaceDeclarations();
for (int i = 0; i < namespaceDeclarations.size(); ++i) {
const QXmlStreamNamespaceDeclaration &namespaceDeclaration = namespaceDeclarations.at(i);
writeNamespace(namespaceDeclaration.namespaceUri().toString(),
namespaceDeclaration.prefix().toString());
}
- writeStartElement(reader.namespaceUri().toString(), reader.name().toString());
writeAttributes(reader.attributes());
} break;
case QXmlStreamReader::EndElement:
diff --git a/src/corelib/thread/qfuturewatcher.cpp b/src/corelib/thread/qfuturewatcher.cpp
index 5b68af1fbc..faeb6b3a28 100644
--- a/src/corelib/thread/qfuturewatcher.cpp
+++ b/src/corelib/thread/qfuturewatcher.cpp
@@ -98,7 +98,9 @@ QT_BEGIN_NAMESPACE
/*! \fn template <typename T> QFutureWatcher<T>::QFutureWatcher(QObject *parent)
- Constructs a new QFutureWatcher with the given \a parent.
+ Constructs a new QFutureWatcher with the given \a parent. Until a future is
+ set with setFuture(), the functions isStarted(), isCanceled(), and
+ isFinished() return \c true.
*/
QFutureWatcherBase::QFutureWatcherBase(QObject *parent)
:QObject(*new QFutureWatcherBasePrivate, parent)
@@ -241,7 +243,7 @@ QString QFutureWatcherBase::progressText() const
/*! \fn template <typename T> bool QFutureWatcher<T>::isStarted() const
Returns \c true if the asynchronous computation represented by the future()
- has been started; otherwise returns \c false.
+ has been started, or if no future has been set; otherwise returns \c false.
*/
bool QFutureWatcherBase::isStarted() const
{
@@ -272,7 +274,7 @@ bool QFutureWatcherBase::isRunning() const
/*! \fn template <typename T> bool QFutureWatcher<T>::isCanceled() const
Returns \c true if the asynchronous computation has been canceled with the
- cancel() function; otherwise returns \c false.
+ cancel() function, or if no future has been set; otherwise returns \c false.
Be aware that the computation may still be running even though this
function returns \c true. See cancel() for more details.
diff --git a/src/corelib/thread/qthread.cpp b/src/corelib/thread/qthread.cpp
index 5df0508829..d2d6435004 100644
--- a/src/corelib/thread/qthread.cpp
+++ b/src/corelib/thread/qthread.cpp
@@ -879,6 +879,7 @@ QThreadPrivate::QThreadPrivate(QThreadData *d) : data(d ? d : new QThreadData)
QThreadPrivate::~QThreadPrivate()
{
+ data->thread = nullptr; // prevent QThreadData from deleting the QThreadPrivate (again).
delete data;
}
diff --git a/src/corelib/thread/qthread_win.cpp b/src/corelib/thread/qthread_win.cpp
index caf51722cd..eebaf90d9b 100644
--- a/src/corelib/thread/qthread_win.cpp
+++ b/src/corelib/thread/qthread_win.cpp
@@ -511,7 +511,7 @@ void QThread::start(Priority priority)
#endif // Q_OS_WINRT
if (!d->handle) {
- qErrnoWarning(errno, "QThread::start: Failed to create thread");
+ qErrnoWarning("QThread::start: Failed to create thread");
d->running = false;
d->finished = true;
return;
diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp
index 58755c94bb..816bd974eb 100644
--- a/src/corelib/tools/qdatetime.cpp
+++ b/src/corelib/tools/qdatetime.cpp
@@ -171,7 +171,7 @@ static ParsedDate getDateFromJulianDay(qint64 julianDay)
static const char monthDays[] = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
-#ifndef QT_NO_TEXTDATE
+#if QT_CONFIG(textdate)
static const char qt_shortMonthNames[][4] = {
"Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
@@ -200,9 +200,9 @@ static int fromShortMonthName(const QStringRef &monthName)
}
return -1;
}
-#endif // QT_NO_TEXTDATE
+#endif // textdate
-#ifndef QT_NO_DATESTRING
+#if QT_CONFIG(datestring)
struct ParsedRfcDateTime {
QDate date;
QTime time;
@@ -241,7 +241,7 @@ static ParsedRfcDateTime rfcDateImpl(const QString &s)
return result;
}
-#endif // QT_NO_DATESTRING
+#endif // datestring
// Return offset in [+-]HH:mm format
static QString toOffsetString(Qt::DateFormat format, int offset)
@@ -254,6 +254,7 @@ static QString toOffsetString(Qt::DateFormat format, int offset)
(qAbs(offset) / 60) % 60);
}
+#if QT_CONFIG(datestring)
// Parse offset in [+-]HH[[:]mm] format
static int fromOffsetString(const QStringRef &offsetString, bool *valid) Q_DECL_NOTHROW
{
@@ -298,6 +299,7 @@ static int fromOffsetString(const QStringRef &offsetString, bool *valid) Q_DECL_
*valid = true;
return sign * ((hour * 60) + minute) * 60;
}
+#endif // datestring
/*****************************************************************************
QDate member functions
@@ -324,20 +326,19 @@ static int fromOffsetString(const QStringRef &offsetString, bool *valid) Q_DECL_
\brief The QDate class provides date functions.
- A QDate object contains a calendar date, i.e. year, month, and day
- numbers, in the Gregorian calendar. It can read the current date
- from the system clock. It provides functions for comparing dates,
- and for manipulating dates. For example, it is possible to add
- and subtract days, months, and years to dates.
+ A QDate object encodes a calendar date, i.e. year, month, and day numbers,
+ in the proleptic Gregorian calendar by default. It can read the current date
+ from the system clock. It provides functions for comparing dates, and for
+ manipulating dates. For example, it is possible to add and subtract days,
+ months, and years to dates.
- A QDate object is typically created by giving the year,
- month, and day numbers explicitly. Note that QDate interprets two
- digit years as is, i.e., years 0 - 99. A QDate can also be
- constructed with the static function currentDate(), which creates
- a QDate object containing the system clock's date. An explicit
- date can also be set using setDate(). The fromString() function
- returns a QDate given a string and a date format which is used to
- interpret the date within the string.
+ A QDate object is typically created by giving the year, month, and day
+ numbers explicitly. Note that QDate interprets two digit years as presented,
+ i.e., as years 0 through 99, without adding any offset. A QDate can also be
+ constructed with the static function currentDate(), which creates a QDate
+ object containing the system clock's date. An explicit date can also be set
+ using setDate(). The fromString() function returns a QDate given a string
+ and a date format which is used to interpret the date within the string.
The year(), month(), and day() functions provide access to the
year, month, and day numbers. Also, dayOfWeek() and dayOfYear()
@@ -361,9 +362,9 @@ static int fromOffsetString(const QStringRef &offsetString, bool *valid) Q_DECL_
\section2 No Year 0
- There is no year 0. Dates in that year are considered invalid. The
- year -1 is the year "1 before Christ" or "1 before current era."
- The day before 1 January 1 CE is 31 December 1 BCE.
+ There is no year 0. Dates in that year are considered invalid. The year -1
+ is the year "1 before Christ" or "1 before current era." The day before 1
+ January 1 CE, QDate(1, 1, 1), is 31 December 1 BCE, QDate(-1, 12, 31).
\section2 Range of Valid Dates
@@ -613,7 +614,7 @@ int QDate::weekNumber(int *yearNumber) const
return week;
}
-#if QT_DEPRECATED_SINCE(5, 11) && !defined(QT_NO_TEXTDATE)
+#if QT_DEPRECATED_SINCE(5, 11) && QT_CONFIG(textdate)
/*!
\since 4.5
\deprecated
@@ -775,11 +776,11 @@ QString QDate::longDayName(int weekday, MonthNameType type)
}
return QString();
}
-#endif // QT_NO_TEXTDATE && deprecated
+#endif // textdate && deprecated
-#ifndef QT_NO_DATESTRING
+#if QT_CONFIG(datestring)
-#ifndef QT_NO_TEXTDATE
+#if QT_CONFIG(textdate)
static QString toStringTextDate(QDate date)
{
const ParsedDate pd = getDateFromJulianDay(date.toJulianDay());
@@ -789,7 +790,7 @@ static QString toStringTextDate(QDate date)
+ QString::number(pd.day) + sp
+ QString::number(pd.year);
}
-#endif // QT_NO_TEXTDATE
+#endif // textdate
static QString toStringIsoDate(qint64 jd)
{
@@ -865,7 +866,7 @@ QString QDate::toString(Qt::DateFormat format) const
case Qt::RFC2822Date:
return QLocale::c().toString(*this, QStringViewLiteral("dd MMM yyyy"));
default:
-#ifndef QT_NO_TEXTDATE
+#if QT_CONFIG(textdate)
case Qt::TextDate:
return toStringTextDate(*this);
#endif
@@ -939,7 +940,7 @@ QString QDate::toString(const QString &format) const
}
#endif
-#endif //QT_NO_DATESTRING
+#endif // datestring
/*!
\fn bool QDate::setYMD(int y, int m, int d)
@@ -1201,7 +1202,7 @@ qint64 QDate::daysTo(const QDate &d) const
\sa QTime::currentTime(), QDateTime::currentDateTime()
*/
-#ifndef QT_NO_DATESTRING
+#if QT_CONFIG(datestring)
/*!
\fn QDate QDate::fromString(const QString &string, Qt::DateFormat format)
@@ -1234,7 +1235,7 @@ QDate QDate::fromString(const QString& string, Qt::DateFormat format)
case Qt::RFC2822Date:
return rfcDateImpl(string).date;
default:
-#ifndef QT_NO_TEXTDATE
+#if QT_CONFIG(textdate)
case Qt::TextDate: {
QVector<QStringRef> parts = string.splitRef(QLatin1Char(' '), QString::SkipEmptyParts);
@@ -1255,7 +1256,7 @@ QDate QDate::fromString(const QString& string, Qt::DateFormat format)
return QDate(year, month, parts.at(2).toInt());
}
-#endif // QT_NO_TEXTDATE
+#endif // textdate
case Qt::ISODate: {
// Semi-strict parsing, must be long enough and have non-numeric separators
if (string.size() < 10 || string.at(4).isDigit() || string.at(7).isDigit()
@@ -1350,7 +1351,7 @@ QDate QDate::fromString(const QString &string, const QString &format)
#endif
return date;
}
-#endif // QT_NO_DATESTRING
+#endif // datestring
/*!
\overload
@@ -1416,11 +1417,12 @@ bool QDate::isLeapYear(int y)
\brief The QTime class provides clock time functions.
- A QTime object contains a clock time, i.e. the number of hours,
- minutes, seconds, and milliseconds since midnight. It can read the
- current time from the system clock and measure a span of elapsed
- time. It provides functions for comparing times and for
- manipulating a time by adding a number of milliseconds.
+ A QTime object contains a clock time, which it can express as the
+ numbers of hours, minutes, seconds, and milliseconds since
+ midnight. It can read the current time from the system clock and
+ measure a span of elapsed time. It provides functions for
+ comparing times and for manipulating a time by adding a number of
+ milliseconds.
QTime uses the 24-hour clock format; it has no concept of AM/PM.
Unlike QDateTime, QTime knows nothing about time zones or
@@ -1438,15 +1440,15 @@ bool QDate::isLeapYear(int y)
of the time. The same information is provided in textual format by
the toString() function.
- QTime provides a full set of operators to compare two QTime
- objects. QTime A is considered smaller than QTime B if A is
- earlier than B.
-
The addSecs() and addMSecs() functions provide the time a given
number of seconds or milliseconds later than a given time.
Correspondingly, the number of seconds or milliseconds
between two times can be found using secsTo() or msecsTo().
+ QTime provides a full set of operators to compare two QTime
+ objects; an earlier time is considered smaller than a later one;
+ if A.msecsTo(B) is positive, then A < B.
+
QTime can be used to measure a span of elapsed time using the
start(), restart(), and elapsed() functions.
@@ -1566,7 +1568,7 @@ int QTime::msec() const
return ds() % 1000;
}
-#ifndef QT_NO_DATESTRING
+#if QT_CONFIG(datestring)
/*!
\overload
@@ -1702,7 +1704,7 @@ QString QTime::toString(const QString &format) const
}
#endif
-#endif //QT_NO_DATESTRING
+#endif // datestring
/*!
Sets the time to hour \a h, minute \a m, seconds \a s and
@@ -1887,7 +1889,7 @@ int QTime::msecsTo(const QTime &t) const
operating system; not all systems provide 1-millisecond accuracy.
*/
-#ifndef QT_NO_DATESTRING
+#if QT_CONFIG(datestring)
static QTime fromIsoTimeString(const QStringRef &string, Qt::DateFormat format, bool *isMidnight24)
{
@@ -2069,7 +2071,7 @@ QTime QTime::fromString(const QString &string, const QString &format)
return time;
}
-#endif // QT_NO_DATESTRING
+#endif // datestring
/*!
@@ -3007,8 +3009,8 @@ inline qint64 QDateTimePrivate::zoneMSecsToEpochMSecs(qint64 zoneMSecs, const QT
\brief The QDateTime class provides date and time functions.
- A QDateTime object contains a calendar date and a clock time (a
- "datetime"). It is a combination of the QDate and QTime classes.
+ A QDateTime object encodes a calendar date and a clock time (a
+ "datetime"). It combines features of the QDate and QTime classes.
It can read the current datetime from the system clock. It
provides functions for comparing datetimes and for manipulating a
datetime by adding a number of seconds, days, months, or years.
@@ -3773,7 +3775,7 @@ void QDateTime::setTime_t(uint secsSince1Jan1970UTC)
}
#endif
-#ifndef QT_NO_DATESTRING
+#if QT_CONFIG(datestring)
/*!
\fn QString QDateTime::toString(Qt::DateFormat format) const
@@ -3848,7 +3850,7 @@ QString QDateTime::toString(Qt::DateFormat format) const
return buf;
}
default:
-#ifndef QT_NO_TEXTDATE
+#if QT_CONFIG(textdate)
case Qt::TextDate: {
const QPair<QDate, QTime> p = getDateTime(d);
buf = p.first.toString(Qt::TextDate);
@@ -3993,7 +3995,7 @@ QString QDateTime::toString(const QString &format) const
}
#endif
-#endif //QT_NO_DATESTRING
+#endif // datestring
static inline void massageAdjustedDateTime(const QDateTimeData &d, QDate *date, QTime *time)
{
@@ -4722,7 +4724,7 @@ int QDateTime::utcOffset() const
}
#endif // QT_DEPRECATED_SINCE
-#ifndef QT_NO_DATESTRING
+#if QT_CONFIG(datestring)
/*!
\fn QDateTime QDateTime::fromString(const QString &string, Qt::DateFormat format)
@@ -4827,7 +4829,7 @@ QDateTime QDateTime::fromString(const QString& string, Qt::DateFormat format)
date = date.addDays(1);
return QDateTime(date, time, spec, offset);
}
-#if !defined(QT_NO_TEXTDATE)
+#if QT_CONFIG(textdate)
case Qt::TextDate: {
QVector<QStringRef> parts = string.splitRef(QLatin1Char(' '), QString::SkipEmptyParts);
@@ -4936,7 +4938,7 @@ QDateTime QDateTime::fromString(const QString& string, Qt::DateFormat format)
return QDateTime(date, time, Qt::UTC);
}
}
-#endif //QT_NO_TEXTDATE
+#endif // textdate
}
return QDateTime();
@@ -5071,7 +5073,7 @@ QDateTime QDateTime::fromString(const QString &string, const QString &format)
return QDateTime();
}
-#endif // QT_NO_DATESTRING
+#endif // datestring
/*!
\fn QDateTime QDateTime::toLocalTime() const
@@ -5330,7 +5332,7 @@ QDataStream &operator>>(QDataStream &in, QDateTime &dateTime)
Date / Time Debug Streams
*****************************************************************************/
-#if !defined(QT_NO_DEBUG_STREAM) && !defined(QT_NO_DATESTRING)
+#if !defined(QT_NO_DEBUG_STREAM) && QT_CONFIG(datestring)
QDebug operator<<(QDebug dbg, const QDate &date)
{
QDebugStateSaver saver(dbg);
@@ -5382,7 +5384,7 @@ QDebug operator<<(QDebug dbg, const QDateTime &date)
}
return dbg.nospace() << ')';
}
-#endif
+#endif // debug_stream && datestring
/*! \fn uint qHash(const QDateTime &key, uint seed = 0)
\relates QHash
diff --git a/src/corelib/tools/qdatetime.h b/src/corelib/tools/qdatetime.h
index 5a7b75db62..43271b34ed 100644
--- a/src/corelib/tools/qdatetime.h
+++ b/src/corelib/tools/qdatetime.h
@@ -81,7 +81,7 @@ public:
int daysInYear() const;
int weekNumber(int *yearNum = nullptr) const;
-#if QT_DEPRECATED_SINCE(5, 10) && !defined QT_NO_TEXTDATE
+#if QT_DEPRECATED_SINCE(5, 10) && QT_CONFIG(textdate)
QT_DEPRECATED_X("Use QLocale::monthName or QLocale::standaloneMonthName")
static QString shortMonthName(int month, MonthNameType type = DateFormat);
QT_DEPRECATED_X("Use QLocale::dayName or QLocale::standaloneDayName")
@@ -90,8 +90,8 @@ public:
static QString longMonthName(int month, MonthNameType type = DateFormat);
QT_DEPRECATED_X("Use QLocale::dayName or QLocale::standaloneDayName")
static QString longDayName(int weekday, MonthNameType type = DateFormat);
-#endif // QT_NO_TEXTDATE && deprecated
-#ifndef QT_NO_DATESTRING
+#endif // textdate && deprecated
+#if QT_CONFIG(datestring)
QString toString(Qt::DateFormat f = Qt::TextDate) const;
#if QT_STRINGVIEW_LEVEL < 2
QString toString(const QString &format) const;
@@ -123,7 +123,7 @@ QT_DEPRECATED inline bool setYMD(int y, int m, int d)
Q_DECL_CONSTEXPR bool operator>=(const QDate &other) const { return jd >= other.jd; }
static QDate currentDate();
-#ifndef QT_NO_DATESTRING
+#if QT_CONFIG(datestring)
static QDate fromString(const QString &s, Qt::DateFormat f = Qt::TextDate);
static QDate fromString(const QString &s, const QString &format);
#endif
@@ -167,7 +167,7 @@ public:
int minute() const;
int second() const;
int msec() const;
-#ifndef QT_NO_DATESTRING
+#if QT_CONFIG(datestring)
QString toString(Qt::DateFormat f = Qt::TextDate) const;
#if QT_STRINGVIEW_LEVEL < 2
QString toString(const QString &format) const;
@@ -192,7 +192,7 @@ public:
Q_DECL_CONSTEXPR inline int msecsSinceStartOfDay() const { return mds == NullTime ? 0 : mds; }
static QTime currentTime();
-#ifndef QT_NO_DATESTRING
+#if QT_CONFIG(datestring)
static QTime fromString(const QString &s, Qt::DateFormat f = Qt::TextDate);
static QTime fromString(const QString &s, const QString &format);
#endif
@@ -303,7 +303,7 @@ public:
void setMSecsSinceEpoch(qint64 msecs);
void setSecsSinceEpoch(qint64 secs);
-#ifndef QT_NO_DATESTRING
+#if QT_CONFIG(datestring)
QString toString(Qt::DateFormat f = Qt::TextDate) const;
#if QT_STRINGVIEW_LEVEL < 2
QString toString(const QString &format) const;
@@ -342,7 +342,7 @@ public:
static QDateTime currentDateTime();
static QDateTime currentDateTimeUtc();
-#ifndef QT_NO_DATESTRING
+#if QT_CONFIG(datestring)
static QDateTime fromString(const QString &s, Qt::DateFormat f = Qt::TextDate);
static QDateTime fromString(const QString &s, const QString &format);
#endif
@@ -386,7 +386,7 @@ private:
friend Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QDateTime &);
#endif
-#if !defined(QT_NO_DEBUG_STREAM) && !defined(QT_NO_DATESTRING)
+#if !defined(QT_NO_DEBUG_STREAM) && QT_CONFIG(datestring)
friend Q_CORE_EXPORT QDebug operator<<(QDebug, const QDateTime &);
#endif
};
@@ -401,7 +401,7 @@ Q_CORE_EXPORT QDataStream &operator<<(QDataStream &, const QDateTime &);
Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QDateTime &);
#endif // QT_NO_DATASTREAM
-#if !defined(QT_NO_DEBUG_STREAM) && !defined(QT_NO_DATESTRING)
+#if !defined(QT_NO_DEBUG_STREAM) && QT_CONFIG(datestring)
Q_CORE_EXPORT QDebug operator<<(QDebug, const QDate &);
Q_CORE_EXPORT QDebug operator<<(QDebug, const QTime &);
Q_CORE_EXPORT QDebug operator<<(QDebug, const QDateTime &);
diff --git a/src/corelib/tools/qdatetimeparser.cpp b/src/corelib/tools/qdatetimeparser.cpp
index d03518e70d..18c44c3a17 100644
--- a/src/corelib/tools/qdatetimeparser.cpp
+++ b/src/corelib/tools/qdatetimeparser.cpp
@@ -77,7 +77,7 @@ QDateTimeParser::~QDateTimeParser()
int QDateTimeParser::getDigit(const QDateTime &t, int index) const
{
if (index < 0 || index >= sectionNodes.size()) {
-#ifndef QT_NO_DATESTRING
+#if QT_CONFIG(datestring)
qWarning("QDateTimeParser::getDigit() Internal error (%s %d)",
qPrintable(t.toString()), index);
#else
@@ -103,7 +103,7 @@ int QDateTimeParser::getDigit(const QDateTime &t, int index) const
default: break;
}
-#ifndef QT_NO_DATESTRING
+#if QT_CONFIG(datestring)
qWarning("QDateTimeParser::getDigit() Internal error 2 (%s %d)",
qPrintable(t.toString()), index);
#else
@@ -127,7 +127,7 @@ int QDateTimeParser::getDigit(const QDateTime &t, int index) const
bool QDateTimeParser::setDigit(QDateTime &v, int index, int newVal) const
{
if (index < 0 || index >= sectionNodes.size()) {
-#ifndef QT_NO_DATESTRING
+#if QT_CONFIG(datestring)
qWarning("QDateTimeParser::setDigit() Internal error (%s %d %d)",
qPrintable(v.toString()), index, newVal);
#else
@@ -612,7 +612,7 @@ int QDateTimeParser::sectionSize(int sectionIndex) const
int QDateTimeParser::sectionMaxSize(Section s, int count) const
{
-#ifndef QT_NO_TEXTDATE
+#if QT_CONFIG(textdate)
int mcount = 12;
#endif
@@ -636,14 +636,14 @@ int QDateTimeParser::sectionMaxSize(Section s, int count) const
case DaySection: return 2;
case DayOfWeekSectionShort:
case DayOfWeekSectionLong:
-#ifdef QT_NO_TEXTDATE
+#if !QT_CONFIG(textdate)
return 2;
#else
mcount = 7;
Q_FALLTHROUGH();
#endif
case MonthSection:
-#ifdef QT_NO_TEXTDATE
+#if !QT_CONFIG(textdate)
return 2;
#else
if (count <= 2)
@@ -725,7 +725,7 @@ QString QDateTimeParser::sectionText(int sectionIndex) const
}
-#ifndef QT_NO_DATESTRING
+#if QT_CONFIG(datestring)
QDateTimeParser::ParsedSection
QDateTimeParser::parseSection(const QDateTime &currentValue, int sectionIndex,
@@ -1727,7 +1727,7 @@ QDateTimeParser::AmPmFinder QDateTimeParser::findAmPm(QString &str, int sectionI
return PossibleBoth;
return (!broken[amindex] ? PossibleAM : PossiblePM);
}
-#endif // QT_NO_DATESTRING
+#endif // datestring
/*!
\internal
@@ -1958,7 +1958,7 @@ QString QDateTimeParser::stateName(State s) const
}
}
-#ifndef QT_NO_DATESTRING
+#if QT_CONFIG(datestring)
bool QDateTimeParser::fromString(const QString &t, QDate *date, QTime *time) const
{
QDateTime val(QDate(1900, 1, 1), QDATETIMEEDIT_TIME_MIN);
@@ -1983,7 +1983,7 @@ bool QDateTimeParser::fromString(const QString &t, QDate *date, QTime *time) con
}
return true;
}
-#endif // QT_NO_DATESTRING
+#endif // datestring
QDateTime QDateTimeParser::getMinimum() const
{
diff --git a/src/corelib/tools/qdatetimeparser_p.h b/src/corelib/tools/qdatetimeparser_p.h
index c9e63fe307..f7e6e351fe 100644
--- a/src/corelib/tools/qdatetimeparser_p.h
+++ b/src/corelib/tools/qdatetimeparser_p.h
@@ -180,7 +180,7 @@ public:
LowerCase
};
-#ifndef QT_NO_DATESTRING
+#if QT_CONFIG(datestring)
StateNode parse(QString input, int position, const QDateTime &defaultValue, bool fixup) const;
bool fromString(const QString &text, QDate *date, QTime *time) const;
#endif
@@ -202,7 +202,7 @@ public:
private:
int sectionMaxSize(Section s, int count) const;
QString sectionText(const QString &text, int sectionIndex, int index) const;
-#ifndef QT_NO_DATESTRING
+#if QT_CONFIG(datestring)
StateNode scanString(const QDateTime &defaultValue,
bool fixup, QString *input) const;
struct ParsedSection {
@@ -237,7 +237,7 @@ private:
PossibleBoth = 4
};
AmPmFinder findAmPm(QString &str, int index, int *used = 0) const;
-#endif // QT_NO_DATESTRING
+#endif // datestring
bool potentialValue(const QStringRef &str, int min, int max, int index,
const QDateTime &currentValue, int insert) const;
diff --git a/src/corelib/tools/qeasingcurve.cpp b/src/corelib/tools/qeasingcurve.cpp
index 235ca625c1..f82048db0f 100644
--- a/src/corelib/tools/qeasingcurve.cpp
+++ b/src/corelib/tools/qeasingcurve.cpp
@@ -292,7 +292,7 @@
This is a typedef for a pointer to a function with the following
signature:
- \snippet code/src_corelib_tools_qeasingcurve.cpp 0
+ \snippet code/src_corelib_tools_qeasingcurve.cpp typedef
*/
#include "qeasingcurve.h"
diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp
index 0081b5d566..38bd195fba 100644
--- a/src/corelib/tools/qlocale.cpp
+++ b/src/corelib/tools/qlocale.cpp
@@ -2079,7 +2079,7 @@ QString QLocale::dateTimeFormat(FormatType format) const
\sa timeFormat(), toDate(), toDateTime(), QTime::fromString()
*/
-#ifndef QT_NO_DATESTRING
+#if QT_CONFIG(datestring)
QTime QLocale::toTime(const QString &string, FormatType format) const
{
return toTime(string, timeFormat(format));
@@ -2097,7 +2097,7 @@ QTime QLocale::toTime(const QString &string, FormatType format) const
\sa dateFormat(), toTime(), toDateTime(), QDate::fromString()
*/
-#ifndef QT_NO_DATESTRING
+#if QT_CONFIG(datestring)
QDate QLocale::toDate(const QString &string, FormatType format) const
{
return toDate(string, dateFormat(format));
@@ -2116,7 +2116,7 @@ QDate QLocale::toDate(const QString &string, FormatType format) const
\sa dateTimeFormat(), toTime(), toDate(), QDateTime::fromString()
*/
-#ifndef QT_NO_DATESTRING
+#if QT_CONFIG(datestring)
QDateTime QLocale::toDateTime(const QString &string, FormatType format) const
{
return toDateTime(string, dateTimeFormat(format));
@@ -2134,7 +2134,7 @@ QDateTime QLocale::toDateTime(const QString &string, FormatType format) const
\sa timeFormat(), toDate(), toDateTime(), QTime::fromString()
*/
-#ifndef QT_NO_DATESTRING
+#if QT_CONFIG(datestring)
QTime QLocale::toTime(const QString &string, const QString &format) const
{
QTime time;
@@ -2165,7 +2165,7 @@ QTime QLocale::toTime(const QString &string, const QString &format) const
\sa dateFormat(), toTime(), toDateTime(), QDate::fromString()
*/
-#ifndef QT_NO_DATESTRING
+#if QT_CONFIG(datestring)
QDate QLocale::toDate(const QString &string, const QString &format) const
{
QDate date;
@@ -2196,7 +2196,7 @@ QDate QLocale::toDate(const QString &string, const QString &format) const
\sa dateTimeFormat(), toTime(), toDate(), QDateTime::fromString()
*/
-#ifndef QT_NO_DATESTRING
+#if QT_CONFIG(datestring)
QDateTime QLocale::toDateTime(const QString &string, const QString &format) const
{
#if QT_CONFIG(datetimeparser)
diff --git a/src/corelib/tools/qlocale.h b/src/corelib/tools/qlocale.h
index 2c7229d28b..af0eb2929e 100644
--- a/src/corelib/tools/qlocale.h
+++ b/src/corelib/tools/qlocale.h
@@ -1009,7 +1009,7 @@ public:
QString dateFormat(FormatType format = LongFormat) const;
QString timeFormat(FormatType format = LongFormat) const;
QString dateTimeFormat(FormatType format = LongFormat) const;
-#ifndef QT_NO_DATESTRING
+#if QT_CONFIG(datestring)
QDate toDate(const QString &string, FormatType = LongFormat) const;
QTime toTime(const QString &string, FormatType = LongFormat) const;
QDateTime toDateTime(const QString &string, FormatType format = LongFormat) const;