Commit Graph

55453 Commits

Author SHA1 Message Date
Marc Mutz
9fa71c246d QStringConverter: make name matching locale-independent
The existing name lookup code used C's toupper() function for
case-insensitive comparison. However, that function's result depends
on the current locale.

Since the matcher is supposed to match the likes of "iso-8859-1" and
"latin-1", matching may fail in locales, such as Turkish, where
toupper(i) is İ (or i, if the former isn't representable in the current
charset), but toupper(I) remains I, causing a False Negative.

To fix, use the US-ASCII-only QtMiscUtils::toAsciiLower() function,
which has the added advantage that it's inline.

Pick-to: 6.3 6.2
Change-Id: I70613c0167d84e3dc3d282c61c716b5dd0b3e6bb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-02-20 01:00:35 +00:00
Marc Mutz
abedccb94b QStringConverter: make name matching locale-independent
The existing name lookup code used C's toupper() function for
case-insensitive comparison. However, that function's result depends
on the current locale.

Since the matcher is supposed to match the likes of "iso-8859-1" and
"latin-1", matching may fail in locales, such as Turkish, where
toupper(i) is İ (or i, if the former isn't representable in the current
charset), but toupper(I) remains I, causing a False Negative.

To fix, use the US-ASCII-only QtMiscUtils::toAsciiLower() function,
which has the added advantage that it's inline.

Pick-to: 6.3 6.2
Change-Id: I70613c0167d84e3dc3d282c61c716b5dd0b3e6bb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-02-20 00:59:55 +00:00
Marc Mutz
57f0baa58d QStringConverter: make name matching locale-independent
The existing name lookup code used C's toupper() function for
case-insensitive comparison. However, that function's result depends
on the current locale.

Since the matcher is supposed to match the likes of "iso-8859-1" and
"latin-1", matching may fail in locales, such as Turkish, where
toupper(i) is İ (or i, if the former isn't representable in the current
charset), but toupper(I) remains I, causing a False Negative.

To fix, use the US-ASCII-only QtMiscUtils::toAsciiLower() function,
which has the added advantage that it's inline.

Pick-to: 6.3 6.2
Change-Id: I70613c0167d84e3dc3d282c61c716b5dd0b3e6bb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-02-20 00:59:24 +00:00
Marc Mutz
d163cb8287 QStringConverter: make name matching locale-independent
The existing name lookup code used C's toupper() function for
case-insensitive comparison. However, that function's result depends
on the current locale.

Since the matcher is supposed to match the likes of "iso-8859-1" and
"latin-1", matching may fail in locales, such as Turkish, where
toupper(i) is İ (or i, if the former isn't representable in the current
charset), but toupper(I) remains I, causing a False Negative.

To fix, use the US-ASCII-only QtMiscUtils::toAsciiLower() function,
which has the added advantage that it's inline.

Pick-to: 6.3 6.2
Change-Id: I70613c0167d84e3dc3d282c61c716b5dd0b3e6bb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-02-20 00:59:03 +00:00
Marc Mutz
955106c4fb QStringConverter: make name matching locale-independent
The existing name lookup code used C's toupper() function for
case-insensitive comparison. However, that function's result depends
on the current locale.

Since the matcher is supposed to match the likes of "iso-8859-1" and
"latin-1", matching may fail in locales, such as Turkish, where
toupper(i) is İ (or i, if the former isn't representable in the current
charset), but toupper(I) remains I, causing a False Negative.

To fix, use the US-ASCII-only QtMiscUtils::toAsciiLower() function,
which has the added advantage that it's inline.

Pick-to: 6.3 6.2
Change-Id: I70613c0167d84e3dc3d282c61c716b5dd0b3e6bb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-02-20 00:58:52 +00:00
Thiago Macieira
b2298b7e94 qsimd_p.h: let the generator script generate the ARCH target strings
__attribute__((target("arch=xxxx"))) does not work because the compilers
(GCC at least) don't test the CPU features that they are targeting, so
we keep getting "inline failed" compiler errors.

GCC bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90129

Upstream patch: https://github.com/opendcdiag/opendcdiag/pull/59

