In the qmake-based build, the hostdatadir is the directory where "Data
used by qmake" is located. In the CMake build the equivalent is
INSTALL_MKSPECSDIR. Create the mapping accordingly.
Fixes: QTBUG-88211
Change-Id: I9e3d1af24bc7f41333ef2269fced5ab3fcfa848d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Template type never would've worked, really. We relied everywhere
that 'iterator' is comparable to our iterators (in generic version
it should be even the same type - see std::rotate API) and the
iterator type is castable to T* in POD and Movable cases, so
simplify that, no need for extra template boilerplate
Change-Id: I263ae2ba90ca27abceca01fcc21d80a350bbd743
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Cast enumerations to ushort, fixing:
src/corelib/text/qlocale_win.cpp: In member function 'virtual QVariant QSystemLocale::query(QSystemLocale::QueryType, QVariant) const':
src/corelib/text/qlocale_win.cpp:765:34: error: enumeral and non-enumeral type in conditional expression [-Werror=extra]
As a drive-by, fix deprecation warning about QVariant::type().
Amends 098f43fdd2.
Change-Id: I2adc9833c6d6d9e9d2500f0b92b25cb5d38b583b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Instead of multiplexing all notifications into a single Qt event for
the event dispatcher, we can send 'WinEventAct' event directly for each
notifier which activated. This trick improves the performance (esp.
on a large number of events) and allows us to remove notifiers handling
from the event dispatcher completely.
As an alternative to sending Qt events, use of Windows' APC queue in
conjunction with waking up the Qt event loop from within the Windows
thread pool has been considered. However, that would lead to signal
emission asynchronous to the Qt event loop's operation, which is not
acceptable.
Thanks to Oswald Buddenhagen for the proposed idea.
[ChangeLog][QtCore][QAbstractEventDispatcher] The
{un}registerEventNotifier() member functions have been removed.
QWinEventNotifier is no longer needed to be registered in the
event dispatcher.
Change-Id: I140892fb909eaae0eabf2e07ebabcab78c43841c
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
qtdeclarative's QtQml module adds a dynamically generated qmldir file to
its RESOURCES which is located outside the source directory.
Previously this caused qmake to generate an invalid alias for the qmldir file.
Now the relative path is discarded properly.
Fixes: QTBUG-88204
Change-Id: Ia689d9d110db092cee595bf44fcbb6d57783fded
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Previously, QtDocsHelpers.cmake was invoking CMake to copy
files or directories instead of using installation targets.
This resulted in DESTDIR being ignored.
Now we create installation targets and ask CMake to
install them.
Change-Id: Idbc79d47a37f9ca865d28543bdbbdde3ba448fa3
Fixes: QTBUG-87382
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
We used quint32 for 32-bit types and ushort for 16-bit ones,
but using explicit bit sizes looks more consistent.
Change-Id: I3106dd6ecb2367fef6f8012c28266e1b4b1abf4b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Platform plugins should dispatch events to specific windows when
possible; but eglfs currently doesn't do that, so this warning was
printing for many touch events. Now we print it only if the window that
the platform plugin says *should* handle a touch move or release is
non-null and *different* than the one that actually handled the press.
Fixes: QTBUG-88192
Change-Id: Ia3271b5e67902dcf8a1cdae605adec470c3cfd89
Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
If we always tracked the mouse, we could always have accurate velocity;
but most of the time, when the mouse enters a top-level window, we don't
know how fast it was moving at that time, unless the application has
requested a window-system mouse grab. It's better to assume that any
residual velocity stored in the persistent QEventPoint instance (in
QPointingDevicePrivate::activePoints) is inaccurate, and just start over
from zero. Especially for the sake of autotest sanity.
Task-number: QTBUG-88346
Change-Id: Id6c4fbffb8a86a8ab50a09f09aa62125d10155b4
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
On Windows with -developer-build java and templates files are not copied
properly, this makes sure to copy the files and dir for both targets.
Also, avoid creating a a deployment-settings.json file by adding
"TEMPLATE = aux".
Fixes: QTBUG-87627
Pick-to: 5.15
Change-Id: Iae269c3180a7b6d904fdba2e69fb3f815bbb1211
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Trying to keep the logic self-contained resulted in a race
condition during 'make install', even if the two sub projects
were CONFIG+=ordered.
The approach is now similar to what we have on the CMake side,
where the ldflags and defines end up in the 'interface' module.
Change-Id: Id08a3ca12da8e7fc36ad76124b52ca4c79aebe3b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Extend qt_configure_get_padded_string to make the feature list look like
qmake's.
Fixes: QTBUG-88144
Change-Id: I714f2b2f3537b506365a03b5b6bc3413e9cab167
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
For now, we only support building Qt with the Ninja generator (and
Ninja Multi-Config).
Issue a warning when a different generator is used.
Allow opting out of the warning by passing
-DQT_SILENCE_CMAKE_GENERATOR_WARNING=ON.
Change-Id: I5faa5b0ca5fd42efc090ad2ccf4f896bd77e50ca
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Some outdated changes don't get removed when using special case
preservation, so remove them manually.
Change-Id: Iba1481ab9a924c3031bd5ce394d5183a5393f146
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Useful when cleaning up configure.cmake files that might have outdated
content.
Change-Id: I3872e81b7e896de83c1f6635499316bdbe3acb16
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
As opposed to standalone tests.
The problem is that 4 of the cmake failbuild tests use try_compile as
an indirection layer to configure /another/ project which is actually
the test.
That project needs to know the location of Qt. To do that, a
FindPackageHints.cmake file is included and the variable it sets is
passed to find_package() HINTS option. That's enough to find a
specific module, but not any dependent Tools packages.
Work around that by adding the Qt location to CMAKE_PREFIX_PATH in the
included FindPackageHints.cmake file.
The problem does not happen in standalone tests, because the
Qt location ends up being propagated via the qt toolchain file, which
does get inherited by the compile tests (albeit in a weird way, where
a reconfiguration still shows CMAKE_PREFIX_PATH to be empty).
Change-Id: I1f7ce940fd31678b46c0356edf6581e523cb885a
Fixes: QTBUG-86963
Reviewed-by: Andreas Buhr <andreas.buhr@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
When configuring a Windows build with NMC and
"CMAKE_CONFIGURATION_TYPES=Release;Debug", then with CMake 3.18.4 only
the targets of the main configuration would get the version resource
compiled in.
With 3.19.0 RC 2 the problem cannot be observed.
Work-around the issue by revisiting our work-around of another CMake
issue: use just one object library per target to embed win32 resources.
This works with both tested CMake versions and seems cleaner anyways.
Fixes: QTBUG-88267
Change-Id: I20f596ab669ae716c330d7aa60aa717b9e3e4aa7
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
In configure we need to set the Release configuration first to make it
the main configuration.
Change-Id: I5fe744b0dcea009c4d672bf519b38c80c87475dd
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
The RegisterMethodArgumentMetaType had been changed to take a QMetaType
instead of a type id in 0161f00e50.
Unfortunately, the usage of it in QSignalSpy was missed. This patch
adjusts the metacall to correctly use a QMetaType.
Moreover, use parameterMetaType instead of parameterType to benefit from
metatypes which are already resolved at compile time.
Task-number: QTBUG-88260
Fixes: QTBUG-88356
Change-Id: Id8fa46581a005d62818971ea24d8aa2e39dcd6d0
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
QSinglePointEvent no longer has public constructors: we don't expect
users to construct instances, because it's conceptually an abstract
base class (even though some subclasses don't add more storage).
We give it a Qt::MouseEventSource argument so that m_source won't
need to be set in other subclasses. There was some hope of removing
MouseEventSource completely, but it hasn't been done, for the sake of
avoiding SC breaks.
Change-Id: Iea2946699726fb7ac98757b7b8f1b7cfdccc1449
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Followup to a37785ec76.
The mouse button that caused the event and the current state of all
mouse buttons must always be given separately in QPA mouse events.
Task-number: QTBUG-59277
Task-number: QTBUG-62329
Task-number: QTBUG-63467
Change-Id: I27209b3730baef325ce0f1c4d3778930e72d5465
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
Since native applications allow CMD+H to hide an application when the
tooltip is visible then we should do too. Other popup windows will
still block the call.
Pick-to: 5.15
Fixes: QTBUG-82626
Change-Id: Ieac86d6b3cb2152a3ba82d8bd850f13bfeedb7c8
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
In multi-config builds (which equals the debug-and-release feature) we
exclude tools of the non-main configurations from the default build.
But we still create installation rules for them. Mark those as optional
to avoid "cmake --install" yielding errors if those tools weren't built.
Fixes: QTBUG-85411
Change-Id: Ic2d3897d1a1c28a715d9a024ec8606fff00e0315
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
A key piece of information missing from Q_PRIMITIVE_TYPE
documentation is that for them value initialization must equal
memset()ting with zeroes. A type like QPoint is primitive
because `QPoint p;` is initialized to (0, 0), but a type like
QSize is movable (and NOT primitive) because `QSize s;` is
actually initialized to (-1, -1). Amend the docs.
Change-Id: I121684810da46be5d0579c7d3de945149390a32a
Pick-to: 5.15 5.12
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Use the property=value format consistently for the QPointerEvent types.
Abbreviate property names for compactness, but show more info.
Omit device seatName(), pointerType(), capabilities(), maximumPoints()
and uniqueId() when they are uninteresting. In the case of uniqueId()
it's uninteresting when it's not valid (-1) rather than when it's 0.
Add QMouseEvent::scenePosition().
Change-Id: Ia076c5958e8f7032929517401d332b07d2fd0e78
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Amends 47bcc4dd4b : m_kbdMgr was moved
up to the protected section, so now it must be inited first.
Change-Id: Iad28900affa7ab67122c4a6d1ec9161e2e1c7697
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Make zstd config based lookup quiet and check for version variable
as required for ZSTD target.
Add IMPORTED_LOCATION by default for pkg-config based search.
Expect that select_library_configurations will set correct value
for ZSTD_LIBRARY.
Fixes: QTBUG-88091
Change-Id: Ia5079154ce4fc4eefbc0931317219b5ca0f3f82f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Modify pro2cmake converter to add extra argument to
qt_internal_add_plugin. DEFINE_IF FALSE is added to generic plugins
those had "PLUGIN_EXTENDS = - " specified in .pro files.
Fixes: QTBUG-87861
Change-Id: I9269df19a32a088f5261f50e7ffff6d29c3d605f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Depending on the presence and behavior of HEADER_MODULE/header_module
in CMake and qmake land, the module.pri might end up with an empty
module line, which means adding the module via QT_PRIVATE += entrypoint
will not link to the static library.
To avoid this problem we write an explicit module entry (QT.foo.bar)
into the same module.pri file as the one generated by qt_module,
where the auto-generated one has header_module enabled, and hence
no link behavior, while the manually written entry has a module
component, and will ensure linkage to the static library.
Change-Id: Ib98484f74410fab45c4d109f3610028200fba0c5
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
The QT.foo.module entry is used for linkage, so we shouldn't
add it for header only modules.
Change-Id: Ibb6e7ab08083ccab11d7e060f35c54153e3751c0
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Emplace() implemented with std::rotate is just awful on my system
(Ubuntu 18.04 GCC 7.5.0). Custom code is much faster, so go for
it. Cannot really use insert() code, which is also fast, because
it doesn't forward-reference values but copies them always
Changes in performance (approximately) for emplacing 100k elements
into the middle:
Complex 7600ms -> 1700ms
Movable 7600ms -> 200ms
Task-number: QTBUG-86583
Change-Id: If883c9b8498a89e757f3806aea11f8fd3aa3c709
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This speeds up some of the operations.
Change-Id: I5195ba79df92ead8e8003aa82681703e8c3afe99
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Use std::move() in QGenericArrayOps::erase() when assigning over the
to-be-deleted range
Task-number: QTBUG-86583
Change-Id: Ib28c5c1f1593beba5fce6841dd6fcecfdfb166ad
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Use move operations to move existing items instead of copying
them. This speeds up insertions for non relocatable types
significantly (e.g. for std::string).
Change-Id: I308f381ac2242e50505f02675c2d2afbf21069d1
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This is in line with Qt 5 behavior, how std::vector works and also
how QString and QByteArray behave. If you need the shrink allocated
storage, call squeeze() manually.
Change-Id: I16cadd4f2a89bb2ec5de02fe69186f5da321cd06
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This avoids lots of the code and checks in remove() making the
methods a lot faster.
Change-Id: If99c39f5b55672b341f9331b5903bf77e9e67477
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Avoid crashes when calling squeeze() on a QList with non zero capacity
but zero size.
Change-Id: Id470b2d52266a345b94bc3dc5483f4668fbb57dc
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
While simplifying uses of QSystemLocale::query() I declared a
shadowing local variable instead of setting a function-scope variable
that the code had previously set. Restore prior correct behavior.
Fixup for commit b5bc3ee036.
Fixes: QTBUG-87858
Change-Id: I6bd64aef1eb7df9ec4a703c59aa7369245ab2472
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reaches into the internals to avoid erasing one entry at a time from the
QHash.
Change-Id: I47079592d130d2ecd844998dfa31e633e049d4c1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The filters used to construct regular expression is the parameter of
QDirIteratorPrivate constructor,and not the member variable
'filters' of QDirIteratorPrivate.
When using filters as QDir::NoFilter to construct QDirIteratorPrivate,
then the regular expression will incorrectly initialize with
QDir::CaseSensitive(result of QDir::NoFilter),and not
Qt::CaseInsensitive(result of QDir::AllEntries).
Therefore, using the '_filters' to replace the parameter 'filters'
Fixes: QTBUG-88227
Pick-to: 5.15
Change-Id: I8a21fe1075fd95981e328a161a978e4fe546c9ca
Reviewed-by: Simon Hausmann <hausmann@gmail.com>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
The pcre2 feature was turned off when the user passed -system-pcre to
configure. The reason were faulty expressions in the enable/disable
fields.
Fixes: QTBUG-88295
Pick-to: 5.15
Change-Id: I4edee49a9c797797ef3b80f955b48b5492fb4fc7
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>