Commit Graph

42022 Commits

Author SHA1 Message Date
Jordi Pujol Foyo
9d6b4d1142 New features for QPdfWriter
Added new API setDocumentXmpMetadata/documentXmpMetadata and
addFileAttachment

[ChangeLog][QtGui][QPdfWriter] New API to provide external document XMP
metadata and attach files to PDF.

Fixes: QTBUG-78651
Fixes: QTBUG-78764
Change-Id: Ic0b37e8d12899f907001db469080594c14c87655
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2019-12-19 21:23:43 +01:00
Allan Sandfeld Jensen
6227a0d2e2 Add test for invertPixels on indexed formats
It wasn't tested and behaves in a very particular way.

Change-Id: I60a31681e5b221cf9a86df77e410a76ee4c10864
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2019-12-19 16:16:50 +01:00
Allan Sandfeld Jensen
09f19e48ac Fix unneeded use of QImage invertPixels and createAlphaMask
The result of createAlphaMask was mostly overwritten and then inverted,
we can write the right values directly instead.

Change-Id: I3cdddcc74218a4058bddd20178733688607c8a01
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2019-12-19 11:45:41 +01:00
Christian Ehrlicher
322e5b7f5e QtWidget docs: small fixes
Apply some minor fixes to the widget docs
 - use nullptr
 - use c++11 initializer list
 - properly delete widget when cleaning the layout (QTBUG-29471)
 - rework CardLayout example to make it work with Qt5

Fixes: QTBUG-29471
Change-Id: Ie2ee9f75eb8faf97d2bbd2c25e7013d4f30d8dd0
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2019-12-18 19:35:11 +01:00
Christian Ehrlicher
2614347ab8 Fix QSpinbox default width
After aa8d3f90a4 the default width of the
spinbox buttons is calculated from the spinbox width. This is wrong
because the initial width (e.g. when the spinbox is not yet shown) is
640 pixels which results in a too long width.
Therefore fall back to the old hard-coded value version but instead
using 20 pixels, use 16 to be in sync with the stylesheet style value
and honor the dpi of the screen by using QStyleHelper::dpiScaled().

Fixes: QTBUG-79806
Fixes: QTBUG-80814
Change-Id: I45786684575273f940e498df3b7639e626f00a7e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-12-18 16:31:27 +01:00
Marc Mutz
f2d752c59f QWindowSystemInterface: use QBasicMutex and qt_scoped_lock
There's no reason to use a class-static mutex object here.

Use a namespace-static QBasicMutex, port to qt_scoped_lock.

Change-Id: Ia9bd3c2fadbf1da25ef79bb393c899b678cbc182
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-12-18 15:56:42 +01:00
Alexandru Croitor
cf3d4cf3c3 Teach moc to output a Make-style depfile
If moc is invoked with the --output-dep-file option, it will generate
a "moc_<source_file_name>.d" dep file which contains dependency
entries that can be consumed by a Makefile / Ninja build system.

This is useful for build tools (like CMake) to know when moc should be
re-ran.
In the future, it might also be useful for ccache (teach ccache not to
re-run moc when not necessary).

The dependency list contains: the original source file, the passed
--include files (like moc_predefs.h), the include files that
were discovered while preprocessing the source file, and the plugin
metadata json files listed in Q_PLUGIN_METADATA macros.

The file paths are encoded using QFile::encodeName, so using the local
8-bit encoding.

The paths are also escaped (so ' ' replaced by '\ ', '$' by '$$',
etc) according to the Make-style rules as described in
clang's dep file generator
https://github.com/llvm/llvm-project/blob/release/9.x/clang/lib/Frontend/DependencyFile.cpp#L233

For reference, the equivalent Ninja depfile parser source code can be
found at
https://github.com/ninja-build/ninja/blob/v1.9.0/src/depfile_parser.in.cc#L37

Additional options that can be passed:
--dep-file-path - to change the location where the dep file should be
generated.
--dep-file-rule-name - to change the rule name (first line) of the
dep file (useful when no -o option is specified, so output goes to
stdout).

Encoding story.
Note that moc doesn't handle non-local-8-bit characters properly when
processing include directives at the preprocessor step. Specifically
the content of the main input file is read as a raw byte array (which
can be UTF-8 encoded) and then each include directive is resolved via
Preprocessor::resolveInclude(), which calls QString::fromLocal8Bit().

Because moc uses the QtBootstrap library, only a limited set of codecs
are available: various UTF 8 / 16 / 32 codecs and
QLatin1Codec (ISO-8859-15).

