summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/tools')
-rw-r--r--src/corelib/tools/qcollator.cpp5
-rw-r--r--src/corelib/tools/qdatetime.cpp21
-rw-r--r--src/corelib/tools/qregexp.cpp4
-rw-r--r--src/corelib/tools/qsize.cpp2
-rw-r--r--src/corelib/tools/tools.pri4
5 files changed, 24 insertions, 12 deletions
diff --git a/src/corelib/tools/qcollator.cpp b/src/corelib/tools/qcollator.cpp
index 9c97d6b158..f7dfaa7d33 100644
--- a/src/corelib/tools/qcollator.cpp
+++ b/src/corelib/tools/qcollator.cpp
@@ -205,6 +205,11 @@ QLocale QCollator::locale() const
By default this mode is off.
+ \note On Windows, this functionality makes use of the \l{ICU} library. If Qt was
+ compiled without ICU support, it falls back to code using native Windows API,
+ which only works from Windows 7 onwards. On older versions of Windows, it will not work
+ and a warning will be emitted at runtime.
+
\sa numericMode()
*/
diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp
index e38a5f569a..801876629c 100644
--- a/src/corelib/tools/qdatetime.cpp
+++ b/src/corelib/tools/qdatetime.cpp
@@ -253,7 +253,7 @@ static QString toOffsetString(Qt::DateFormat format, int offset)
return result.arg(offset >= 0 ? QLatin1Char('+') : QLatin1Char('-'))
.arg(qAbs(offset) / SECS_PER_HOUR, 2, 10, QLatin1Char('0'))
- .arg((offset / 60) % 60, 2, 10, QLatin1Char('0'));
+ .arg((qAbs(offset) / 60) % 60, 2, 10, QLatin1Char('0'));
}
// Parse offset in [+-]HH[:]MM format
@@ -265,17 +265,24 @@ static int fromOffsetString(const QString &offsetString, bool *valid)
if (size < 2 || size > 6)
return 0;
+ // sign will be +1 for a positive and -1 for a negative offset
+ int sign;
+
// First char must be + or -
- const QChar sign = offsetString.at(0);
- if (sign != QLatin1Char('+') && sign != QLatin1Char('-'))
+ const QChar signChar = offsetString.at(0);
+ if (signChar == QLatin1Char('+'))
+ sign = 1;
+ else if (signChar == QLatin1Char('-'))
+ sign = -1;
+ else
return 0;
// Split the hour and minute parts
- QStringList parts = offsetString.split(QLatin1Char(':'));
+ QStringList parts = offsetString.mid(1).split(QLatin1Char(':'));
if (parts.count() == 1) {
// [+-]HHMM format
- parts.append(parts.at(0).mid(3));
- parts[0] = parts.at(0).left(3);
+ parts.append(parts.at(0).mid(2));
+ parts[0] = parts.at(0).left(2);
}
bool ok = false;
@@ -288,7 +295,7 @@ static int fromOffsetString(const QString &offsetString, bool *valid)
return 0;
*valid = true;
- return ((hour * 60) + minute) * 60;
+ return sign * ((hour * 60) + minute) * 60;
}
/*****************************************************************************
diff --git a/src/corelib/tools/qregexp.cpp b/src/corelib/tools/qregexp.cpp
index cadf2da019..fbcd271f1d 100644
--- a/src/corelib/tools/qregexp.cpp
+++ b/src/corelib/tools/qregexp.cpp
@@ -388,7 +388,7 @@ int qFindString(const QChar *haystack, int haystackLen, int from,
Note: Quantifiers are normally "greedy". They always match as much
text as they can. For example, \b{0+} matches the first zero it
finds and all the consecutive zeros after the first zero. Applied
- to '20005', it matches'2\underline{000}5'. Quantifiers can be made
+ to '20005', it matches '2\underline{000}5'. Quantifiers can be made
non-greedy, see setMinimal().
\target capturing parentheses
@@ -678,7 +678,7 @@ int qFindString(const QChar *haystack, int haystackLen, int from,
QRegExp can match case insensitively using setCaseSensitivity(),
and can use non-greedy matching, see setMinimal(). By
default QRegExp uses full regexps but this can be changed with
- setWildcard(). Searching can be forward with indexIn() or backward
+ setPatternSyntax(). Searching can be done forward with indexIn() or backward
with lastIndexIn(). Captured text can be accessed using
capturedTexts() which returns a string list of all captured
strings, or using cap() which returns the captured string for the
diff --git a/src/corelib/tools/qsize.cpp b/src/corelib/tools/qsize.cpp
index b53eced298..c9a6ffa03a 100644
--- a/src/corelib/tools/qsize.cpp
+++ b/src/corelib/tools/qsize.cpp
@@ -61,7 +61,7 @@ QT_BEGIN_NAMESPACE
width and height can be swapped using the transpose() function.
The isValid() function determines if a size is valid (a valid size
- has both width and height greater than zero). The isEmpty()
+ has both width and height greater than or equal to zero). The isEmpty()
function returns \c true if either of the width and height is less
than, or equal to, zero, while the isNull() function returns \c true
only if both the width and the height is zero.
diff --git a/src/corelib/tools/tools.pri b/src/corelib/tools/tools.pri
index 863cf03439..57a9591060 100644
--- a/src/corelib/tools/tools.pri
+++ b/src/corelib/tools/tools.pri
@@ -163,10 +163,10 @@ contains(QT_CONFIG,icu) {
LIBS_PRIVATE += -lsicuin -lsicuuc -lsicudt
}
} else {
- LIBS_PRIVATE += -licuin -licuuc
+ LIBS_PRIVATE += -licuin -licuuc -licudt
}
} else {
- LIBS_PRIVATE += -licui18n -licuuc
+ LIBS_PRIVATE += -licui18n -licuuc -licudata
}
} else: win32 {
SOURCES += tools/qcollator_win.cpp