Change-Id: I6fcda969a9e9427198bffffd16cea09fda4406d2
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2022-02-19 13:40:21 -08:00
Thiago Macieira
8b78439980 qsimd_p.h: add x86-64-v4
Change-Id: Ib42b3adc93bf4d43bd55fffd16c1106092205f0d
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2022-02-19 13:40:18 -08:00
Thiago Macieira
ad65bbe4c0 qsimd_p.h: disallow building with just -mavx2 instead of full x86-64-v3
It's probably a user mistake that they didn't know what they really
wanted. Since no processor that supports AVX2 fails to support the rest
of x86-64-v3, we should enable all of that so we can make use of its
features. Notably, we may want to use FMA at some point in QtGui, and
the compiler will likely use BMI, BMI2, and LZCNT on its own (see
qnumeric.h).

Compiling with -mavx2 will produce GCC these errors:

 qsimd_p.h:266:8: error: #error "Please enable all x86-64-v3 extensions; you probably want to use -march=haswell or -march=x86-64-v3 instead of -mavx2"
 qsimd_p.h:263:49: error: ‘__BMI__’ was not declared in this scope
 qsimd_p.h:263:59: error: ‘__BMI2__’ was not declared in this scope
 qsimd_p.h:263:70: error: ‘__F16C__’ was not declared in this scope
 qsimd_p.h:263:81: error: ‘__FMA__’ was not declared in this scope
 qsimd_p.h:263:91: error: ‘__LZCNT__’ was not declared in this scope; did you mea

Change-Id: Ib42b3adc93bf4d43bd55fffd16c10f8b6a775f3f
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2022-02-19 13:40:16 -08:00
Thiago Macieira
5f7e02efb8 qsimd_p.h: Restore compatibility with C code
The qCpuHasFeature() macro doesn't work in C mode in x86 because it
tries to use enums only available in C++ mode, but the qCpuFeatures()
function does. You can write:

  if ((qCompilerCpuFeatures & cpu_feature_avx2) ||
      (qCpuFeatures() & cpu_feature_avx2))

In C code and this will compile.

Change-Id: Ic15405335d804bdea761fffd16d50dc4f17f572e
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2022-02-19 13:40:15 -08:00
Thiago Macieira
ff63a38bb8 qsimd_p.h: group the two HWRNG-related functions
Change-Id: Ic15405335d804bdea761fffd16d50c62ebdf6c0d
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2022-02-19 13:40:13 -08:00
Thiago Macieira
ec39010390 qsimd_p.h: move macros up
Change-Id: Ic15405335d804bdea761fffd16d50c5a18275b23
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2022-02-19 13:40:11 -08:00
Thiago Macieira
3cccacd624 qglobal_p.h: move QT_SUPPORTS_INIT_PRIORITY to outside the C++ section
Change-Id: Ic15405335d804bdea761fffd16d50d9c5fc5e237
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2022-02-19 13:40:09 -08:00
Thiago Macieira
20575393f4 qtnamespacemacros.h: make Q_MANGLE_NAMESPACE() available in C mode
Pretty sure that's what the macro was for anyway.

Change-Id: Ic15405335d804bdea761fffd16d50d94b95192db
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2022-02-19 13:40:08 -08:00
Andreas Buhr
1ee1e4f6ac QAbstractItemModel: make naming of arguments consistent
The signals rowsAboutToBeMoved/rowsMoved have the same arguments,
but use different argument names. This patch aligns the naming,
making it consistent. Same for columnsAboutToBeMoved/columnsMoved.

Change-Id: I1cefe54319e569b8d57f6579ae9d5c3e33b66dc2
Reviewed-by: David Faure <david.faure@kdab.com>
2022-02-19 16:32:57 +01:00
Marc Mutz
0ef4e6d4bf Use QtMiscUtils::toAsciiLower() around the code
... instead of self-rolled versions in at least three TUs.

QByteArray's asciiLower() cannot be completely removed, yet, because
it's used for indirect calls.

Change-Id: Icf4e7605184f0a1157967c78cbd7632b283c4a9d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-02-19 07:29:37 +01:00
Marc Mutz
0f52ec8d52 QByteArray: Extract Function QtMiscUtils::caseCompareAscii()
Change-Id: Id9c385f4df4f33792738cd134fabb9cc03cab809
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-02-19 02:09:35 +01:00
Michal Klocek
be2745e478 Install 3rdparty headers for static builds
For static builds we need 3rdparty headers to be installed.
Leaf modules like qtwebengine needs 3rdparty libs and header for
zlib, freetype, harfbuzz, png, jpeg. Without those the Chromium bundled
versions are used, however it might end up badly if qt has already
bundled one.

