diff options
author | Liang Qi <liang.qi@theqtcompany.com> | 2016-02-11 08:24:34 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@theqtcompany.com> | 2016-02-11 08:25:04 +0100 |
commit | d456f87ece0323982b7601047712545ab95426ad (patch) | |
tree | 46b90468b01144615f280620d73763fc189d25ac /src/corelib | |
parent | cc2938b5b6aa07210b04bd48ad8a2830701a06e5 (diff) | |
parent | 4fc070a4192d5b914b6f814a8dcab3f552d9abac (diff) |
Merge remote-tracking branch 'origin/5.6' into dev
Conflicts:
src/corelib/io/qfilesystemwatcher_win.cpp
src/corelib/plugin/plugin.pri
src/plugins/platforms/cocoa/qcocoaaccessibility.mm
tests/auto/corelib/tools/qlocale/tst_qlocale.cpp
Change-Id: Id6824631252609a75eff8b68792e4d10095c8fc1
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/codecs/qicucodec.cpp | 1 | ||||
-rw-r--r-- | src/corelib/global/qlibraryinfo.cpp | 20 | ||||
-rw-r--r-- | src/corelib/io/qfilesystementry.cpp | 16 | ||||
-rw-r--r-- | src/corelib/io/qfilesystemwatcher_win.cpp | 2 | ||||
-rw-r--r-- | src/corelib/itemmodels/qstringlistmodel.cpp | 4 | ||||
-rw-r--r-- | src/corelib/kernel/qobject.cpp | 2 | ||||
-rw-r--r-- | src/corelib/plugin/plugin.pri | 2 | ||||
-rw-r--r-- | src/corelib/plugin/qlibrary_unix.cpp | 2 | ||||
-rw-r--r-- | src/corelib/tools/qdatetimeparser.cpp | 107 | ||||
-rw-r--r-- | src/corelib/tools/qdatetimeparser_p.h | 40 | ||||
-rw-r--r-- | src/corelib/tools/qhash.cpp | 2 | ||||
-rw-r--r-- | src/corelib/tools/qlocale_unix.cpp | 2 | ||||
-rw-r--r-- | src/corelib/tools/qsharedpointer.cpp | 4 |
13 files changed, 98 insertions, 106 deletions
diff --git a/src/corelib/codecs/qicucodec.cpp b/src/corelib/codecs/qicucodec.cpp index 17ce045aaa..aa2095d9da 100644 --- a/src/corelib/codecs/qicucodec.cpp +++ b/src/corelib/codecs/qicucodec.cpp @@ -423,6 +423,7 @@ QList<QByteArray> QIcuCodec::availableCodecs() QList<int> QIcuCodec::availableMibs() { QList<int> mibs; + mibs.reserve(mibToNameSize + 1); for (int i = 0; i < mibToNameSize; ++i) mibs += mibToName[i].mib; diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp index 7d558cbf81..c962f1b4b7 100644 --- a/src/corelib/global/qlibraryinfo.cpp +++ b/src/corelib/global/qlibraryinfo.cpp @@ -53,7 +53,7 @@ QT_END_NAMESPACE # include "qcoreapplication.h" #endif -#ifdef Q_OS_MAC +#ifdef Q_OS_DARWIN # include "private/qcore_mac_p.h" #endif @@ -171,7 +171,7 @@ QSettings *QLibraryInfoPrivate::findConfiguration() if (QFile::exists(qtconfig)) return new QSettings(qtconfig, QSettings::IniFormat); #else -#ifdef Q_OS_MAC +#ifdef Q_OS_DARWIN CFBundleRef bundleRef = CFBundleGetMainBundle(); if (bundleRef) { QCFType<CFURLRef> urlRef = CFBundleCopyResourceURL(bundleRef, @@ -409,12 +409,11 @@ static const struct { /*! Returns the location specified by \a loc. - */ QString QLibraryInfo::location(LibraryLocation loc) { -#ifdef QT_BUILD_QMAKE +#ifdef QT_BUILD_QMAKE // ends inside rawLocation ! QString ret = rawLocation(loc, FinalPaths); // Automatically prepend the sysroot to target paths @@ -433,7 +432,7 @@ QLibraryInfo::location(LibraryLocation loc) QString QLibraryInfo::rawLocation(LibraryLocation loc, PathGroup group) { -#endif +#endif // QT_BUILD_QMAKE, started inside location ! QString ret; #ifdef QT_BUILD_QMAKE // Logic for choosing the right data source: if EffectivePaths are requested @@ -549,25 +548,26 @@ QLibraryInfo::rawLocation(LibraryLocation loc, PathGroup group) } else { // we make any other path absolute to the prefix directory baseDir = rawLocation(PrefixPath, group); + } #else if (loc == PrefixPath) { if (QCoreApplication::instance()) { -#ifdef Q_OS_MAC +#ifdef Q_OS_DARWIN CFBundleRef bundleRef = CFBundleGetMainBundle(); if (bundleRef) { QCFType<CFURLRef> urlRef = CFBundleCopyBundleURL(bundleRef); if (urlRef) { QCFString path = CFURLCopyFileSystemPath(urlRef, kCFURLPOSIXPathStyle); -#ifdef Q_OS_MACX +#ifdef Q_OS_OSX QString bundleContentsDir = QString(path) + QLatin1String("/Contents/"); if (QDir(bundleContentsDir).exists()) return QDir::cleanPath(bundleContentsDir + ret); #else return QDir::cleanPath(QString(path) + QLatin1Char('/') + ret); // iOS -#endif +#endif // Q_OS_OSX } } -#endif +#endif // Q_OS_DARWIN // We make the prefix path absolute to the executable's directory. baseDir = QCoreApplication::applicationDirPath(); } else { @@ -576,8 +576,8 @@ QLibraryInfo::rawLocation(LibraryLocation loc, PathGroup group) } else { // we make any other path absolute to the prefix directory baseDir = location(PrefixPath); -#endif } +#endif // QT_BUILD_QMAKE ret = QDir::cleanPath(baseDir + QLatin1Char('/') + ret); } return ret; diff --git a/src/corelib/io/qfilesystementry.cpp b/src/corelib/io/qfilesystementry.cpp index 21c6fd89a9..2e92f8fbba 100644 --- a/src/corelib/io/qfilesystementry.cpp +++ b/src/corelib/io/qfilesystementry.cpp @@ -266,17 +266,21 @@ QString QFileSystemEntry::completeSuffix() const bool QFileSystemEntry::isRelative() const { resolveFilePath(); - return (m_filePath.isEmpty() || (!m_filePath.isEmpty() && (m_filePath.at(0).unicode() != '/') - && (!(m_filePath.length() >= 2 && m_filePath.at(1).unicode() == ':')))); + return (m_filePath.isEmpty() + || (m_filePath.at(0).unicode() != '/' + && !(m_filePath.length() >= 2 && m_filePath.at(1).unicode() == ':'))); } bool QFileSystemEntry::isAbsolute() const { resolveFilePath(); - return (!m_filePath.isEmpty() && ((m_filePath.length() >= 3 - && (m_filePath.at(0).isLetter() && m_filePath.at(1).unicode() == ':' && m_filePath.at(2).unicode() == '/')) - || (m_filePath.length() >= 2 && (m_filePath.at(0) == QLatin1Char('/') && m_filePath.at(1) == QLatin1Char('/'))) - )); + return ((m_filePath.length() >= 3 + && m_filePath.at(0).isLetter() + && m_filePath.at(1).unicode() == ':' + && m_filePath.at(2).unicode() == '/') + || (m_filePath.length() >= 2 + && m_filePath.at(0) == QLatin1Char('/') + && m_filePath.at(1) == QLatin1Char('/'))); } #else bool QFileSystemEntry::isRelative() const diff --git a/src/corelib/io/qfilesystemwatcher_win.cpp b/src/corelib/io/qfilesystemwatcher_win.cpp index 5edabe50bc..e8b49db9f3 100644 --- a/src/corelib/io/qfilesystemwatcher_win.cpp +++ b/src/corelib/io/qfilesystemwatcher_win.cpp @@ -171,7 +171,7 @@ QStringList QWindowsFileSystemWatcherEngine::addPaths(const QStringList &paths, // now look for a thread to insert bool found = false; for (QWindowsFileSystemWatcherEngineThread *thread : qAsConst(threads)) { - QMutexLocker(&(thread->mutex)); + QMutexLocker locker(&(thread->mutex)); if (thread->handles.count() < MAXIMUM_WAIT_OBJECTS) { DEBUG() << "Added handle" << handle.handle << "for" << absolutePath << "to watch" << fileInfo.absoluteFilePath() << "to existing thread " << thread; diff --git a/src/corelib/itemmodels/qstringlistmodel.cpp b/src/corelib/itemmodels/qstringlistmodel.cpp index e28348474c..61323ad9c7 100644 --- a/src/corelib/itemmodels/qstringlistmodel.cpp +++ b/src/corelib/itemmodels/qstringlistmodel.cpp @@ -282,7 +282,9 @@ void QStringListModel::sort(int, Qt::SortOrder order) QModelIndexList oldList = persistentIndexList(); QModelIndexList newList; - for (int i = 0; i < oldList.count(); ++i) + const int numOldIndexes = oldList.count(); + newList.reserve(numOldIndexes); + for (int i = 0; i < numOldIndexes; ++i) newList.append(index(forwarding.at(oldList.at(i).row()), 0)); changePersistentIndexList(oldList, newList); diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp index b9e8b2573e..dea8c200ef 100644 --- a/src/corelib/kernel/qobject.cpp +++ b/src/corelib/kernel/qobject.cpp @@ -3543,7 +3543,7 @@ static void queued_activate(QObject *sender, int signal, QObjectPrivate::Connect QMutexLocker &locker) { const int *argumentTypes = c->argumentTypes.load(); - if (!argumentTypes && argumentTypes != &DIRECT_CONNECTION_ONLY) { + if (!argumentTypes) { QMetaMethod m = QMetaObjectPrivate::signal(sender->metaObject(), signal); argumentTypes = queuedConnectionTypes(m.parameterTypes()); if (!argumentTypes) // cannot queue arguments diff --git a/src/corelib/plugin/plugin.pri b/src/corelib/plugin/plugin.pri index 9dc60c5d39..544dd41742 100644 --- a/src/corelib/plugin/plugin.pri +++ b/src/corelib/plugin/plugin.pri @@ -39,4 +39,4 @@ darwin { OBJECTIVE_SOURCES += plugin/quuid_darwin.mm } -LIBS_PRIVATE += $$QMAKE_LIBS_DYNLOAD +!no-libdl: LIBS_PRIVATE += $$QMAKE_LIBS_DYNLOAD diff --git a/src/corelib/plugin/qlibrary_unix.cpp b/src/corelib/plugin/qlibrary_unix.cpp index 25fbc884b6..f6a947b61a 100644 --- a/src/corelib/plugin/qlibrary_unix.cpp +++ b/src/corelib/plugin/qlibrary_unix.cpp @@ -292,7 +292,7 @@ bool QLibraryPrivate::unload_sys() return true; } -#ifdef Q_OS_LINUX +#if defined(Q_OS_LINUX) && !defined(QT_NO_DYNAMIC_LIBRARY) Q_CORE_EXPORT QFunctionPointer qt_linux_find_symbol_sys(const char *symbol) { return QFunctionPointer(dlsym(RTLD_DEFAULT, symbol)); diff --git a/src/corelib/tools/qdatetimeparser.cpp b/src/corelib/tools/qdatetimeparser.cpp index 853903619f..9ffef05d78 100644 --- a/src/corelib/tools/qdatetimeparser.cpp +++ b/src/corelib/tools/qdatetimeparser.cpp @@ -161,7 +161,7 @@ bool QDateTimeParser::setDigit(QDateTime &v, int index, int newVal) const case AmPmSection: hour = (newVal == 0 ? hour % 12 : (hour % 12) + 12); break; default: qWarning("QDateTimeParser::setDigit() Internal error (%s)", - qPrintable(sectionName(node.type))); + qPrintable(node.name())); break; } @@ -212,7 +212,7 @@ int QDateTimeParser::absoluteMax(int s, const QDateTime &cur) const default: break; } qWarning("QDateTimeParser::absoluteMax() Internal error (%s)", - qPrintable(sectionName(sn.type))); + qPrintable(sn.name())); return -1; } @@ -241,7 +241,7 @@ int QDateTimeParser::absoluteMin(int s) const default: break; } qWarning("QDateTimeParser::absoluteMin() Internal error (%s, %0x)", - qPrintable(sectionName(sn.type)), sn.type); + qPrintable(sn.name()), sn.type); return -1; } @@ -296,7 +296,7 @@ int QDateTimeParser::sectionPos(const SectionNode &sn) const default: break; } if (sn.pos == -1) { - qWarning("QDateTimeParser::sectionPos Internal error (%s)", qPrintable(sectionName(sn.type))); + qWarning("QDateTimeParser::sectionPos Internal error (%s)", qPrintable(sn.name())); return -1; } return sn.pos; @@ -520,7 +520,7 @@ bool QDateTimeParser::parseFormat(const QString &newFormat) last.pos = -1; // for (int i=0; i<sectionNodes.size(); ++i) { -// QDTPDEBUG << sectionName(sectionNodes.at(i).type) << sectionNodes.at(i).count; +// QDTPDEBUG << sectionNodes.at(i).name() << sectionNodes.at(i).count; // } QDTPDEBUG << newFormat << displayFormat; @@ -631,7 +631,7 @@ int QDateTimeParser::sectionMaxSize(Section s, int count) const case TimeSectionMask: case DateSectionMask: qWarning("QDateTimeParser::sectionMaxSize: Invalid section %s", - sectionName(s).toLatin1().constData()); + SectionNode::name(s).toLatin1().constData()); case NoSectionIndex: case FirstSectionIndex: @@ -697,7 +697,7 @@ int QDateTimeParser::parseSection(const QDateTime ¤tValue, int sectionInde const SectionNode &sn = sectionNode(sectionIndex); if ((sn.type & Internal) == Internal) { qWarning("QDateTimeParser::parseSection Internal error (%s %d)", - qPrintable(sectionName(sn.type)), sectionIndex); + qPrintable(sn.name()), sectionIndex); return -1; } @@ -705,7 +705,7 @@ int QDateTimeParser::parseSection(const QDateTime ¤tValue, int sectionInde QString sectiontext = text.mid(index, sectionmaxsize); int sectiontextSize = sectiontext.size(); - QDTPDEBUG << "sectionValue for" << sectionName(sn.type) + QDTPDEBUG << "sectionValue for" << sn.name() << "with text" << text << "and st" << sectiontext << text.mid(index, sectionmaxsize) << index; @@ -855,7 +855,7 @@ int QDateTimeParser::parseSection(const QDateTime ¤tValue, int sectionInde break; } default: qWarning("QDateTimeParser::parseSection Internal error (%s %d)", - qPrintable(sectionName(sn.type)), sectionIndex); + qPrintable(sn.name()), sectionIndex); return -1; } @@ -916,7 +916,7 @@ QDateTimeParser::StateNode QDateTimeParser::parse(QString &input, int &cursorPos int used; num = parseSection(currentValue, index, input, cursorPosition, pos, tmpstate, &used); - QDTPDEBUG << "sectionValue" << sectionName(sectionType(index)) << input + QDTPDEBUG << "sectionValue" << sn.name() << input << "pos" << pos << "used" << used << stateName(tmpstate); if (fixup && tmpstate == Intermediate && used < sn.count) { const FieldInfo fi = fieldInfo(index); @@ -934,7 +934,7 @@ QDateTimeParser::StateNode QDateTimeParser::parse(QString &input, int &cursorPos break; } - QDTPDEBUG << index << sectionName(sectionType(index)) << "is set to" + QDTPDEBUG << index << sn.name() << "is set to" << pos << "state is" << stateName(state); @@ -954,7 +954,7 @@ QDateTimeParser::StateNode QDateTimeParser::parse(QString &input, int &cursorPos case AmPmSection: current = &m; break; default: qWarning("QDateTimeParser::parse Internal error (%s)", - qPrintable(sectionName(sn.type))); + qPrintable(sn.name())); break; } if (!current) { @@ -962,7 +962,7 @@ QDateTimeParser::StateNode QDateTimeParser::parse(QString &input, int &cursorPos return StateNode(); } if (isSet & sn.type && *current != num) { - QDTPDEBUG << "CONFLICT " << sectionName(sn.type) << *current << num; + QDTPDEBUG << "CONFLICT " << sn.name() << *current << num; conflicts = true; if (index != currentSectionIndex || num == -1) { continue; @@ -1046,15 +1046,16 @@ QDateTimeParser::StateNode QDateTimeParser::parse(QString &input, int &cursorPos const QLocale loc = locale(); for (int i=0; i<sectionNodesCount; ++i) { - const Section thisSectionType = sectionType(i); - if (thisSectionType & (DaySection)) { - input.replace(sectionPos(i), sectionSize(i), loc.toString(day)); - } else if (thisSectionType & (DayOfWeekSectionShort|DayOfWeekSectionLong)) { + const SectionNode sn = sectionNode(i); + if (sn.type & DaySection) { + input.replace(sectionPos(sn), sectionSize(i), loc.toString(day)); + } else if (sn.type & (DayOfWeekSectionShort | DayOfWeekSectionLong)) { const int dayOfWeek = QDate(year, month, day).dayOfWeek(); - const QLocale::FormatType dayFormat = (thisSectionType == DayOfWeekSectionShort - ? QLocale::ShortFormat : QLocale::LongFormat); + const QLocale::FormatType dayFormat = + (sn.type == DayOfWeekSectionShort + ? QLocale::ShortFormat : QLocale::LongFormat); const QString dayName(loc.dayName(dayOfWeek, dayFormat)); - input.replace(sectionPos(i), sectionSize(i), dayName); + input.replace(sectionPos(sn), sectionSize(i), dayName); } } } else { @@ -1168,7 +1169,7 @@ end: toMin = newCurrentValue.daysTo(minimum); toMax = newCurrentValue.daysTo(maximum); } - const int maxChange = QDateTimeParser::maxChange(i); + const int maxChange = sn.maxChange(); if (toMin > maxChange) { QDTPDEBUG << "invalid because toMin > maxChange" << toMin << maxChange << t << newCurrentValue << minimum; @@ -1182,7 +1183,7 @@ end: const int min = getDigit(minimum, i); if (min == -1) { qWarning("QDateTimeParser::parse Internal error 4 (%s)", - qPrintable(sectionName(sn.type))); + qPrintable(sn.name())); state = Invalid; done = true; break; @@ -1194,7 +1195,7 @@ end: pos = -1; if (!potentialValue(t.simplified(), min, max, i, newCurrentValue, pos)) { QDTPDEBUG << "invalid because potentialValue(" << t.simplified() << min << max - << sectionName(sn.type) << "returned" << toMax << toMin << pos; + << sn.name() << "returned" << toMax << toMin << pos; state = Invalid; done = true; break; @@ -1360,22 +1361,20 @@ int QDateTimeParser::findDay(const QString &str1, int startDay, int sectionIndex /*! \internal - returns - 0 if str == tr("AM") - 1 if str == tr("PM") - 2 if str can become tr("AM") - 3 if str can become tr("PM") - 4 if str can become tr("PM") and can become tr("AM") - -1 can't become anything sensible - + Returns + AM if str == tr("AM") + PM if str == tr("PM") + PossibleAM if str can become tr("AM") + PossiblePM if str can become tr("PM") + PossibleBoth if str can become tr("PM") and can become tr("AM") + Neither if str can't become anything sensible */ - -int QDateTimeParser::findAmPm(QString &str, int sectionIndex, int *used) const +QDateTimeParser::AmPmFinder QDateTimeParser::findAmPm(QString &str, int sectionIndex, int *used) const { const SectionNode &s = sectionNode(sectionIndex); if (s.type != AmPmSection) { qWarning("QDateTimeParser::findAmPm Internal error"); - return -1; + return Neither; } if (used) *used = str.size(); @@ -1452,10 +1451,9 @@ int QDateTimeParser::findAmPm(QString &str, int sectionIndex, int *used) const Max number of units that can be changed by this section. */ -int QDateTimeParser::maxChange(int index) const +int QDateTimeParser::SectionNode::maxChange() const { - const SectionNode &sn = sectionNode(index); - switch (sn.type) { + switch (type) { // Time. unit is msec case MSecSection: return 999; case SecondSection: return 59 * 1000; @@ -1471,7 +1469,7 @@ int QDateTimeParser::maxChange(int index) const case YearSection2Digits: return 100 * 365; default: qWarning("QDateTimeParser::maxChange() Internal error (%s)", - qPrintable(sectionName(sectionType(index)))); + qPrintable(name())); } return -1; @@ -1481,8 +1479,7 @@ QDateTimeParser::FieldInfo QDateTimeParser::fieldInfo(int index) const { FieldInfo ret = 0; const SectionNode &sn = sectionNode(index); - const Section s = sn.type; - switch (s) { + switch (sn.type) { case MSecSection: ret |= Fraction; // fallthrough @@ -1493,7 +1490,7 @@ QDateTimeParser::FieldInfo QDateTimeParser::fieldInfo(int index) const case YearSection: case YearSection2Digits: ret |= Numeric; - if (s != YearSection) { + if (sn.type != YearSection) { ret |= AllowPartial; } if (sn.count != 1) { @@ -1521,30 +1518,16 @@ QDateTimeParser::FieldInfo QDateTimeParser::fieldInfo(int index) const break; default: qWarning("QDateTimeParser::fieldInfo Internal error 2 (%d %s %d)", - index, qPrintable(sectionName(sn.type)), sn.count); + index, qPrintable(sn.name()), sn.count); break; } return ret; } -/*! - \internal - - Get a number that str can become which is between min - and max or -1 if this is not possible. -*/ - - -QString QDateTimeParser::sectionFormat(int index) const -{ - const SectionNode &sn = sectionNode(index); - return sectionFormat(sn.type, sn.count); -} - -QString QDateTimeParser::sectionFormat(Section s, int count) const +QString QDateTimeParser::SectionNode::format() const { QChar fillChar; - switch (s) { + switch (type) { case AmPmSection: return count == 1 ? QLatin1String("AP") : QLatin1String("ap"); case MSecSection: fillChar = QLatin1Char('z'); break; case SecondSection: fillChar = QLatin1Char('s'); break; @@ -1559,7 +1542,7 @@ QString QDateTimeParser::sectionFormat(Section s, int count) const case YearSection: fillChar = QLatin1Char('y'); break; default: qWarning("QDateTimeParser::sectionFormat Internal error (%s)", - qPrintable(sectionName(s))); + qPrintable(name(type))); return QString(); } if (fillChar.isNull()) { @@ -1657,7 +1640,7 @@ bool QDateTimeParser::skipToNextSection(int index, const QDateTime ¤t, con For debugging. Returns the name of the section \a s. */ -QString QDateTimeParser::sectionName(int s) const +QString QDateTimeParser::SectionNode::name(QDateTimeParser::Section s) { switch (s) { case QDateTimeParser::AmPmSection: return QLatin1String("AmPmSection"); @@ -1675,7 +1658,7 @@ QString QDateTimeParser::sectionName(int s) const case QDateTimeParser::NoSection: return QLatin1String("NoSection"); case QDateTimeParser::FirstSection: return QLatin1String("FirstSection"); case QDateTimeParser::LastSection: return QLatin1String("LastSection"); - default: return QLatin1String("Unknown section ") + QString::number(s); + default: return QLatin1String("Unknown section ") + QString::number(int(s)); } } @@ -1684,7 +1667,7 @@ QString QDateTimeParser::sectionName(int s) const For debugging. Returns the name of the state \a s. */ -QString QDateTimeParser::stateName(int s) const +QString QDateTimeParser::stateName(State s) const { switch (s) { case Invalid: return QLatin1String("Invalid"); diff --git a/src/corelib/tools/qdatetimeparser_p.h b/src/corelib/tools/qdatetimeparser_p.h index 64e73346f2..ad403f695b 100644 --- a/src/corelib/tools/qdatetimeparser_p.h +++ b/src/corelib/tools/qdatetimeparser_p.h @@ -103,7 +103,7 @@ public: none.zeroesAdded = 0; } virtual ~QDateTimeParser() {} - enum { + enum AmPmFinder { Neither = -1, AM = 0, PM = 1, @@ -113,25 +113,26 @@ public: }; enum Section { - NoSection = 0x00000, - AmPmSection = 0x00001, - MSecSection = 0x00002, + NoSection = 0x00000, + AmPmSection = 0x00001, + MSecSection = 0x00002, SecondSection = 0x00004, MinuteSection = 0x00008, Hour12Section = 0x00010, Hour24Section = 0x00020, TimeSectionMask = (AmPmSection|MSecSection|SecondSection|MinuteSection|Hour12Section|Hour24Section), - Internal = 0x10000, - DaySection = 0x00100, - MonthSection = 0x00200, - YearSection = 0x00400, + DaySection = 0x00100, + MonthSection = 0x00200, + YearSection = 0x00400, YearSection2Digits = 0x00800, DayOfWeekSectionShort = 0x01000, - DayOfWeekSectionLong = 0x20000, + DayOfWeekSectionLong = 0x02000, DateSectionMask = (DaySection|MonthSection|YearSection|YearSection2Digits|DayOfWeekSectionShort|DayOfWeekSectionLong), - FirstSection = 0x02000|Internal, - LastSection = 0x04000|Internal, - CalendarPopupSection = 0x08000|Internal, + + Internal = 0x10000, + FirstSection = 0x20000 | Internal, + LastSection = 0x40000 | Internal, + CalendarPopupSection = 0x80000 | Internal, NoSectionIndex = -1, FirstSectionIndex = -2, @@ -140,11 +141,16 @@ public: }; // duplicated from qdatetimeedit.h Q_DECLARE_FLAGS(Sections, Section) - struct SectionNode { + struct Q_CORE_EXPORT SectionNode { Section type; mutable int pos; int count; int zeroesAdded; + + static QString name(Section s); + QString name() const { return name(type); } + QString format() const; + int maxChange() const; }; enum State { // duplicated from QValidator @@ -201,16 +207,12 @@ public: int findDay(const QString &str1, int intDaystart, int sectionIndex, QString *dayName = 0, int *used = 0) const; #endif - int findAmPm(QString &str1, int index, int *used = 0) const; - int maxChange(int s) const; + AmPmFinder findAmPm(QString &str, int index, int *used = 0) const; bool potentialValue(const QString &str, int min, int max, int index, const QDateTime ¤tValue, int insert) const; bool skipToNextSection(int section, const QDateTime ¤t, const QString §ionText) const; - QString sectionName(int s) const; - QString stateName(int s) const; - QString sectionFormat(int index) const; - QString sectionFormat(Section s, int count) const; + QString stateName(State s) const; enum FieldInfoFlag { Numeric = 0x01, diff --git a/src/corelib/tools/qhash.cpp b/src/corelib/tools/qhash.cpp index d1f079e07b..c1a1b9715f 100644 --- a/src/corelib/tools/qhash.cpp +++ b/src/corelib/tools/qhash.cpp @@ -364,7 +364,7 @@ int qGlobalQHashSeed() /*! \relates QHash \since 5.6 - Sets the global QHash seed. + Sets the global QHash seed to \a newSeed. Manually setting the global QHash seed value should be done only for testing and debugging purposes, when deterministic and reproducible behavior on a QHash diff --git a/src/corelib/tools/qlocale_unix.cpp b/src/corelib/tools/qlocale_unix.cpp index d6efd5af38..9b0d338e46 100644 --- a/src/corelib/tools/qlocale_unix.cpp +++ b/src/corelib/tools/qlocale_unix.cpp @@ -253,7 +253,7 @@ QVariant QSystemLocale::query(QueryType type, QVariant in) const case StringToAlternateQuotation: return lc_messages.quoteString(in.value<QStringRef>(), QLocale::AlternateQuotation); case ListToSeparatedString: - return lc_messages.createSeparatedList(in.value<QStringList>()); + return lc_messages.createSeparatedList(in.toStringList()); case LocaleChanged: Q_ASSERT(false); default: diff --git a/src/corelib/tools/qsharedpointer.cpp b/src/corelib/tools/qsharedpointer.cpp index cb8511d0ed..d03e3129aa 100644 --- a/src/corelib/tools/qsharedpointer.cpp +++ b/src/corelib/tools/qsharedpointer.cpp @@ -133,7 +133,7 @@ object being tracked is the same. \omit - \secton1 QSharedPointer internals + \section1 QSharedPointer internals QSharedPointer has two "private" members: the pointer itself being tracked and a d-pointer. Those members are private to the class, but QSharedPointer @@ -345,7 +345,7 @@ creating a QSharedPointer using toStrongRef() is too high. \omit - \secton1 QWeakPointer internals + \section1 QWeakPointer internals QWeakPointer shares most of its internal functionality with \l{QSharedPointer#qsharedpointer-internals}{QSharedPointer}, so see that |