During review of a refactor (coming shortly), Thiago wondered what the
magic numbers were. On closer examination, I concluded that they were
wrong and wrote some tests to prove it. This commit adds those tests;
replaces the misguided old code with something that passes them; and
documents the reasons for the various parts of its decisions.
In the process, tidy up QLocaleData::doubleToString() somewhat and
rename some of its variables to conform to Qt coding style.
Change-Id: Ibee43659b1bdb0707639cdb444cfe941c31d409f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Use QLocaleData::c()'s instance method, rather than QLocaleData's
static method, to format integers. This avoids the need to duplicate
various arguments as literals, that the C locale provides as default.
It also future-proofs against changes to the static methods.
Change-Id: I5bba407cfc29e3f33d1e9fa878ddf35fff3b113c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Use aggregation instead. Prepare for using QPromise instead of QFutureInterface.
Task-number: QTBUG-84702
Change-Id: Ic88564dca8c83a178a281cb843032292210a6d25
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
We must not call the qvkgen tool that was built for the target but the
one that's located in QT_HOST_PATH.
Change-Id: I6d23a8e3abd84d449517630f3b9f0d50e333c327
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Change the functions to operate in float and add the
QPoint versions as overload calling them. This is
more in-line with the event accessors using float
and allows for removing some workarounds using a delta when
converting touch points.
Leave QPlatformWindow::map(To/From)Global() as is
for now and add helpers for float.
Change-Id: I2d46b8dbda8adff26539e358074b55073dc80b6f
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
It's still flattened in the next step, when the parser calls
QTextHtmlParserNode::applyCssDeclarations, but this at least
makes it clear where the problem is.
Task-number: QTBUG-85567
Change-Id: I1ecc7d808c58297f40f6cf8de86dfa7035e167c9
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
A very large GIF image resulted in cropping of image updates, due to
the handler trying to protect against very large values.
Increase that size from 200 to 16384, which is also the value used
in the withinSizeLimit method.
Fixes: QTBUG-85340
Pick-to: 5.15
Change-Id: I70888d76b378ee4f49694e90d7d753fae817ff2a
Reviewed-by: Lu YaNing <luyaning@uniontech.com>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
fix The window has been quickly activated or disabled will cause a crash .
Fixes: QTBUG-84643
Pick-to: 5.15
Change-Id: I0fd0918a3fc1898ddffd97009a4e92702ecd9ed4
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
The concerned paragraph is one that is very important as there are a
lot of people building the MySQL and PostgreSQL plugins that are not
successful on the first try. However, this text not being emphazized,
many if not all miss the fact that just re-running qmake will give them
the same result if the cleanup is not applied. This patch makes this
point more visible.
Pick-to: 5.15
Change-Id: Ib2b97e128a5dab3dc6d771b16b5315e4ad95a9b7
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
[ChangeLog][QtWidgets][QWidget] Creating QWidget instances with the
Qt::Desktop window type set is no longer supported.
Change-Id: I712861d7104c4ae5cbdd5d54cd0134bf69eb144e
Task-number: QTBUG-62094
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Task-number: QTBUG-83255
Change-Id: I8a008d8906308dd73a0793db5b88d3a1b6fdaf5c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Currently configure arguments specified in
qt5.git/coin/platform_configs are only used when configuring
qtbase itself. Sadly, Coin lacks support for specifying per-repo
configure flags.
Until Coin gets the feature, the best we can do is to pass
all the configure flags to each repo we are configuring.
Unfortunately if we pass all of qtbase's configure flags to other
repos it will break cross-compiling configurations (because the
toolchain argument would be overridden with the initial qtbase
provided toolchain instead of the Qt generated chainloading one).
We thus have to separate flags that should and shouldn't be passed
to other repos.
Introduce usage of two new environment variables called
NON_QTBASE_CONFIGURE_ARGS and NON_QTBASE_TARGET_CONFIGURE_ARGS.
Additional configure arguments can be specified in these variables,
and they will be used when configuring repositories, with the
exception of qtbase.
Ultimately, this is needed to disable detection / usage of certain
strawberry perl system libraries in qtimageformats on MinGW.
Doing that prevents crashes of the tst_qtiff test.
Minor implementation note is that the environment variables have to be
explicitly set in qt5.git platform_configs otherwise it breaks the
Windows Ninja Multi-Config configuration with the error
"The system cannot find the file specified".
Supplements 4b4f0be08debcfde62caf4066222b348ce65dea1 from qt5.git.
Amends previous revert 946fc92d20
Task-number: QTBUG-84886
Task-number: COIN-601
Change-Id: Ie4305c5d799bf4a29da5032a691e797b49c3cf33
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Passing QDBusUnixFileDescriptors over peer-to-peer connections currently
does not work, because QDBusConnectionPrivate::setPeer() does not set
this->capabilities (unlike QDBusConnectionPrivate::setConnection()
which is executed for bus connections).
Keep track of whether the connection already has been authenticated, and
once the connection does get authenticated, update this->capabilities.
Note that sending a message directly after connecting (before any
message has been received from the peer) might still fail if the message
contains a QDBusUnixFileDescriptor.
Pick-to: 5.15
Fixes: QTBUG-85396
Change-Id: Ib83213ebcd3255fb091c6faefb3618745b8d736c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
In Qt5, the -qtlibinfix option did not affect the naming of plugins,
unless -qtlibinfix-plugins was set. This option was added in
5641650993 to offer a way to have -qtlibinfix affect the plugin names
without changing the default behavior. We now remove the
-qtlibinfix-plugins option, as the old behavior is not desirable.
[ChangeLog][configure] The -qtlibinfix option now affects the names of
plugins. The -qtlibinfix-plugins configure option was removed.
Task-number: QTBUG-15192
Fixes: QTBUG-85439
Change-Id: I96f5c2577b76274929c431621967df0e9b4631b7
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Change-Id: If270982e54d2b11be00c71b9d012af629d181dfe
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
For now we just verify that the Cocoa API produces the same keymaps
as we get from Carbon. Once that's verified we can solidify the code.
Change-Id: I0d2aa1bb0a006d29c0149e3ff2fd5299ba922326
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
For repositories other than qtbase the QT_STAGING_PREFIX was empty,
because it was only determined in qtbase.
Also, we save the CMAKE_STAGING_PREFIX in the Qt6BuildInternals package
and set this variable if it's not explicitly set by the user.
As with CMAKE_INSTALL_PREFIX this behavior can be prevented by defining
QT_BUILD_INTERNALS_NO_FORCE_SET_STAGING_PREFIX=ON.
Change-Id: I73100abbef24f5d3fb8f82029d0374176edc8048
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
The prefix value must be surrounded by double quotes in case it
contains whitespace.
Change-Id: I393c57368d7a255f5042e363405071ef042afc18
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
In this case the srb represents the layout only, and can still be used
to create a pipeline. For setShaderResources() one will then need to use
another, layout compatible, srb that references valid resources.
Change-Id: I3ea5b63df3be8847540ca4c0c40fbd29dbed8fb7
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
As a comment noted, the reason for QLocaleData rolling its own values
describing the ranges of digits and exponents in a double were all
about std::numeric_limits's constants not being constexpr - which they
have now been since C++11, so we can do away with our own.
One of the constants was used in two places in the same way; so
abstract that use out into an inline function in qlocale_tools, to
save duplication and give somewhere to document it.
Change-Id: I7e3740ece9b499c0ec434de18d70abe69e1fe079
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
One can now write
with special_cased_file("base/dir", "foo.txt") as fh:
do_something(fh)
This makes the code of processJson a bit clearer, and it allows us to
easily add more files that support the special handling comments.
Change-Id: Ia25d0c0d48df1802c5e2123d05345a88b42a2981
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
The SpecialCaseHandler supported only two file names: "CMakeLists.txt"
and "configure.cmake". Generalize the code to allow for arbitrary file
names. We will use this in a subsequent commit.
Change-Id: I0adada91409a11a369fd1cf2d6ab21cc8f28ba0f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Given we optimize for the case where the new value is of the
same type of the one already stored in the variant, enable move
assignment for that case.
As a drive-by, avoid a path to detach() for data() if we know
we're detached.
Change-Id: I9abbdc10637ce77ebb747b49d83e1ef914d997bb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
A union member lifetime does not start automatically if one
takes a pointer to a union member and writes into the member.
Only the subscript syntax in an assignment features such
automatic lifetime start [class.union§6].
In the other cases, one is allowed to get a pointer to the
storage ([basic.life§6]) but has to start lifetime explicitly
via placement new. Hence, do so, or we end up in UB land.
We're left with the problem of reset() which may be called
multiple times. I think we can actually just create a new
object in the same storage without destroying the pre-existing
object by exploiting [basic.life§5]: reusing the storage causes
lifetime end for the old object. Moreover, since the union
is over trivial datatypes (C structs), there's no side effects
in the destructor of the old object, so there is no need
to call it.
Drive by fix, apply some DRY for SHA3.
Change-Id: Idc351568635e59d45421311f043956ab3aabf389
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Linus Jahn <lnj@kaidan.im>
Remove the hand-rolled union used only to achieve alignment.
Change-Id: I8e635fa0d09042f30fd67d589db9bc384c0ec8ef
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
It's already disabled for many other ARM platforms, and upstream
support for Apple Silicon is still pending, so we disable it for
now. See: https://bugs.exim.org/show_bug.cgi?id=2618
Fixes: QTBUG-85528
Pick-to: 5.15
Pick-to: 5.12
Change-Id: I42b6e5efaa07c9b832cd05a47436eb86a214e9bf
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Remove casts that truncate a qsizetype or size_t in qstring.cpp
Change-Id: Ibc1515f9906d5a0840254e60e2e7dfca716b63b5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The Qt::Keys have been re-ordered and comments added to reflect
the layout of the enum values in relation to the Unicode ranges.
Bits 0x00200000, 0x00400000, and 0x00800000 have been reserved
in case we want to use them for Qt::ModifierKey later on. Doing
so would require changing Qt::Key_unknown to not overlap with
these bits, or to accept that Modifier + Qt::Key_unknown is not
a supported usecase.
Change-Id: I580a01b0a47a28948a0f0018c47931395933b8f2
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
And mark some methods as inline.
Performance is critical for our new property system. Compiling
it in one unit makes it possible for the compiler to do a much
better job at inlining and generating optimized code.
Improves performance of binding evaluations by another 20%.
Change-Id: I5a2aa93c74d2b68418b0a9d2e34d8199bb71e3ad
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
We have the space anyway, and this cuts away another couple
of percent during binding evaluation to avoid a call that
checks whether the type is bool.
Change-Id: I41c320f93bf0a33f0cb15962a154c59a2e47fd7a
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Avoid any QVariant or type dependent code in the cpp files.
Instead, let the binding wrapper determine if the value
has changed and return true/false accordingly.
This required also some reworking of the guard mechanism
for notified properties, where the guard function wrapper
now calls first the binding evaluation function and then
passes the result to the guard.
Change-Id: I350d07a508ccc0c5db7054a0efa4f270b6a78ec3
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
There's no point in returning a usually empty error when
evaluating bindings, adding overhead to the regular code
path.
Instead, the error can be set on the currently evaluating
binding if required. This streamlines the functor used to
wrap the binding and should thus expand to less code and
execute faster in the regular case.
To achieve this, expose a pointer to the currently evaluating
binding in the private API (as QtQml needs it to be able to
report errors).
The error case now requires one additional TLS lookup, but
we don't really care about performance in that case anyway.
Change-Id: Iecb450e765244930a41d813fcf8eb4013957a6a3
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Remove location(). The method would always return an empty value. If you need the location,
the binding itself has it.
Remove setDescription() and require that the description gets passed
in the constructor. Never create a d pointer if type is NoError, so we
can quickly check for it inline.
Change-Id: I7eb8a94786281069d6ea2d82567c09aa50c52ef6
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Some goals that have hopefully been achieved are:
- make QPointerEvent and QEventPoint resemble their Qt Quick
counterparts to such an extent that we can remove those wrappers
and go back to delivering the original events in Qt Quick
- make QEventPoint much smaller than QTouchEvent::TouchPoint, with no pimpl
- remove most public setters
- reduce the usage of complex constructors that take many arguments
- don't repeat ourselves: move accessors and storage upwards
rather than having redundant ones in subclasses
- standardize the set of accessors in QPointerEvent
- maintain source compatibility as much as possible: do not require
modifying event-handling code in any QWidget subclass
To avoid public setters we now introduce a few QMutable* subclasses.
This is a bit like the Builder pattern except that it doesn't involve
constructing a separate disposable object: the main event type can be
cast to the mutable type at any time to enable modifications, iff the
code is linked with gui-private. Therefore event classes can have
less-"complete" constructors, because internal Qt code can use setters
the same way it could use the ones in QTouchEvent before; and the event
classes don't need many friends. Even some read-accessors can be kept
private unless we are sure we want to expose them.
Task-number: QTBUG-46266
Fixes: QTBUG-72173
Change-Id: I740e4e40165b7bc41223d38b200bbc2b403e07b6
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
The example is meant to show an item delegate with a line edit with
QRegularExpression-based validation depending on type.
Unfortunately, this does not work since QSettings mostly
return QString types.
Fix it to a partially working state by
- Making the expressions match from beginning to end which
was overlooked in the QRegExp->QRegularExpression change.
- Use QCheckBox, QSpinBox for bool/int since it is silly
to have a user edit a bool value by typing 'true'/'false'.
- Move the expressions out to a separate struct to be
able to do some guessing of the type when reading
the QSettings, implement for bool and int.
- Use a fancy Unicode checkmark for displaying bools.
- Fix the garbled display of QByteArray with binary data
by displaying them with hex characters and setting them
read-only.
Change-Id: Iba22dfafc3b813b3fd3d2915ef5210d661049382
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
The plumbing from QKeyMapper to the platform specific key mappers
via QPA was never done, so this method is unused. The code path
in QKeyMapper that would trigger it would be changeKeyboard(),
but that's already handled in QCocoaKeyMapper, and wouldn't be
initiated from the cross platform code in any case.
Change-Id: Ibc0c419627fc0430d028945038c1f2fbafe42d4b
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>