Introduce new header only modules with additional arguments for
qt_internal_add_module:

 * EXTERNAL_HEADERS to pick exactly which headers are public
 * EXTERNAL_HEADERS_DIR to include whole directory preserving the
   files directory structure

Fix qtsync so it keep directory structure for all non-qt modules when
syncing headers and do not generate warnings for headers files.

Task-number: QTBUG-87154
Task-number: QTBUG-88614
Change-Id: If1c27bf8608791cd4e0a21839d6316a445a96e9f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-02-19 01:52:32 +01:00
Allan Sandfeld Jensen
6944b4df7b Revert "Correct haswell function target for clang"
This reverts commit 1cc0494f7d.

Reason for revert: Not a fix, but a break

Pick-to: 6.3 6.2
Change-Id: Ie41d8870dbd52f87059f6bad2335e272409c3046
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-02-19 00:52:32 +00:00
Thiago Macieira
6323ccfa73 qsimd: Remove QT_COMPILER_SUPPORTS_SIMD_ALWAYS
All[*] compilers support it, always. The last to not support it was GCC
4.8, which we don't support in Qt 6.

[*] Anecdotally, clang-cl doesn't but clang-cl isn't supported and that
would be an upstream problem: clang-cl developers must find a solution
that either matches Clang or cl.exe.

Change-Id: I54f205f6b7314351b078fffd16d0a5ed5b7afae5
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2022-02-18 15:46:41 -08:00
Thiago Macieira
181d7ea053 QJsonValueRef: add non-const operator[]
These can't be done before Qt 7, unlike their CBOR counterparts, for
binary-compatibility reasons: in 6.x, QJson{Const,}ValueRef must hold a
pointer to an extant QJsonArray or QJsonObject. So this is implemented
for Qt 7 / bootstrap only for now.

Unfortunately, they can't be tested either.

Change-Id: I54f205f6b7314351b078fffd16d067d735c4fe2b
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2022-02-18 15:46:41 -08:00
Thiago Macieira
b852584556 qsimd: update the generator script from OpenDCDiag
I'd been making changes to that and improving it for the past 2 years
without bringing it back into Qt.

The list of features is mostly the same, except:
- removed TSX features
- removed features specific to Xeon Phi processors
- added CET and AVX512FP16 features
- added the bit for hybrid CPU detection

See matching update at https://github.com/opendcdiag/opendcdiag/pull/49

Change-Id: I6fcda969a9e9427198bffffd16ce860b5a38aece
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2022-02-18 15:46:41 -08:00
Friedemann Kleint
05428d9b97 Polish tst_QAbstractSpinBox
Introduce modern C++, use static methods, nullptr, auto.

Pick-to: 6.3
Change-Id: I9025c94c063045329ae1a25b387cb2135d588b22
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-02-18 22:32:18 +01:00
Marc Mutz
0e60e4bf19 QDesktopServices: make QOpenUrlHandlerRegistry a non-QObject
It seems to have been a QObject solely for its single slot.

But since Qt 5, slots need no longer be defined on QObjects, so we can
remove the inheritance from QObject now. We still need a QObject as
the context object in connect(), but that can be just be an aggregated
naked QObject.

Saves 26 relocations, ~1.5KiB in TEXT and ~0.3KiB in DATA on optimized
GCC 11.2 Linux AMD64 C++20 builds.

Pick-to: 6.3 6.2
Change-Id: Ic45a8e892ec2bd5de5de8fbd32ec7a167c501803
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-02-18 20:29:37 +01:00
Friedemann Kleint
1af068332b Fix test to pass with QT_FORCE_ASSERTS
Add QT_FORCE_ASSERTS to condition with standard comment.

Pick-to: 6.3 6.2
Change-Id: If493c7cdea8164f010228a755915a211c1cf1b39
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-02-18 18:55:38 +01:00
Volker Hilsheimer
72e1fc7c0b Simplify failure detection logic in QEventDispatcher test
The test always fails when either the Xcb or UNIX, one of the Windows
event dispatchers is used. So only test for the event dispatcher name,
which then covers all platforms, including QNX and INTEGRITY (which
use the UNIX event dispatcher).

