diff options
author | Lars Knoll <lars.knoll@qt.io> | 2019-12-11 12:47:39 +0100 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2020-04-01 09:29:26 +0100 |
commit | 66f06a930da0114f62a5470e778182c50117ad27 (patch) | |
tree | 0c6ab19aea2142838c7237090aace3c02bc4a6d7 /tests/auto/corelib/text/qcollator | |
parent | 098d2edb07e08da6485fee4efbea72f43ddc766e (diff) |
Make QLocale(QString) explicit
We should not implicitly convert a QString to a QLocale object. It can
easily create unwanted side effects.
Change-Id: I7bd9b4a4e4512c0e60176ee4d241d172f00fdc32
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'tests/auto/corelib/text/qcollator')
-rw-r--r-- | tests/auto/corelib/text/qcollator/tst_qcollator.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/auto/corelib/text/qcollator/tst_qcollator.cpp b/tests/auto/corelib/text/qcollator/tst_qcollator.cpp index 6806aa09b5..439f80e795 100644 --- a/tests/auto/corelib/text/qcollator/tst_qcollator.cpp +++ b/tests/auto/corelib/text/qcollator/tst_qcollator.cpp @@ -193,7 +193,7 @@ void tst_QCollator::compare() QFETCH(bool, ignorePunctuation); QFETCH(int, punctuationResult); - QCollator collator(locale); + QCollator collator((QLocale(locale))); // Need to canonicalize sign to -1, 0 or 1, as .compare() can produce any -ve for <, any +ve for >. auto asSign = [](int compared) { return compared < 0 ? -1 : compared > 0 ? 1 : 0; |