This means that on Windows, if the source input file is UTF-8 encoded,
and contains include names with UTF-8 characters (like an emoji or any
character >= 127 that is not in the QLatin1 codec), moc will fail to
resolve and process that include, and thus no dep file entry will be
created either.

On macOS / QNX / WASM the main locale is UTF-8, so file content
and paths will be processed correctly (hardcoded via QT_LOCALE_IS_UTF8
in src/corelib/codecs/qtextcodec_p.h).

On Linux it will depend on the current locale / encoding set,
and if that encoding is one of the ones supported above. UTF-8 should
work fine.

[ChangeLog][QtCore][moc] moc can now output a ".d" dep file that can
be consumed by other build systems.

Task-number: QTBUG-74521
Task-number: QTBUG-76598
Change-Id: I5585631ff1bbbae4e2875cade9cb6c20ed018c0a
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2019-12-17 21:43:41 +01:00
Andre de la Rocha
18f22fea7c Windows QPA: Allow the native Windows virtual keyboard to be disabled
This change provides a way to disable the automatic showing of the native
Windows on-screen virtual keyboard when a text editing widget is
selected on a system without a physical keyboard, by enabling the new
AA_MSWindowsDisableVirtualKeyboard application attribute, allowing
applications to use a custom virtual keyboard implementation.

Fixes: QTBUG-76088
Change-Id: Id76f9673a2e4081e5325662f3e3b4b102d133b9a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2019-12-17 14:24:29 +01:00
Giuseppe D'Angelo
abbdd634cd Get rid of the getter for QObjectPrivate::threadData
The dependent changes have now landed.

Change-Id: I502377ab5603d67ada9e5577de1abfccdfa0fa09
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-12-17 09:48:16 +01:00
Christian Ehrlicher
4e04132264 QStringListModel: fix moveRows()
QStringListMode::moveRows() had an issue when the destination was before
the source row.

Change-Id: Icf64e5b4cdd6a39faf3ba4ccc3883196b247ccbd
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
Reviewed-by: David Faure <david.faure@kdab.com>
2019-12-16 22:12:52 +01:00
Christian Ehrlicher
be9398c8d4 QListModel: fix moveRows()
QListModel::moveRows() had an issue when the destination was before the
source row.

Change-Id: I4ce8b425451f2f53c7eb3b211e9590753dec618a
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
Reviewed-by: David Faure <david.faure@kdab.com>
2019-12-16 18:44:46 +01:00
Liang Qi
1d00f52fd3 Merge "Merge remote-tracking branch 'origin/5.14' into 5.15" 2019-12-16 12:58:50 +01:00
Friedemann Kleint
313c2b46fe Windows QPA: Use UTF-16 literals where possible
This should minimize diffs to Qt 6.

Change-Id: Id74c0b4085085984bd51251765420718d16e9fc7
Reviewed-by: André de la Rocha <andre.rocha@qt.io>
2019-12-16 12:16:13 +01:00
Allan Sandfeld Jensen
a1a3a7cd8a Avoid crashing when constructing color-space from invalid enum
This is not to be taken as supported and is still undefined behavior,
but I prefer we do not crash.

Change-Id: Icf4f3398bfd57fcbdc611a5a821a1f2de0838330
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2019-12-16 10:38:17 +00:00
Allan Sandfeld Jensen
deeaa500ad Mark the old style unprefixed stream functions deprecated
Requires a third definition for the source-compatible but deprecated
version.

Change-Id: I260ae79f4547f99eed701b10e0b25222f81cd5ff
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-12-16 11:23:47 +01:00
Liang Qi
ee71a9ba81 Merge remote-tracking branch 'origin/5.14' into 5.15
Conflicts:
	src/network/ssl/qsslsocket.cpp
	src/widgets/kernel/qapplication.cpp

Change-Id: Ib7421cc2df59d0969f89b3fbd65a17ea76ffef3b
2019-12-16 07:05:19 +01:00
Marius Kittler
98f19f0036 Use pkg-config to find libjpeg
Change-Id: I42d877fbca5d746114cc28f8ee4db3e54754cd24
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-12-15 19:42:25 +02:00
Olivier Goffart
d6266c757d Replace usages of QVariant::value by qvariant_cast
This is done automatically with a clazy check

Change-Id: I3b59511d3d36d416c8eda74858ead611d327b116
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-12-15 12:30:52 +01:00
James McDonnell
127533637e Provide repeat parameter to handleExtendedKeyEvent
QtWayland uses this to discard key repeats.  Modifier key repeats
confuse xkbcommon.