Pick-to: 6.3 6.2
Change-Id: I2e315831b53f823c5496ad0319319df78f064cc1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Pasi Petäjäjärvi <pasi.petajajarvi@qt.io>
2022-02-18 18:55:38 +01:00
Marc Mutz
5f338040f4 QColor: avoid Unicode table lookups in fromString()
All color names supported by QColor are US-ASCII.

Enforce this with a static_assert, then use this fact to perform the
case-folding of the input in US-ASCII instead of Unicode.

Avoids lookups in the Unicode tables.

Add QtMiscUtils::toAsciiLower() to foster sharing.

Change-Id: Ie0e123405d772943313dc4be1808667b152770b1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-02-18 18:50:49 +01:00
Edward Welbourne
795c94658d Expand testing of QDateTime's isNull() and isValid()
Bring out the asymmetry between date and time more clearly; when date
is valid, an invalid time is ignored in favor of QTime(0, 0). At the
same time, eliminate an un-needed variable from the code that
implements this special handling. (Left over from when the QTime was
passed by const ref, rather than by value.)

Change-Id: I81d8a9026cbb7887a8c638a2761b3db54c088af7
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-02-18 17:44:53 +01:00
Edward Welbourne
a2236c7675 Tidy up tst_QTimeZone::specificTransition()
It can now use startOfDay()/endOfDay() for the end-points of its
search range; and it should check transit is not empty before
dereferencing transits.at(0).

Change-Id: Ib1568f4d8d6ce301d601071bb58185be906c631a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-02-18 17:44:53 +01:00
Edward Welbourne
bc91be6a5f Update QTimeZone documentation on the limitations of MS's data
Describe the work-around of ignoring claims of DST prior to 1900.

Change-Id: Ia8a2e6530b285cc8012423ba174fea47732e9ecb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Jaishree Vyas <jaishree.vyas@qt.io>
2022-02-18 17:44:53 +01:00
Edward Welbourne
9a0949a25b Correct handling of start-of-rule situations in QTZP_win
A recent change made sure the handling of a time before the first rule
would be handled correctly; but I wrongly supposed relevant code would
only be exercised in that case. However, it is also run when the
moment after which we want a transition is after the last transition
in the rule for its year: we fall through to the next rule and need to
find its first transition.

This amends commit d98b43005e.

Change-Id: Idb9114a2e272ff9cdb80312f33a0b1e6cd02d582
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-02-18 17:44:53 +01:00
Edward Welbourne
aafefc094d Extract functions: move some code to TransitionTimePair
Documenting the case where a year starts in DST belongs on the pair
whose job is to work that out. The selection of which transition to
report based on an isDst flag could be said once instead of thrice if
made into a method there, too.

Change-Id: Ice59bb8594097c53bc2fefe1706434462b225274
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-02-18 17:44:52 +01:00
Friedemann Kleint
f17648bf55 Fix arguments of error message in QFile::copy()
Amends d34282dba0.

Task-number: QTBUG-100867
Pick-to: 6.3
Change-Id: I075908a51192084055b07ecaa38d9fe32a97a242
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-02-18 16:59:21 +01:00
Tor Arne Vestbø
1741034090 Ensure QMainWindow has WA_TranslucentBackground when using unified toolbar
Otherwise the QWindow will not end up with a surface format with an alpha.

This issue had been hiding in the shadows because we hard-code the backing
store image format to include an alpha, but was discovered when trying to
use RHI to flush the backing store, which does respect the window format.

Pick-to: 6.2 6.3
Change-Id: Ie2b28ca605fc7aa1b1ed22885c8f56e76d3a0305
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2022-02-18 15:26:32 +01:00
Tatiana Borisova
8875b5a9a3 Exclude autotest for INTEGRITY
- ICU is not supported by backend.
  System supports only a simple named UTC time zone implementation(see QUtcTimeZonePrivate)

