After the discussion we concluded that QT_HOST_PREFIX should not
completely replicate the QT_INSTALL_PREFIX behavior.
So this patch implements the following logic if qt.conf is provided:
1. Prefix is not set
a. If HostPrefix is not specified, then QT_HOST_PREFIX will be set
to the folder containing qt.conf.
b. If HostPrefix is specified and is relative, then QT_HOST_PREFIX
will be relative to the folder containing qt.conf.
2. Prefix is set
a. If HostPrefix is not specified, then QT_HOST_PREFIX will have
the Prefix value.
b. If HostPrefix is specified and is relative, then QT_HOST_PREFIX
will be relative to the folder containing the qt.conf.
The logic might change in a future commit to use the current application
directory instead of qt.conf path, since the use of qt.conf is dictated
by the bootstrap library and this is no longer the case.
Fixes: QTBUG-93707
Change-Id: I5460c97c45924bb8e0c95493afdb9585994c5f28
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
It's now a data-only module. The callers of its code-to-ID functions
have, for some time now, been rearranging its mappings to get at data
efficiently.
Change-Id: Ia16dcaa767203cdf3b81a96bd51793491ad41563
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
The BASE argument of qt_add_resources now denotes the root point of the
alias of the file. Before, BASE was merely prepended to every file that
got passed to qt_add_resources.
Old behavior:
qt_add_resources(app "images"
PREFIX "/"
BASE "../shared"
FILES "images/button.png")
Alias is "../shared/images/button.png", and pro2cmake generated
QT_RESOURCE_ALIAS assignments to fix this.
New behavior:
qt_add_resources(app "images"
PREFIX "/"
BASE "../shared"
FILES "../shared/images/button.png")
The alias is "images/button.png". No extra QT_RESOURCE_ALIAS assignment
is needed.
The new behavior is in effect for user projects and for Qt repositories
that define QT_USE_FIXED_QT_ADD_RESOURCE_BASE. Qt repositories will be
ported one by one to this new behavior. Then the old code path can be
removed.
Pick-to: 6.1
Task-number: QTBUG-86726
Change-Id: Ib895edd4df8e97b54badadd9a1c34408beff131f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
- Use initializer lists
- Use u instead of QLatin1String()
- Fix some clang warnings about else after return, constFirst()
- Streamline code
- Remove slot TextEdit::printPreview() which is not needed
- Rename variable fileName to pdfFileName in filePrintPdf()
to disambiguate from this->fileName
Pick-to: 6.1
Change-Id: I377ebfd13487470b6f8eaf568dd5d99354f761f2
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
This is to allow other repos like qtdeclarative to more easily pass
through supported arguments to qt_internal_add_module() from their own
functions.
Task-number: QTBUG-88763
Change-Id: I965d593de4c6f9d5295a0d427c32dc3d5b1bb639
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
- Explain why a symlinked build dir won't work
- Add another workaround suggestion that works well in my case
Change-Id: I3f7eaeac2974e037587941f6f761fbcb262c4631
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Use QFlags::testAnyFlag instead of relying on implicit conversions.
Change-Id: I7ac8149535ad28e47fbf3e250042892bdf8c3a72
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Use toInt(), or an explicit cast. (I don't quite know why an atomic int
is involved here, but anyways, it makes these casts necessary.)
Change-Id: I8816ef96bd69a6f3e3f8e025e567e3451069462c
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
QItemSelectionModel has the property selectedIndexes with
the notification signal selectionChanged. When a row is deleted
or inserted above the current selection, the row number of the
current selection changes and thus the return value of
selectedIndexes changes. This should trigger its notification
signal.
This signal was not emitted. This patch fixes this and
adds a unit test to verify this.
[ChangeLog][Important Behavior Changes][QtCore]
QItemSelectionModel now emits the selectionChanged signal
if only the indexes of the selected items change.
Fixes: QTBUG-93305
Change-Id: Ia5fb5ca32d658c9c0e1d7093c57cc08a966b9402
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: David Faure <david.faure@kdab.com>
This allows modules to set custom timeouts for the builds.
Works by modules setting the CMAKE_BUILD_TIMEOUT and
CMAKE_BUILD_OUTPUT_TIMEOUT in the module's module_config.
Change-Id: I6f0170d77e9a962fb37e171d1c0d8c7b2277bb96
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
"Cherry-pick" of C++2b's std::to_underlying.
[ChangeLog][QtCore][QtGlobal] The qToUnderlying function has been
added, to convert an value of enumeration type to its underlying
value.
Change-Id: Ia46bd8e4496e55174171ac2f0799eacbcca02cf9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Not just a compile-time one (that the macros compile and don't
raise warnings).
Change-Id: I5642bf242a6c26a33730708f3c1710237fc107a2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The boostrap library is built with exceptions disabled, and its
sources include qglobal.cpp. Therefore, the file must work when built
w/o exceptions.
Amend/partially revert 282b724808 with
the necessary fixes.
Driveby, cleanup an unnecessary QT_THROW (just throw, if we do have
exceptions).
Change-Id: I370c295c21edd3d81a9fa670e60909b29d1c68aa
Pick-to: 6.1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
The dependencies to moc, uic and rcc have already been handled by
qt_manual_moc(), qt_enable_autogen_tool() and
_qt_internal_process_resource().
This allows not building some of the debug executables in a
multi-config scenario.
Task-number: QTBUG-88414
Change-Id: I6c162721f3ddf6b4b410345ad012073abbdfd9df
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Before, building ${target}_make_apk always re-built the apk, instead of
rebuilding the apk only when inputs changed. This patch fixes that by
moving the creation code from a custom target to a custom command with
proper dependencies.
The androidtestrunner tool now does not check for the existence of an
apk anymore and always runs the make command that is supposed to build
the apk.
The ${target}_prepare_apk_dir target is not needed anymore by the Qt
build but is still used by Qt Creator's Android support. Add a
clarifying comment.
Fixes: QTBUG-93431
Change-Id: I00d65d616fef9511b03b65f879c4bc6cb92dfc30
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
The documentation for QCoreApplication::exit() even refers to it as
such. Instead of refactoring the documentation to explain that it isn't,
just make it a slot and do the same for the other classes.
Complements 2e6c37fe51.
[ChangeLog][QtCore][QEventLoop] exit() is now a slot, like quit().
[ChangeLog][QtCore][QThread] exit() is now a slot, like quit().
Change-Id: Ic42004c9bf71440eb433fffd167f4a1b89bcac80
Reviewed-by: David Faure <david.faure@kdab.com>
Q_IMPORT_PLUGIN generates a global static symbol that initializes a
plugin. If this symbol is added to a static library and the library
is then linked to an executable, the linker decides that the symbol is
unused (because nothing references it) and discards it.
This means there's no point to compile the Q_IMPORT_PLUGIN containing
files into static libraries.
Change the generator expression we use for plugin propagation via
associated modules to not compile and link the plugin initialization
object file into a static library.
Pick-to: 6.1
Task-number: QTBUG-80863
Change-Id: Ide32c0124c1e313c352a72280ce32ce9fbe8fff1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
A previous change to fix QTBUG-85431 has caused this issue by emulating
the behavior of the non-enhanced mouse event handler in a particular
case, where mouse move events that did not change position were ignored.
However, some of these events seem to be involved in the dock drag&drop
implementation. This issue is also reproduced in pre-5.15 releases,
predating the QTBUG-85431 fix, by disabling the enhanced mouse event
handler by setting the QT_QPA_DISABLE_ENHANCED_MOUSE env var. However,
the ignored events in the current issue seem to be non-client events
only, while the QTBUG-85431 issue was related to client mouse events.
So we can restrict the test added in the QTBUG-85431 fix and have both
issues fixed.
Fixes: QTBUG-92182
Pick-to: 5.15 6.0 6.1
Change-Id: I98c0c8597912c7f4fe58af375a5a560695a82746
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Since commit f5c69a5195 the examples/widgets/painting examples could
not be built standalone anymore.
Move the find_package calls out of the examples/widgets/painting/shared
subdirectory and add a .cmake file that can be included to use the
library conveniently.
Change-Id: I35cb5bd8419a67c782d109104c4a88d64477a8be
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
There's no need of converting a QFlags to int in openExternalFile's
signature; just use the flag.
Also, avoid an implicit QFlags->bool conversion by using testAnyFlag.
Change-Id: Ia2d560bce235c842745d8a6a5fb5d8ac0851fc47
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Turn some implicit conversions into calls to QFlags::testAnyFlag.
Change-Id: I755f8a1afb1ff02e823e747e021e9744d68b4f62
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Turn some implicit conversions into calls to QFlags::testAnyFlag.
In one case, move some code using QFlags operators *after* such
operators have been declared by the right macro.
Change-Id: Ib5713f028ce74d1c9054b87cc12eea5715f2bc94
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Turn a couple of implicit conversions into calls to QFlags::testAnyFlag.
Change-Id: I21a0b4c1644986a98a2d0d54ae4b95f9fdc92841
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
There's no reason to be storing `int` in the array data header and
then using it as a QFlags. Just store the QFlags.
Change-Id: I78f489550d74d15a560dacf338110d80a7ddfdd2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Turn an implicit conversion into a call to QFlags::testAnyFlag.
Change-Id: Idbd80bb6a9b5d84952b76d8d7544f617fe693b91
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Turn an implicit conversion to bool in
* a call to testAnyFlag in one case;
* a comparison against 0 in another case, for consistency with the
surrounding code.
Change-Id: I1eee42ba82c59a72430bf507ea80408c553be889
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Turn a cast into a call to QFlags::toInt(), plus a cast.
This is in preparation for a future patch that will remove the
implicit conversion. So why not casting directly? Because we don't
know if the QFlags is backed by int or uint, so using the wrong
cast won't compile; and we MUST pass unsigned because of the %x
specifier. Granted, one could've used a static_assert, but I prefer
a more flexible and idiomatic solution.
Change-Id: I32a3e0ed69b925e8d56268ec84d9e668ca540188
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
It seems that QtCore could only be compiled with exceptions enabled.
Therefore it doesn't make sense to keep conditonal code under
QT_NO_EXCEPTIONS in qglobal.cpp. qTerminate may be called whether
exceptions are enabled or not.
Pick-to: 6.1
Fixes: QTBUG-93739
Change-Id: Ie49c10f27cfa75360f018e8638603e6a1791450e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Just use the original QFlags. Drive by, use testFlag to check if
it contains a given value or not.
Change-Id: I4d5e8454df33a3f4727855d55f7587143450dda6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Turn some `flags & bit` statements that rely on QFlags->int->bool
implicit conversions, into some more idiomatic `return
flags.testAnyFlag(bit)`. This is in preparation for a future patch, and
to avoid inserting casts (return statements do not contextually convert
to bool).
* Remove a magic constant, replacing it by the symbolic one.
Change-Id: I62fc2b2bf6f0ab8fad121edd19cb2ea0d9e3582a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
For 32-bit systems. They're not important (to me), but might as well fix
this oversight.
Change-Id: I755911ae7d0341f49039fffd167b26617db93354
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
QFlags was lacking a named function for testing whether a QFlags object
contains _any_ of the bits set by a given enumerator/other QFlags.
Drive-by, add testFlags taking a QFlags, not just an object of the
enumeration; and simplify the implementation of testFlags to more
closely follow what its documentation says it does.
[ChangeLog][QtCore][QFlags] The testFlags, testAnyFlag and
testAnyFlags functions have been added.
Change-Id: Ie8688c8b0dd393d34d32bc7786cdcee3eba24d1c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
As is the case in Qt for Python, causing:
QtCore/qcoreapplication.h: In member function I* QCoreApplication::nativeInterface() const:
QtCore/qcoreapplication.h:163:5: error: reference to TypeInfo is ambiguous
163 | QT_DECLARE_NATIVE_INTERFACE_ACCESSOR
Amends 7feeb7c34b.
Change-Id: I7d363e1d8c0a0f648d12f8040afb9d071356cbb8
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Since the correct accessibility traits for EditableText are not
available as a direct enum value, then we depend on the defaults for a
UITextField to give us this information.
Done-with: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Fixes: QTBUG-93494
Pick-to: 6.1 5.15 5.12
Change-Id: If428414aec5ce571f0f8c0ecccffdbaf1c908120
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Since you can pass a define to org.gradle.jvmargs that can have the
name=value approach, then we need to ensure that this is accounted for.
Task-number: QTBUG-88989
Pick-to: 6.1 5.15
Change-Id: I2a795bff7ce683eca521b3a987293b3320accb6a
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
A QPageSize::PageSizeId is a faithful representation of a QPageSize,
so the corresponding QPageSize ctor shouldn't be explicit.
[ChangeLog][QtGui][QPageSize] Conversion from a QPageSize::PageSizeId
is now implicit.
Pick-to: 5.15 6.0 6.1
Change-Id: I2d32da370c032949686757400cb7c28583d9d8ac
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Avoid some QFlags<->int conversions; use the named conversions
instead.
Change-Id: If12c55ca362ed5c2c73182e10562a2d09e80aa49
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Move the ValidityMask / DaylightMask enumerators in the right
enumeration. This allows to use them in a type-safe way through
the StatusFlags flag type.
Also, define the flag operators for StatusFlags.
Change-Id: Icdba7c3f49f18ffb4aff9921d8012ddc3f7cbed7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
The int was used as a flag the entire time, except in one stance.
So just use the right QFlags type instead, and replace that one usage
with a call to toInt().
Change-Id: I3670e6afdc244df69189dd15b8c2c34573476e2f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
If the condition Int(flag) != 0 is false, it means that flag == 0.
So just check i against 0, which is more in line with what testFlag
behavior is documented to do.
Change-Id: Ia75fa07eee65e67a769fda7c020bf17ada77e9a3
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
While at it, move tst_android under corelib/platform/android.
Change-Id: Icf91cd75cb5e04d03fe6a81d52fba52a485ca41f
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
The option is called QT_CREATE_VERSIONED_HARD_LINK. By default, it
is set to ON. Users can set this option to OFF to disable versioned
hard link.
Pick-to: 6.1
Fixes: QTBUG-93636
Change-Id: I0ffa1ee1c6bae1950df332fcce3152a861b33db0
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>