Change-Id: I3ea384aa7b750ff83520bfb2440e61b91bb6e354
Reviewed-by: Dan Cape <dcape@qnx.com>
Reviewed-by: Johan Helsing <johan.helsing@qt.io>
2019-12-14 19:24:45 -05:00
James McDonnell
fc95ad8616 Add default location for the Wayland scanner tool on QNX
Change-Id: I0cfa823414a8f7866c594edb60b09b60f2b4d16b
Reviewed-by: Dan Cape <dcape@qnx.com>
Reviewed-by: Johan Helsing <johan.helsing@qt.io>
2019-12-14 11:22:54 -05:00
Giuseppe D'Angelo
5b4b437b30 WebGradients: redo implementation
The previous implementation was *extremely* expensive. It
relied on loading a binary JSON file from resources (which
involved decompressing it), then extracting information out of
it to build a gradient.  Already-loaded gradients were kept in
a local cache, which had to be mutex protected.

Instead, this patch extends the gradient generator to build
static arrays filled with the web gradient data, sitting in
.rodata.

These arrays are used when building QGradient objects with a
web gradient. No explicit mutex protection is necessary, since
accesses will just read from the arrays.

As benefits, this patch removes:

* the binary json representation from QtGui's resources (~4KB
compressed, ~50KB uncompressed)
* the overhead of reading from the JSON for each used web
gradient;
* the startup costs of registering the webgradients in the
resources;
* all the overhead of mutex locking when building such
gradients;
* all the runtime memory allocations to load, parse and cache
the web gradients (including the memory + CPU spike on first
load due to the uncompression of the JSON data, as well as a
couple of deep copies).

Change-Id: If5c3d704430df76ce8faf55ee75ebd4639ba09c4
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-12-14 11:31:46 +01:00
Christian Ehrlicher
0edd2e39ad Let QItemSelectionModel::columnIntersectsSelection honor the parent
QItemSelectionModel::columnIntersectsSelection() should honor the parent
according to the docs. For rowIntersectsSelection() this was fixed a
long time ago but columnIntersectsSelection() was forgotten.

Sync the both functions and use range-based for loops as a drive-by.

Fixes: QTBUG-80644
Change-Id: Iaf08f85e2225204d1e6564fa4bb0bc826352ed53
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-12-14 08:46:37 +01:00
Christian Ehrlicher
4689e198e7 Doc/SQL: update sql driver creation instructions
Fix the links, remove section about Q_ODBC_VERSION_2 - it wasn't there
since Qt5.0.

Change-Id: I571f5c2cf0f0e2df38638299c26814b510d1a8af
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2019-12-14 08:46:14 +01:00
Christian Ehrlicher
4522b17159 QStandardItemModel: do not reset persisten index in setItem()
When an existing item is replaced with a new one in
QStandardItemModel::setItem() then the persitent index is invalidated
which leads to some unexpected behaviors (like e.g the header size and
resize mode are reset).
Therefore we have to make sure that the invalidation does not happen.
This can be achieved by delaying the call to QStandardItem::setModel()
for the old item until the new is properly added. After this, the old
item no longer gets a valid QModelIndex from the model and therefore
can't invalidate the persistent index anymore.

Fixes: QTBUG-13605
Fixes: QTBUG-73000
Fixes: QTBUG-80586
Change-Id: I4e45e6feb81b7287c0859f638d7ab1a576fc2f0f
Reviewed-by: David Faure <david.faure@kdab.com>
2019-12-14 08:46:05 +01:00
James McDonnell
e076965542 Move QQnxGLContext::ms_eglDisplay to the integration object
In part, this is a continuation of
https://codereview.qt-project.org/c/qt/qtbase/+/227953.  It also paves
the way toward implementing the EglDisplay integration resource needed
by QtWayland.

For the code that's being moved around and modified, switch from
!QT_NO_OPENGL to QT_CONFIG(opengl).

Change-Id: I5046e8caf5df7cf326f8e697d7d41cf802250414
Reviewed-by: Dan Cape <dcape@qnx.com>
Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
2019-12-13 20:26:35 -04:00
Alexandru Croitor
a3a6f28427 OpenGL: Fix signature of GLDEBUGPROC in qopenglextrafunctions.h
The typedef "QOPENGLF_APIENTRYP" was incompatible to the one
in "src/opengl/qopengldebug.cpp" which used "QOPENGLF_APIENTRY".