Task-number: QTBUG-99123
Pick-to: 6.2 6.3
Change-Id: I4a87fc3d5484d75d55890bf88d012955e5048a0b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-02-18 13:19:45 +00:00
Fabian Kosmale
8079361852 typeNameForCast: use add_pointer instead of string manipulation
Relying on string manipulation leads to -Wredundant-parens warnings in
the best case, and to non-compiling code (when using typedefs) in the
worst case.
We can avoid both issues by simply generating code that uses
add_pointer, which takes care of reference types (even typedef'd ones),
and creates no warnings about parens (as we don't write any anymore).

Fixes: QTBUG-100915
Pick-to: 6.3 6.2
Change-Id: Ic5b1cbfda20d920d11f51beeb62e9479261d5f00
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2022-02-18 13:44:41 +01:00
Mårten Nordheim
9078b41dde QHttp: Move the emission of requestSent
Moved to after the header is actually written, not just generated.
For requests with data (put/post) we may have to wait for a callback
before the data to write is available. Since we then delay writing the
header as well it would be disingenuous to emit requestSent().

Pick-to: 6.3
Change-Id: I76c2d40ca48faaa1f6730ce8b3d5a8a4c3156f8f
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2022-02-18 13:44:41 +01:00
Joerg Bornemann
2088e8ae21 Fix warnings in bootstrap lib on Windows
This amends commit 174af05400.

Pick-to: 6.3
Change-Id: Ifc11b3c332f2b7fd16074420a0d730997ae13395
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
2022-02-18 13:44:40 +01:00
Joerg Bornemann
006224eb17 CMake: Fix cross-build without qt.toolchain.cmake
If there's no qt.toolchain.cmake used, QT_HOST_PATH_CMAKE_DIR is not
set.  Use the location calculated from the Qt6HostInfo package in that
case.

This amends commit e044c94a61.

Pick-to: 6.2 6.3
Change-Id: I99aed8e920b8c1aa6efd8f18301cc34aca5559ca
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2022-02-18 13:44:40 +01:00
Pasi Petäjäjärvi
f1d521f076 QNX: Silence compiler warning by initializing variable
qtbase/src/corelib/global/qlogging.cpp: In function 'void qDefaultMessageHandler(QtMsgType, const QMessageLogContext&, const QString&)':
qtbase/src/corelib/global/qlogging.cpp:1555:11: warning: 'severity' may be used uninitialized in this function [-Wmaybe-uninitialized]
     slog2c(NULL, QT_LOG_CODE, severity, formattedMessage.toLocal8Bit().constData());
qtbase/src/corelib/global/qlogging.cpp:1535:9: note: 'severity' was declared here
     int severity;

Pick-to: 6.2 6.3 5.15
Change-Id: Ic0d41a024056528cac51a88086ac7e492c94bb4a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-02-18 12:44:40 +00:00
Alexey Edelev
e391022d9c Provide missing variables to the ABI-specific external projects
External projects complain about missing host Qt if its location
is different from the one is used when Qt for Android was compiled,
when building multi-ABI package.
This propagates the QT_HOST_PATH, QT_ADDITIONAL_PACKAGES_PREFIX_PATH,
QT_ADDITIONAL_HOST_PACKAGES_PREFIX_PATH variables to the ABI-specific
external projects.

Amends a88b53f713

Pick-to: 6.3
Change-Id: I97fbaa3c21819dd3e9ad2a3f20fe20e74da27ef1
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-02-18 13:44:40 +01:00
Andy Shaw
a14f2d5914 Windows: use QSystemLibrary instead of LoadLibrary directly
Using QSystemLibrary ensures that it will only use the expected copy of
the system library and not one that has been placed in the application's
working directory or elsewhere in the PATH environment variable.

Pick-to: 5.15 6.2 6.3
Change-Id: Ic4234334f73482b38ee5f06345bf11f8c029edc5
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-02-18 10:02:52 +01:00
Thiago Macieira
4ccd974ada QDebug: unexport most of the class for Qt 7
Only a few helper methods need to be exported.

Change-Id: I74249c52dc02478ba93cfffd16d2e8eac8a13182
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-02-17 22:20:07 -08:00
Ievgenii Meshcheriakov
1e468432f6 Update public suffix list
Fixes: QTBUG-100990
Pick-to: 5.15 6.2 6.3
Change-Id: Icfcc7882be35b85bfd8828c6950e2cf23f7ede65
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-02-18 06:03:49 +01:00
Zhang Hao
72931f4920 Fix UI mismatch when QPrinter::setDuplex
Amends fa854f214a. If user call
QPrinter::setDuplex method, the QPrintDialog explicitDuplexMode value
won't update.

Fix this by:
1) handle device-specific default and value set in QPrinter in
QCupsPrintEngine(Private)
2) handle the explicitly user-selected value in QPrintDialog(Private)

