When fetching the bounding box of the alphamap for the glyph cache,
we would include the margins in the size, but we would not account for
it in the origin. We would therefore get a mismatch when copying the
alpha map into the cache.
[ChangeLog][Windows] Fixed a 2 pixel offset on glyphs when using
color fonts or any hinting preference other than the default (full)
hinting.
Fixes: QTBUG-71928
Change-Id: I9287df02de4f6e79c3b6c5ce92b73c284261ef5c
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Its purpose was to track the default palette set by the programmer,
but after 8fb881900c this is tracked by the Qt::AA_SetPalette attribute.
The palette itself is always reflected 1:1 in the palette tracked
by QGuiApplicationPrivate::app_pal.
Change-Id: If3e84c8b3ae6070b6c50be7a33adb38799b3f3a5
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
It's slow and we want to get rid of it. In this case,
it's just as easy to do the replacing manually using
a small loop.
Task-number: QTBUG-72587
Change-Id: I32e1cc89642bc0e5b6f500d072960cd8871e0684
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Allows running the example with -style foo or QT_STYLE_OVERRIDE.
No changes to documentation needed.
Change-Id: Id7cef450f13faabd118badde51afb7273439c9fc
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
The only effect calling QApplication::setPalette will have is the polish,
so opt for doing it explicitly instead of the weirdly looking no-op
assignment.
Change-Id: Ia80b3f60e3e513b68c2993ea8417966f9ab6721e
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
QApplication::setStyle has quite a bit of logic to clean up from the
old style before setting a new one. If a style has been set before
the application is created, it's not enough to just delete the existing
style, we need to treat it like a normal style switch.
Change-Id: I2bcc2eb75567bf1bc8a32ac31467b22315a70a0b
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
A style may have been set before the application was created, which
would have resulted in setting the system palette based on the style's
palette. Once the application is initialized and we have a platform theme
we need to reset the system palette.
Change-Id: Ia48f57d3983535c8633741d8027f75bc0c214018
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
We let initSystemPalette() do all the work, instead of leaving the first
time initialization of the system palette to the caller, which makes the
logic harder to follow.
This also means first time initialization of the system palette will
pick up a platform theme if available and resolve the palette using
that, which was missing from the original logic.
Change-Id: I84da557caf8ecedf6d96d87ebee93168ea9d73ba
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
The call was added in c49c96fbb1, "Reinitialize system palette
when setting a new style", but adding it along with the palette code
seems like a mistake. The potentially dirty widget font hash needs
to be reset for all style changes.
Change-Id: I411f56bb833819213c5485d7585fc5e3e9bd8983
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Other code using these maps are not treating them like multi-maps
Change-Id: I3381fde3b3612a29110cfe890f20f96f3c0bd3a2
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
None of the code I could see handles the map like a multimap.
Change-Id: I9d51da6dafed4317e801703599e83fb038c22a1d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
By casting it, these are situations where we cannot change the type
itself to QMultiMap. For QVariant it's a public define and for dbus
it's the type of an argument to the function.
Change-Id: I0f385dc857fce5de3e8254d18268fd84a6d7707c
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
As opposed to unite(), this inserts one map into the other
without duplicating elements.
Task-number: QTBUG-35544
Change-Id: Ie8ab350b29148851a3176cef1007e8a4ca82c273
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
[ChangeLog][QtCore][QHash] insertMulti(), unite() and
values(const Key &key) are now deprecated. Please use
QMultiHash instead.
Change-Id: Ic14907fd5fd38d585708e2dcf2c0200d221ebb25
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
This is a step towards deprecating QHash::insertMulti() and clearly
separating QHash and QMultiHash.
Change-Id: Ic2c7665673ff00d4f2186e94850710b70330f8ba
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Setting the CONFIGURATION_BUILD_DIR variable to tell Xcode where to
place the final application bundle confuses Xcode when archiving
a project, and the archive ends up without the dSYM files.
Unfortunately we can't leave it up to Xcode to place the build
artifacts wherever it wants, as Qt Creator's iOS support expects
to find the artifacts in a well-defined place. Until we've taught
Qt Creator to find the artifacts for deployment where Xcode placed
them we need to keep this logic.
We now avoid setting the CONFIGURATION_BUILD_DIR variable unless we
really need to due to in-source builds. As long as we're dealing with
a shadow-build it's okey to set SYMROOT.
Change-Id: I9661c1c57725dc8ba5a21f8467b8b61834f2e64d
Fixes: QTBUG-74841
Task-number: QTBUG-52474
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
This patch fixes the QMetaObject::superClass hierarchy for Q_GADGETs
that inherit from a template which in turn inherits another Q_GADGET.
One common scenario where this is applied is for the CRTP. Without this
patch, moc would stop at the template and then sets the superClass
QMetaObject to a nullptr. For QObjects this works, since there moc knows
that every child must by definition inherit QObject. In order to support
this for Q_GADGETs too, we defer the judgment about the availability
of a staticMetaObject in the base class to compile time through the
existing QtPrivate::MetaObjectForType<Base>::value() helper.
[ChangeLog][QtCore][moc] Moc now correctly sets a non-null
QMetaObject::superClass for Q_GADGETs that inherit from a template which
inherits another Q_GADGET.
Change-Id: I103b5efd74ed24172dffce477ca2ed6d0f374d44
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
This is a thing in Qt Quick: there are some types of image particles
that use uniforms like "float opacitytable[64]".
This should make all views work correctly in the Image Particles example
when running on the OpenGL backend of QRhi. (other backends should work
as expected already)
Change-Id: I64a04fbb98b97d81d257b00b428582e751d46b8e
Fixes: QTBUG-80667
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
It wasn't generating the "QPasswordDigestor" forward-header because
QPasswordDigestor is a namespace, not a class.
Fixes: QTBUG-80708
Change-Id: Ic6567271e2d2d948c0663017069eb26e2e95662c
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
The Quick3D-on-RHI PoC demonstrates a case which the Metal backend
fails to handle correctly: have an object with a lighting-enabled
material, but remove all lights from the scene.
Under the hood this means having a uniform block in the shader, but
without referencing it in any way in the actual shader code.
This leads to the resource being present (as far as shader reflection
is concerned), but with no native binding point available, meaning the
attempt to retrieve the Metal binding point for it returns -1, and that
is what the QShader carries in the nativeResourceBindingMap.
The backend should be prepared to silently skip the resource, whereas
currently we end up in an assertion due to attempting to batch the (native)
binding "-1", which is invalid.
Correct this.
Change-Id: I85ee58145f589aca45d46c23e0cdce837d598850
Fixes: QTBUG-80668
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Reading of Cbor streams is substantially more complicated than writing
as it requires float16 support. When writing Cbor, we can just choose to
always write 32bit floats, even if we could compress the numbers into
16 bits.
We need Cbor writing in the bootstrap library, but we cannot easily add
float16 support.
Furthermore, Cbor reading is required for plugin support, but not Cbor
writing. It might make sense for some users to build a custom Qt with
Cbor writing disabled.
Therefore, provide two features, cborstreamreader and cborstreamwriter,
split up the code in cborstream.{h|cpp} into several files, and enable
Cbor writing in the bootstrap library.
Change-Id: I15450afb0e328a84a22ebca9379cffc4f900a75a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
When passing the resources used to the android deployment setting json
file it needs to check the variable generated by the qtquickcompiler
feature so that it can still find the qrc files originally populated in
the resources. This ensures that qmlimportscanner can still scan the
original qrc files when determining which QML import plugins are
needed.
Fixes: QTBUG-80713
Change-Id: I695b289eaaa78cc6c355fa8abd22a8a1031a9f6c
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
This warning is not in -Wall or -Wextra, but it happens in a single
place, so we can reasonably suppress it.
Fixes: QTBUG-79138
Change-Id: Ib5d667bf77a740c28d2efffd15ccb3f62cf8f431
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
The wait() functions with the unsigned long arg were marked for removal
for Qt6 but due to the high usage of this functions and the very small
gain, revert the deprecation.
Change-Id: I9c9b720d279a59d87730f51de0f321b3794aa88e
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Some projects can be configured to have both qrcFiles and qml-root-path
included in the deployment settings file. The addition to qrc scanning
prevented the qml root directory from being scanned.
Change-Id: Idadb62f5572be45d0083294440bdb29740c2c47e
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
This flag is used in QSequentialIterable and QAssociativeIterable to indicate
that the data pointer in VariantData should be deleted after the variant has
been constructed.
The use case for this is
https://codereview.qt-project.org/c/qt/qtdeclarative/+/284151, where we have
a proxy iterator and cannot easily return a pointer to already owned data, as
it is hard to manage its lifetime in the iterator. In contrast, it is clear
that we can release the memory in the QSequentialIterable functions, as it has
already been copied into the QVariant there.
Change-Id: I2b33497d991cd4f752153e0ebda767b82e4bb851
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Update the instructions on how to build and distribute the mysql and
postgresql drivers on windows.
Change-Id: Ie4d50c1c34820680d7496b9544eb00fcee17f8e7
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
They have been marked as deprecated in the documentation for a while
Change-Id: Ia2b0b6dbd4c525e3e9c4bc835eee2c9da5a938cb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The dropdown of a combobox is rendered using menu items when the style
request it to do so via the SH_ComboBox_Popup style hint.
In that case, checkable items were not supported; the QComboBox didn't
pass the checked state correctly to the style, and the delegate used
for rendering the items into the list view did not implement modifying
the checked state of the item.
However, the QStyleOptionMenuItem's checked state and checkType members
were set anyway, as on e.g. macOS style we use a checkmark to show
which item is currently selected in the combobox.
The QStyle::State enum defines State_On and State_Off for toggleable
things, so in addition to setting QStyleOptionMenuItem::checked, we are
now also adding State_On or State_Off if the model provides a valid
checked/unchecked state. Otherwise, we only set the checked state if
the item is currently selected.
In addition, we implement the delegate to support toggling of checkable
model data with mouse and keyboard, using a simplified version of the
QItemDelegate implementation. To avoid spurious item toggles when the
popup is opened, we only handle mouse releases when the press was on
the same row.
In the fusion style, we ignore the workaround to let QtQuickControls
render comboboxes if State_On or State_Off are set.
[ChangeLog][QtWidgets][QComboBox] Support checkable items in styles
that use a popup for the dropdown.
Change-Id: Ia01519694b0419d777dc66b1ef683482fb01754c
Fixes: QTBUG-60310
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
This ties our hands on what we can do in our implementations. I don't
care if you've depended on this in your code. It was wrong.
Fixes: QTBUG-80600
Change-Id: I568dea4813b448fe9ba6fffd15de8865a27f0a35
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
This saves us from having to bootstrap rcc in regular (non-cross)
compilations, as it can now link to QtCore. Actually un-bootstrapping
rcc is left as an exercise for the reader.
This commit discovered that MSVC cannot handle constexpr arrays bigger
than 256 kB, at which point it simply starts claiming that the constant
expressions using it are not constexpr. ICC has a similar problem at
64 kB, but it tells you why ("note: type "const unsigned char [65537]"
too large for constant-expression evaluation").
Note also that this requires gzip or zstd to be in PATH for compression
to happen. RCC linked to zlib, which is always present due to the
bundled copy. gzip's presence is not likely to be a problem on Unix
systems, but could be for Windows users, especially MSVC ones. If gzip
is not present, QtCore's size will increase by about 1910 kB of
read-only (sharable) data.
Change-Id: I2b1955a995ad40f3b89afffd15a3e65a94670242
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Minor performance optimalizations:
- No need to check if the date and time are correct because the QDate,
QTime and QDateTime parsing functions already perform these checks
- No need to add minute part to the UTC offset before parsing the date,
because the QDateTime class can parse time zone offset both in form
±hh:mm and ±hh
Change-Id: Id74b7ae075135c5c8cf420247c49b5f12fe88899
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
The callback should be named the same as the function expects
Change-Id: I4ca73958313c93c0d68e7205d8641c4104247e0c
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
This creates a define in the binary, as well as writing emscripten
version for qmake.
It also enforces app builder to use a certain known version.
Task-number: QTBUG-77745
Change-Id: I37691512171635cec66aa3ffa16258081f3f1e1b
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
We have intentionally limited support for advanced things like
arrays in a uniform block. There is one very common case however:
a one dimensional array of a struct.
Typical example for Qt Quick 3D:
struct LightSource
{
vec4 position;
...
};
layout (std140, binding = 1) uniform cbBufferLights
{
int uNumLights;
LightSource lights[MAX_NUM_LIGHTS];
};
With GLSL (uniform blocks disabled) this gets turned into two structs
where one has a 'lights' member that is an array of the other struct.
Teach the OpenGL backend of QRhi how to handle this.
This makes the QRhi port of Qt Quick3D functional with the OpenGL
backend as well.
Change-Id: I6a09b93276794f7ecdd38f5bfbd3491a9ef58146
Fixes: QTBUG-80628
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
ISO date format doesn't allow spaces within a date, although 3339 does
allow a space to replace the T between date and time. Sixteen tests
added to check this all failed. So clean up the handling of spaces in
the parsing of ISO date-time strings.
[ChangeLog][QtCore][QDateTime] ISO 8601: parsing of dates now requires
a punctuator as separator (it previously allowed any non-digit;
officially only a dash should be allowed) and parsing of date-times no
longer tolerates spaces in the numeric fields: an internal space is
only allowed in an ISO 8601 date-time as replacement for the T between
date and time.
Change-Id: I24d110e71d416ecef74e196d5ee270b59d1bd813
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
As per std140 packing rules.
Change-Id: I85663d36a9fa617ea387e8f201677471b2ebd948
Fixes: QTBUG-80655
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
The xml_escape function must be part of resources_functions.prf, and the
qmake_immediate resource must not be created multiple times. Instead,
create another qmake_immediate resource with a number suffix.
This commit amends 577b6554.
Task-number: QTBUG-79672
Change-Id: Ibbe20c0fd1940f1fe7733cd1e5b0891f65689782
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
rcc currently always writes the namespace mangling macros in both the
initializer constructor and destructor. This patch add the missing
handling of the --namespace option for that part of the generated code.
[ChangeLog][Tools][rcc] rcc now generates correct code when using the
--namespace option.
Change-Id: I7e5e608eb0ad267d11d601fc69c1a87d3f655a6e
Fixes: QTBUG-80649
Reviewed-by: hjk <hjk@qt.io>