Note the misisng "P " ending.

The type is meant to be a function pointer, not a pointer to a
function pointer, so remove the extra P.

Change-Id: I229b73ca8e7367f88a2b48e2728e615605f02da3
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2019-12-13 13:23:19 +01:00
Qt Forward Merge Bot
64f55f2d9e Merge "Merge remote-tracking branch 'origin/5.14.0' into 5.14" 2019-12-13 12:46:24 +01:00
Qt Forward Merge Bot
56b0dabf80 Merge remote-tracking branch 'origin/5.14.0' into 5.14
Change-Id: I03927d2ef75514e4f2633839387806125d8954f1
2019-12-13 12:46:12 +01:00
Eskil Abrahamsen Blomfeldt
318a991907 Windows: Fix offset of glyphs with DirectWrite font engine
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>
2019-12-13 12:16:46 +01:00
Tor Arne Vestbø
df69364469 Remove QApplicationPrivate::set_pal
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>
2019-12-13 10:10:36 +01:00
Lars Knoll
1e27db6c20 Avoid using a QRegExp for trivial replacements
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>
2019-12-13 08:51:17 +01:00
Tor Arne Vestbø
072ca960f5 styles example: Set default style up front, and react to style changes
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>
2019-12-12 23:24:29 +01:00
Tor Arne Vestbø
da0e745752 Explicitly polish palette instead of relying on QApplication::setPalette
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>
2019-12-12 23:24:25 +01:00
Tor Arne Vestbø
96d1d44279 Clean up QApplication::style default style construction
Change-Id: I9f01e7cc5fa90fd9b1f5d12c7ce694c231158c32
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-12-12 23:24:21 +01:00
Tor Arne Vestbø
a9e628e7ec Ensure override style properly clears out previous style if set
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>
2019-12-12 23:24:17 +01:00
Tor Arne Vestbø
f6a2b81eab Update system palette on application init if needed
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>
2019-12-12 23:24:11 +01:00
Tor Arne Vestbø
6b06f12da6 Unify system palette initialization during style change
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>
2019-12-12 23:24:07 +01:00
Tor Arne Vestbø
14071b5a8e Clarify call to initializeWidgetFontHash in QApplication::setStyle
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>
2019-12-12 17:22:18 +01:00
Mårten Nordheim
40f28b1a8a Don't use QMap::unite for merging maps
Other code using these maps are not treating them like multi-maps

Change-Id: I3381fde3b3612a29110cfe890f20f96f3c0bd3a2
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-12-12 15:25:47 +01:00
Mårten Nordheim
6f5556e7b4 QTextDocument: Change use of QMap::unite to QMap::insert
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>
2019-12-12 15:25:44 +01:00
Mårten Nordheim
43837f38b2 Change some uses of QMap::insertMulti to QMultiMap::insert
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>
2019-12-12 15:25:41 +01:00
Mårten Nordheim
b79d74e96f moc: change QMap::unite to QMap::insert
Which is the intended behavior.

Change-Id: I0cffc623fc09284f3d95850f840564dca20ed0d4
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2019-12-12 15:25:39 +01:00
Mårten Nordheim
1c98479aa2 QRegExp: change QMap::unite to QMap::insert
Change-Id: I4c682b31da8bfa56c6858a1878f12118568f28bf
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-12-12 15:25:35 +01:00
Mårten Nordheim
d98a1ef902 Add QMap::insert(const QMap &map)
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>
2019-12-12 15:25:30 +01:00
Lars Knoll
9c124b1b0a Qt 6: Deprecate QHash::insertMulti
[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>
2019-12-12 15:25:26 +01:00
Lars Knoll
c7e35ffe69 Use a QMultiHash explicitly if insertMulti() is being used
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>
2019-12-12 15:25:22 +01:00
Tor Arne Vestbø
f733c1c6e7 Xcode: Use output directory as SYMROOT when shadow-building
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>
2019-12-12 14:56:31 +01:00
Milian Wolff
656d6f2a9b Support Q_GADGET QMetaObject super class hierarchies across templates
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>
2019-12-12 13:02:52 +01:00
Laszlo Agocs
83818431e1 rhi: gl: Add support for arrays of float, vec2, vec3 and vec4
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>
2019-12-12 12:57:06 +01:00
Mårten Nordheim
5612f24dc5 Add QPasswordDigestor to syncqt
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>
2019-12-12 12:43:56 +01:00