Remove target specific flags from static_link_order.
Move the check to the common config.tests folder.
Amends 5fb99e3860
Pick-to: 6.2
Task-number: QTBUG-93002
Task-number: QTBUG-94528
Change-Id: I1368075ec6bd1e743b2b89fd93143df38a278ec2
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Only depend on the ${project}_src and ${project}_tools targets.
This might exclude some non-obivous target dependencies, but we can
adjust that if needed.
This reduces the build.ninja file of qtbase + qtsvg form 341MB
to 41MB when configuring with tests and examples, as well as reduces
the processing time of calling ninja.
Amends d97fd7af2b
Pick-to: 6.2
Change-Id: I2860d8ae89728f33f6b73fede1335cd6d6290f78
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
It was suppressed unconditionally (albeit in different places and with
different levels of obviousness) almost everywhere, due to inability
to set the system locale in use by the implementation. Several
test-cases used ISO-8859-1 encoding on Q_OS_MAC, where the tests were
all suppressed anyway. A block of no_NO tests was #if 0'd out; and
should, in any case, have been nb_NO. Tests of any locale but en_US
were skipped on Q_OS_WIN because we can't set the locale (but
including the tests of en_US tacitly assumed that's the system
locale). If setlocale() failed, for ICU or DARWIN, the test was
skipped; but we might as well check for this in the _data() to save
repetition.
The test was laboriously going through the sign cases; relocate the
QString::compare() test's sign() function so that we can use it here,
too, and simply QCOMPARE() signs. Introduce a TransientLocale class,
copied from tst_QLocale, to take care of setting and restoring the
locale using setlocale(). Change the locale name to a QByteArray so
that we save having to convert it to one in order to pass it to
setlocale(). Since that changed every _data() row, reformat those rows
in the process - most of them were long lines.
On the systems where we can't set the locale used by the function
being tested, condition each block of tests in the _data() on whether
LC_COLLATE looks like the locale to be tested, and report how a
determined developer at least can (by repeatedly running the test with
different locales set) test all the cases; and we'll attempt the ones
that we can, when one of the relevant locales is in use. If that
leaves us with no tests we can do, QSKIP() in the _data() to avoid an
assert failure for "Test data requested, but no testdata available."
Change-Id: I75709fda8827dcbe74f80c4136042054da6fcb13
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
For user projects we run the static link order check once
'find_package(Qt6 ...)' is called.
If linker can resolve circular dependencies between static libraries
and object files we set the _qt_link_order_matters property of the
Qt::Platform target. This indicates the use of finalizers is not
required and we may rely on CMake-base propagation of resource
libraries and resource object files.
If linker could not resolve circular dependencies depending on
the _qt_resource_objects_finalizer_mode value:
- Finalizer will be called and collected resource objects will be
linked to the target directly.
- Finalizer will be omitted and resource objects will be linked
using the target_sources function implicitly. This only
propagates resource one level up if consumer links the static
library PUBLICly, but all symbols will be resolved correctly
since object files are placed in the beginning of the linker line.
In the CMake version 3.21 we expect that CMake will take care about
the order of the resource object files in a linker line, it's
expected that all object files are located at the beginning of the
linker line.
TODO: Need to confirm that the CMake 3.21 meets the expectations.
Amends 4e901a2f99
Pick-to: 6.2
Task-number: QTBUG-93002
Task-number: QTBUG-94528
Change-Id: Ia68976df8182d3d3007b90c475c1e3928a305339
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
The kludge previously implemented for handling dates outside the
supported time_t range, by asking for a corresponding date in a year
in the range, had a comment remarking that this is broken due to the
wrong day of the week and, consequently, the placement of DST
transitions, e.g. those scheduled by the last Sunday of a month,
happening on different dates in the year asked about and the in-range
year passed to the system time_t functions.
This can be handled by selecting a year in the time_t range which has
the same pattern days of the week (and length of the year, i.e
leap-ness). That may (particularly for leap years) need to select a
year far from the end of the range (and there may be a change to the
zone's rules between the selected year and the end).
Change-Id: Ia353b2cc7b7d266b7abf80e37cac61544ce95c2d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
System V semaphores are not supported in sandboxed applications,
so when Qt is configured with App Store compliance, or the user
requests POSIX IPC explicitly, we use that instead.
https://developer.apple.com/library/archive/documentation/Security/Conceptual/AppSandboxDesignGuide/AppSandboxInDepth/AppSandboxInDepth.html#//apple_ref/doc/uid/TP40011183-CH3-SW24
As the shared memory name limit on Apple platforms is very low,
we have to skip the existing logic for naming, and instead use
a truncated hash of the key. This should still be fine for
avoiding any collisions in practice.
An explicit check for the ENAMETOOLONG error has been added to
catch any cases where they key goes beyond the allowed length.
Sandboxed applications also have an extra requirement that the
key must include an application group identifier. This requirement
has been pushed up to the user and documented, as we don't have
enough information in Qt to know which identifier to use.
Both tst_QSystemSemaphore and tst_QSharedMemory work as before
with both sandboxed and non-sandboxed applications, after removing
some assumptions in tst_QSharedMemory about System V behavior.
Fixes: QTBUG-91130
Change-Id: Iaf1edb36a5d84d69e42ec31471a48d112faa8c6a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The documentation says that if we "pass a URL to the main
executable of a bundle, the bundle as a whole is generally
recognized.". By passing the executable instead of the
bundle we include command line applications that don't
have a app bundle folder (but have an embedded Info.plist).
Pick-to: 6.2 6.1 5.15
Change-Id: I3a2f145c1ec6e16607e9c04baf08678d5dea0b81
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Abort the system move/resise at XCB_INPUT_TOUCH_END.
Limit the behavior only on supported platforms, such as KDE and
OpenBox.
Change-Id: I53c86979ca56f4de8c5cf2807f781abdad6987b2
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
We can't get mouse release event from master pointers after
QXcbWindow::doStartSystemMoveResize() which calls xcb_ungrab_pointer(),
it looks like most X11 WMs work as that.
So we try to get mouse release event from slave pointers.
Based on https://specifications.freedesktop.org/wm-spec/1.4/ar01s04.html
, we need to send _NET_WM_MOVERESIZE_CANCEL when we get mouse release
event.
Task-number: QTBUG-91077
Change-Id: I01e74a01c87b381ee7cd6f20d51a1fa61c0e98fc
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Consumers can now check the "debug" feature to determine whether Qt was
built in the "Debug" configuration.
Pick-to: 6.2 6.1
Change-Id: I225125d38ded508e9792a730ce421b33bceacddf
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Amends 16f927a4f1.
At the time the original change was written, QStringTokenizer
had not been integrated, yet.
Change-Id: I83c31d816199bc48c4baea855d13cbf9eda9aaa2
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
PAGESETUPDLG's hDevMode reports the page size and orientation selection
of the user, so read that data to get accurate results.
Otherwise, the page size of a landscape page wouldn't match any known
page format, and we'd end up with a custom size that would not be valid
for the preview, breaking the preview UI's orientation state.
Reuse the helper from QPageSize to map Windows page size ID to our own
enum.
Fixes: QTBUG-93764
Pick-to: 6.2 6.1 5.15
Change-Id: Ib9a848619e3ba8780264ad76ed43c4fffae6b07f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Since there is no header then the cells appear with no actual border so
it can look a bit strange without it. This ensures that the border is
at least shown when there is no header to represent it if the style hint
is turned on. This gives an option for those who want it to have it
turned on.
Fixes: QTBUG-85523
Change-Id: Ib94874bddddd31738fbcd41c6f77a2e0fa2ef443
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
CMake 3.21 introduced a new IMPORTED_TARGETS directory property which
we can use to promote all imported targets within a scope to be
global.
This would cover transitive non-Qt imported targets which the Qt build
system does not know about and is thus a more complete solution
compared to promoting only Qt targets.
Run a finalizer at the end of the directory scope where
find_package(Qt6) is called to promote all imported targets within
that scope to global (when requested).
The old promotion method is disabled when the CMake version is new
enough.
Pick-to: 6.2
Task-number: QTBUG-92878
Task-number: QTBUG-94528
Change-Id: I533a3bd4186eba652f878ddd72c76118c2fd8bae
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
User projects can set the QT_PROMOTE_TO_GLOBAL_TARGETS variable to
true so that the various imported targets created by find_package(Qt6)
are promoted to global targets.
This would allow a project to find Qt packages in a subdirectory scope
while using those Qt targets from a different scope.
E.g. it fixes errors like
CMake Error at CMakeLists.txt:5 (target_link_libraries):
Error evaluating generator expression:
$<TARGET_OBJECTS:Qt6::Widgets_resources_1>
Objects of target "Qt6::Widgets_resources_1" referenced but no such
target exists.
when trying to use a static Qt from a sibling scope.
Various 3rd party dependency targets (like Atomic or ZLIB) are not
made global due to limitations in CMake, but as long as those targets
are not mentioned directly, it shouldn't cause issues.
The targets are made global in the generated
QtFooAdditionalTargetInfo.cmake file.
To ensure that resource object libraries promoted, the generation
of the file has to be done at the end of the defining scope
where qt_internal_export_additional_targets_file is called,
which is achieved with a deferred finalizer.
Replaced all occurrences of target promotion with a helper function
which allows tracing of all promoted targets by specifying
--log-level=debug to CMake.
Pick-to: 6.2
Fixes: QTBUG-92878
Change-Id: Ic4ec03b0bc383d7e591a58c520c3974fbea746d2
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
The iOS port creates one QIOSViewController per connected
screen. And each view controller listens for changes to
the application state. The problem is that we never
disconnect this connection again. So if a screen is removed, and
the corresponing view controller is deallocated, the
connection is still kept alive. This will cause crashes to
occur when the signal emits, since the slot will then be accessing
deleted memory.
Fixes: QTBUG-76948
Pick-to: 6.2 6.1 5.15
Change-Id: I758e51af9297cd62de193aae825f4475a2c7c3e5
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Makes it able to catch the last bug of saturating color values above a
certain value.
Change-Id: Ib2a3918623a1defe2981efe61cf8118e019e9d4b
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
This reverts commit 03eb44394e.
Reason for revert: This breaks the dependecy update round in dev now. The revert can be reverted again after
1) Full dependency round is succeed in 'dev'
2) Android extras submodule has been removed from qt5.git#dev (7aa41d22fa485f212aebbef500ea91921c7bc38b)
3)qtmultimedia has been ported to use new api instead of this old one
4) Full dependency round with all above is succeed in 'dev'
Change-Id: I23241d2a90307074ecfc9573d2b58baba1874cfc
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Fixes build issue "no instance of overloaded function "qHash" matches
the argument list" on INTEGRITY
Pick-to: 6.2
Change-Id: Ia1273587840d55199846dc64d487d194f9a4d565
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Fix various C4244 warnings with the MSVC compiler for 64 bit
Proposed upstream fix:
https://github.com/mity/md4c/pull/162 for an upstream fix,
Pick-to: 6.1 6.2
Change-Id: I2ac1c17febb4fb269ac7244458f4cd90ce8b8e49
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
If we don't find it we can't link to it, and then the example will never
have any print functionality, in spite of having the UI.
Pick-to: 6.2
Change-Id: Ib84be39a2655253c7d643520487adee054d5bd2d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Update the bindable property docs to explain how to deal with virtual
getters and setters.
Task-number: QTBUG-92994
Pick-to: 6.2
Change-Id: I6c29011817e83623414b39afee0f39ad4cc5c1c9
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
The link, allegedly to the pcrepattern(3) man page, was in fact a link
to a .txt file giving an over-view of the pcre library, but not
describing the pattern syntax. Link, instead, to the actual HTML
version of the pcrepattern(3) man page.
Change-Id: I566fa5185b909bceb51dfe9f253c98f858f6a182
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Previously, it went direct to QTestResults::addFailure() without going
via the checking for expected failure. Add QTestResults::fail() to
take care of this checking, as for verify() and compare().
Tidied up the code implementing expected failure and QFAIL(), while I
was about it. Adjusted an existing test to verify that expecting a
QFAIL() works, by using QFAIL() instead of QVERIFY(false).
Remove the QVERIFY(false) whose comment brought this to my attention.
[ChangeLog][QtTestLib][QFAIL] QEXPECT_FAIL() now correctly anticipates
a subsequent QFAIL(). Previously QFAIL() counted as a fail regardless.
Change-Id: Icc28cf70e5ff3006363791ea03aa01f2f591eb71
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Automatically set compilers based on old mkspec style target
Pick-to: 6.2
Change-Id: I80404376964a85c6b519657c054d008da47aed91
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
In commit 287ace562e, part of this test
was suppressed without filing a Jira ticket (or, at least, without
recording it in the QSKIP message). Since it's a known failure, it
should at least be a QEXPECT_FAIL, not a QSKIP. Since only some of the
subsequent parts of the test fail, I used QEXPECT_FAIL(,,Continue) on
each of the failing tests.
Task-number: QTBUG-94450
Change-Id: Iebc6801210c289b4502e59116e71d5901b71aa46
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Its collation (and everything locale-related) is only supported during
the lifetime of QApplication.
Change-Id: Ide97795664d45768e66248d47c3b1da83935b0d6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Various QDateTime tests relating to transitions
* used a nomenclature that made them confusing to thing about; and
* expected identically-initiallized variables to behave differently.
The latter, naturally, lead to "expected fail" tests.
Rewrote the tests to get the date-times they want to test at by means
that avoid the ambiguities inherent in QDateTime's lack of a way to
distinguish the two passes through the repeated hour in a fall-back
(QTBUG-79923) and added commented-out tests indicating what should be
true once that ambiguity is resolved. Verified the DST status is as
expected in the cases where that's the correct distinction between
date-times with the same date and time. Renamed various things to
(hopefully) make them more intelligible.
In the process, purged some leading 0s from numbers in code.
Fixes: QTBUG-68936
Change-Id: Id7a348995238b70dcb81a96edb8a3fa5315f86fa
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This test failed when checking for a pre-condition of the tested scenario,
so skip the test if that condition isn't met, as the test won't test
anything.
Amends b1fdcc8c0f.
Pick-to: 6.2 6.1 5.15
Task-number: QTBUG-64543
Change-Id: I135cd5b45efcae111305b9be338eb5429d3b97d5
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
This fixes the "Command line is too long" error when building a project
with many object files for WASM on Windows.
Fixes: QTBUG-94032
Pick-to: 6.2 6.1 5.15
Change-Id: I29251da9795b267c968da86617da0311bf882a64
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
The tool used QCoreApplication::translate(), but did not attempt
to load a QTranslator. Use QStringLiteral() instead.
Pick-to: 6.2
Task-number: QTBUG-75870
Change-Id: Ib3c6b1893889a82b186a310c0c725dbf1a1885b3
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
There are multiple macros used to get/check and return with error
in case the requested object is not valid. These macros are defined
in multiple places and duplicated. This patch defines them in one place
and then they can be reused.
This macro expects a "char m_qtTag[]" variable to be defined in
the scope where the macro is used. That variable is used as a tag
for the error message printed when an error occur.
Another consecutive patch use the new macros over qtbase code.
Pick-to: 6.2
Change-Id: Ibb8558d1229cec6dad9ec9da6e2635ea54fd18d6
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
This change allows temporarily removing the EXTERNAL_BUILD option in
a qt repo examples project to check how the examples behave in a
non-external project build, without forcing the developer to use a
prefix build.
Useful to compare behavior until we've ported over prefix builds to
use EXTERNAL_BUILD.
Amends d97fd7af2b
Change-Id: I29b834bb5f00e1e93966caae6f816faedba76b76
Reviewed-by: Craig Scott <craig.scott@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Move QT_END_NAMESPACE macro out of the #ifdef definition
Pick-to: 6.2 6.1 5.15
Change-Id: I26b4e263b5ae0acebf035dbfe8c7e287cd740190
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
It may change in the future.
Change-Id: If65bf690b12d4e6474557d7a48567941b18413bf
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Clazy warns about the fromUtf8() call with a constant argument, for
every use of the macro, so hide the stuff behind a compiler firewall.
Also fix the format injection error by using QLatin1String::arg()
instead of QString::arg() chaining.
Change-Id: I4bb4d4af56443540efc0c38c75819aa152a441fc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Also, a minor clean-up: isMatchingHostname() overload
was never used, deleted (and it could not be used safely,
since it requires the name to be normalized first).
The file (qtlsbackend.cpp) was re-shuffled, to have
backend on top of the classes which this backend
is factory for.
Pick-to: 6.2
Pick-to: 6.1
Fixes: QTBUG-91929
Change-Id: I435c69b167f57f7c3f76e34449c52f665dc6f7c2
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This makes qt_internal_disable_find_package_global_promotion available,
which is needed when linking against QtMultimedia in a static build
Pick-to: 6.2
Change-Id: I9b8f6d7b74a8693ac471f8a280e893f4da80a44b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
It's no longer used today.
And while we're at it: delete or fix typos in some nearby comments
Change-Id: Ib52268eeb936e71d6c09aece2e0833b99309ef2d
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
SETTINGS for max concurrect number of streams is 'one direction' - this
is how our peer conveys the possible number of streams _we_ can open,
not _them_. If they choose to have it unlimited - let it be so.
It's possible to send 0 as maximum number, also, it's possible to
reduce the maximum compared to initial at some point - then I have
to avoid integer overflows.
Pick-to: 6.2
Pick-to: 6.1
Pick-to: 5.15
Fixes: QTBUG-94470
Change-Id: Ia02247acbaedd70998a4cab02082ba10f45cf78c
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>