Done-with: Michael Weghorn <m.weghorn@posteo.de>
Pick-to: 5.15 6.2 6.3
Fixes: QTBUG-99504
Change-Id: I1a471a8554e83aa4bec8bb95fcc95f9135b0ac8c
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2022-02-18 12:19:17 +08:00
Zhang Hao
715ed74c89 Sync QPrinter orientation when PageSetup Orientation selected
QPrinter orientation will not effect when PageSetup Orientation selected

Fix this by sync PageSetup orientation property to QPrinter.

Fixes: QTBUG-100261
Pick-to: 5.15 6.2 6.3
Change-Id: I264852ea18317308dfcfb58c880f5e8ad8d299bd
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2022-02-18 09:06:10 +08:00
Thiago Macieira
9e0f1b905a qsimd/x86: lower the target architecture for load-time code
That is, allow QtCore to get loaded and print its "missing features"
text without crashing with an undefined instruction. We'll still
abort(), so it's still a "crash", but it'll happen after the message is
printed.

Tested with Intel's Software Development Emulator[1]:

$ sde64 -wsm -- ./libexec/rcc
Incompatible processor. This Qt build requires the following features:
    fma movbe avx f16c rdrnd bmi avx2 bmi2 avx512f avx512dq avx512ifma avx512cd sha avx512bw avx512vl avx512vbmi avx512vbmi2 gfni vaes avx512vnni avx512bitalg avx512vpopcntdq

[1] https://www.intel.com/software/sde

Change-Id: I6fcda969a9e9427198bffffd16ce8b86524a566e
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2022-02-17 17:02:18 -08:00
Thiago Macieira
b7c37e5978 qsimd: Initialize the current state as soon as QtCore loads
Instead of lazily initializing. We usually don't do this in Qt, but in
this case there are two very good reasons for it:

1) the call tp qCpuFeatures() was not trivial, with the need to preserve
   a bit of state in the caller function across the call. GCC appeared
   to generate better code than Clang in this regard, but it still
   implied more cost than we'd like to do runtime detection in
   performance-sensitive places in Qt.

2) the early initialization allows us to use the detected state in GNU
   indirect functions on platforms that support it.

In order to do this, I had to rewrite the QT_NO_CPU_FEATURE environment
variable parsing without QByteArray and instead rely on string.h's
strtok().

This can't be done for static Qt builds on platforms that don't support
the GNU init_priority variable attribute or the MSVC equivalent[1],
because otherwise we can't guarantee that this bit of code runs before
everything else in Qt. For those platforms, we keep the existing lazy
initialization.

For shared builds in those platforms, we can use the dynamic
initialization. All known linkers will sort the static initialization
code in the order in which the .cpp are linked into the library.

The x86 QSimdInitialized variable will be removed in the next commit.

[1] https://docs.microsoft.com/en-us/cpp/preprocessor/init-seg?view=msvc-170

Change-Id: I6fcda969a9e9427198bffffd16ce885a27f6b9e2
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2022-02-17 17:02:18 -08:00
Thiago Macieira
b2a9646be9 QIODevice::readAll: allow reading from a huge non-sequential devices
On 32-bit systems, the non-sequential device could be pointing to a
device of 2 GB or more in size. If so, we should allow reading up to
the limit (2 GB - overhead), like we do for sequential devices in the
block above.

It could also happen on 64-bit systems, but the chance that you do have
a file bigger than 8 EB is remote.

[ChangeLog][QtCore][QIODevice] Changed readAll() handling of large
non-sequential devices like files that are bigger than the maximum
QByteArray size (on 32-bit systems, just under 2 GB). Previously,
readAll() always returned empty; now it will attempt to read from the
device.

Task-number: QTBUG-100546
Pick-to: 6.3
Change-Id: I74249c52dc02478ba93cfffd16d1a14ac92c77bb
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2022-02-17 17:02:18 -08:00
Marc Mutz
e4fe301a77 QColor: port parsing to QAnyStringView
The private setColorFromString() function was never called from inline
code in Qt 6 (didn't check Qt 5, which doesn't matter for BC purposes).

This is in preparation of adding a QColor::fromString(QAnyStringView).

Change-Id: I265d7c388370e2e7bb417db1573658346aad4690
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-02-18 01:04:42 +01:00
Allan Sandfeld Jensen
40bc850597 Fix bootstrapped AVX512 code
SIMD_ALWAYS isn't defined and function targets not working during bootstrap

Fixes: QTBUG-100817
Change-Id: I3008db3a32d28f9e4285517a6a23198307e236bc
Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-02-17 23:35:41 +01:00