Commit Graph

46039 Commits

Author SHA1 Message Date
Giuseppe D'Angelo
b99ade85b0 QPoint(F): API cleanups
Unexport the classes, plaster noexcept, and port to constexpr.

Change-Id: I5cc7928fb08e8e32c67cff2d84c1b0ed9d46a2fa
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-06-03 18:26:54 +02:00
Alexandru Croitor
53bee75001 CMake: Fix tst_foo_check to work for qml tests as well
Qml tests currently don't expose a CMake target, so no
dependency should be added to a non-existent target.

Make sure to add the check target only if the test was previously
added.

Fixes configurtion failure of qtdeclarative tests.

Amends 873aa682c5

Change-Id: Ic8bbfe668c00c1ce05f1e1dfe5494dafd91dd7b8
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-06-03 18:20:02 +02:00
Shawn Rutledge
d268b91907 Add QT_QPA_SYSTEM_ICON_THEME to override icon theme name
On a plain X11 desktop, it otherwise ends up empty.

Pick-to: 5.15
Task-number: QTBUG-25351
Task-number: QTBUG-25718
Task-number: QTBUG-74252
Change-Id: I50a522a3e1761e422d5949d5338869ceb9e5e89d
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
2020-06-03 18:17:51 +02:00
Eskil Abrahamsen Blomfeldt
4dfaa1d60a Fix build for Android on macOS
The FreeType engine has moved out of the fontdatabases library,
so the .a file would be empty. This caused the error
"attempt to map 60 bytes at offset 72 exceeds size of file" when
building for Android on macOS.

Change-Id: I9d9afca67e7626d3b5c6a62fcde33fed029fe04c
Reviewed-by: Liang Qi <liang.qi@qt.io>
2020-06-03 16:39:39 +03:00
Assam Boudjelthia
7ede57f937 Make sure the default AndroidManifest is compatible with Qt Creator
When adding the default AndroidManifest.xml to a project, Qt Creator
edits some pieces because of autoformat and shows that something is
changed, but the user changed nothing, and this can be confusing. Let's
make them on the same page.

Pick-to: 5.15
Task-number: QTCREATORBUG-23768
Change-Id: I76088358dc31be45adb766bed29e2c9d889a8f09
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-06-03 10:26:01 +03:00
Alex Blasche
5f7b771c4f Add missing lock in QFactoryLoader
libraryList is modified in a code section that was not yet properly locked.

This was overlooked by 7ca66b1e66.

Task-number: QTBUG-42855
Change-Id: I028ad21a7df314133931f860ad49453bb2db9da0
Pick-to: 5.15
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-06-03 09:06:50 +02:00
Dominik Holland
43ae627f40 Add Q_OS_WEBOS to qsystemdetection
This can be used to guard WebOS specific patches.

Change-Id: Ia770562b92c59fc3410d6254acd1313776d15a28
Pick-to: 5.15
Fixes: QTPM-1826
Reviewed-by: Johannes Oikarinen <johannes.oikarinen@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-06-03 06:42:48 +00:00
Paul Wicking
ca89ad8002 Doc: Fix qdoc warnings
Use \li for list items.

Change-Id: I5ab253e22077cd7132f28c8690aa2a9a4b8b489c
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-06-03 07:10:28 +02:00
Eskil Abrahamsen Blomfeldt
c2dcb7eaa1 Windows: Fix QPainter warnings when using some fonts
Some fonts, like Segoe UI, have empty glyphs defined for
characters such as space. When there is a margin on the glyphs,
we would previously render them as 4x4 completely transparent
images. This is a waste of time, and in the case of DirectWrite,
we fixed it in bb67c3b68b so that
it will always return an invalid image when the glyph does not
have dimensions.

But since we did not account for this in alphaMapBoundingBox(),
the texture glyph cache did not detect this case and would
request the empty image and try to add it to the cache.

Fixes: QTBUG-84629
Pick-to: 5.15
Change-Id: I470a4a55577c5e9239bf77de81c2b381bf8e6a49
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-06-03 07:00:32 +02:00
Timur Pocheptsov
7f927b373e H2 protocol handler: make sure inflateEnd gets called on z-stream
The request/reply pair is created out of QNetworkRequest, we set
autoDecompress data-member on the request, but not reply. As a result,
reply in its destructor fails to release memory, allocated by z-lib
(by failing to call inflateEnd). Since with H1 requests it does not
seem to be a problem (no leaks detected), I'm limiting this change
to H2 handler only. Later it will be retired by the stream decompression
change in Qt 6, but will be picked to 5.15.

Fixes: QTBUG-84560
Pick-to: 5.15
Change-Id: I82e19d2b0a83624b730edd20d7d45721e7001731
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-06-03 06:57:50 +02:00
Samuel Gaist
654a3ad08e Doc: fix some typos in QRegularExpression documentation
Pick-to: 5.15
Change-Id: Ibf96fc775b08df4de0b20d499d8779204ff7df30
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-06-03 00:39:06 +02:00
Tor Arne Vestbø
93a04332eb Move QtAccessibilitySupport into QtGui
Task-number: QTBUG-83255
Change-Id: Ibc1b38e77c3c90030a832c41f4de65c6c38bc91d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-06-02 23:32:36 +02:00
Jannis Voelker
33fc2ff663 Adds library mappings for the Qt OPC UA module in helper.py
Change-Id: I64bee2a7c149b8e4b14b71103ebc748c32993145
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-06-02 23:12:56 +02:00
Marc Mutz
dd7f4001e1 QPainter: replace manual memory management [1/5]: dummyState
Use a unique_ptr to indicate ownership.

Change-Id: I15e8c48fac1424d5605e869adcfba6965b16c218
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-06-02 22:52:57 +02:00
Marc Mutz
033e5dc183 QTranslator: replace manual memory handling with std::unique_ptr
The QTranslator owns its QResource and its sub-translators, so hold
them in unique_ptr to show what's going on.

Change-Id: I65dfa8c3b6dd774066a01de23ae6cff7449b363a
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-06-02 22:52:54 +02:00
Albert Astals Cid
add92a551c Do not fully initialize QIconLoader when setting the fallback theme
We need this because without this patch you get bugs both
if you call QIcon::setFallbackThemeName before creating the QGuiApplication and
if you call QIcon::setFallbackThemeName after creating QGuiApplication

Why do you get a bug if you call QIconLoader::setFallbackThemeName
before creating the QGuiApplication:
 * QIcon::setFallbackThemeName calls QIconLoader::instance
 * QIconLoader::instance calls QIconLoader::ensureInitialized
 * QIconLoader::ensureInitialized calls systemThemeName
 * systemThemeName asks the current QPlatformTheme for its
   QPlatformTheme::SystemIconThemeName
 * But since we're calling this before creating the QGuiApplication
   there is no current QPlatformTheme yet, so systemThemeName
   is set to empty, which is obviously not what we want

Why do you get a bug if you call QIconLoader::setFallbackThemeName
after creating the QGuiApplication:
 * QGuiApplicationPrivate::init calls
   QGuiApplicationPrivate::createPlatformIntegration
 * QGuiApplicationPrivate::createPlatformIntegration sets the
   current QPlatformTheme and at the end of the very same function
   uses QIcon::fromTheme
 * Since we haven't called QIconLoader::setFallbackThemeName yet
   there is at least one icon lookup that doesn't take
   the fallback theme we would like to have into account

This patch makes it so calling QIconLoader::setFallbackThemeName
before creating the QGuiApplication works.

The only thing we want to do from QIcon::setFallbackThemeName is set
the internal m_userFallbackTheme, it doesn't care about doing
further initialization of QIconLoader, if it's done, great it's done,
if it is not initialized yet, great it will be initialized later
when someone actually tries to use the QIconloader.

So it's OK for ensureInitialized() to return early if there is no
platform theme yet, because it will be called again later.

Pick-to: 5.12
Pick-to: 5.15
Fixes: QTBUG-74252
Change-Id: I65268fc3d3d0bd282d76c76cf75e495bcc9d1a30
Done-with: Albert Astals Cid <albert.astals.cid@kdab.com>
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-06-02 20:47:53 +00:00
Leander Beernaert
5a779a4ad3 CMake: Make it possible to build tools when cross-compiling
This patch allows tools to be built for the target platform when the
QT_BUILD_TOOLS_WHEN_CROSSCOMPILING parameter is set at configuration
time.

To avoid naming conflicts, the target tools are suffixed with "_native".
The qt_get_tool_target_name() function can be used to get the tool name
for both scenarios (cross and non-cross compilation).

Extend pro2cmake to refer to the right target name for tools.
The relevant write_XXX functions have a new target_ref parameter that
will be "${target_name}" for tools and literally the target name for
everything else.

Fixes: QTBUG-81901
Change-Id: If4efbc1fae07a4a3a044dd09c9c06be6d517825e
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-06-02 22:42:15 +02:00
Fabian Kosmale
47c6466d0a QMetaType: create metatype for void
Create a QMetaTypeInterface for void. This allows us differentiate
QMetaType::Unknown from QMetaType::Void. In addition, this will enable
the usage of QMetaMethod::metaReturnType in QMetaMethod::returnType,
and will facilitate using metaReturnType in declarative, which needs to
distinguish between Unknown and Void.

Change-Id: I83296b49587f3deb7ec73e25a33f0d8c98cf8da0
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-06-02 22:42:15 +02:00
Fabian Kosmale
649d834443 add unit test for QMetaMethod::revision
Change-Id: I724702d8ac9a75fefd848afccf4f4de9fc0ba4af
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2020-06-02 22:42:15 +02:00
Fabian Kosmale
fa987d4441 MetaObject: Store the QMetaType of the methods
This does the analog of 46f407126e for the
methods we care about (signals, slots, Q_INVOKABLEs). In addition to the
actual QMetaType, we store an array with offsets so that we later can do
a mapping from methodIndex to metatype.

The newly added QMetaMethod::{return,parameter}MetaType methods can then
be used to retrieve the metatypes.

This does however require that all involved types are complete. This is
unfortunately not a feasible requirement. Thus, we only populate the
metatype array on a best effort basis. For any incomplete type, we store
QMetaType::Unknown. Then, when accessing the metatype, we fall back to
the old string based code base if it's Unknown.

Squashes "moc: support incomplete types" and  "Fix compile failures
after QMetaMethod change"


Fixes: QTBUG-82932
Change-Id: I6b7a587cc364b7cad0c158d6de54e8a204289ad4
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-06-02 22:42:15 +02:00
Venugopal Shivashankar
5306fdabc1 Doc: Move the overlapping background logo
Setting the logo to position at the top seems
to fix the issue.

Fixes: QTWEBSITE-928
Change-Id: I29336b4a1967a4676695b4f7f8560d01f3cf4fdf
Pick-to: 5.15
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-06-02 20:42:15 +00:00
Topi Reinio
707018b76e Doc: Fix issues with Qt Widgets documentation configuration
Remove '/' as an example directory. We do not want to retrieve the
directory tree of the entire system.

Change-Id: I911f8eea12b4960319a9a4cbea820b910a35aede
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-06-02 19:25:59 +02:00
Friedemann Kleint
13d95e415e High DPI/Windows style: Fix potential crash when drawing buttons of maximized QMdiSubWindow
In QWindowsXPStylePrivate::drawBackgroundThruNativeBuffer(),
pass the correct rectangle (reflecting the correction factor)
to the function fixAlphaChannel().

Amends e56b8e1e59.

Pick-to: 5.15
Fixes: QTBUG-84613
Task-number: QTBUG-75927
Change-Id: I5357bb8c55ed26a50cc322ea7a05df4487212fb8
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2020-06-02 14:50:54 +02:00
Alexandru Croitor
873aa682c5 CMake: Add ${tst_foo}_check target for easy test running
Given a test named "tst_qdrag", you can run "ninja tst_qdrag_check"
to build and run the test.

Change-Id: I47dccb39dd60fca9cb07ff9af9fb739b293c5aaf
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-06-02 12:03:27 +02:00
Dimitrios Apostolou
f19650cf80 Convert Q_ASSERT to Q_STATIC_ASSERT
This is now possible because of the earlier commit that changed the
const arrays in qurltlds_p.h to constexpr arrays.

Change-Id: I37a6a64e250bbe33f7d34b5916595bf6a37aed4a
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2020-06-02 12:01:42 +02:00
Kai Koehne
1e17d0e9d7 Remove whitespace for file names generated from TARGET
Task-number: QTBUG-84492
Pick-to: 5.15
Change-Id: I70e79b7a57949e8dfd3781967e775bdea8822e0c
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-06-02 08:07:54 +02:00
Lars Knoll
4c5f6eb74c Stabilize autotest
calling emplace() on a std::vector with a reference
pointing into the same vector is undefined behavior.
Fix this by using a temporary inbetween.

Change-Id: I47c28700dffa2107fb0cba302168c86b659eafb3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-06-01 20:57:55 +02:00
Lars Knoll
51beb816e8 Support qbswap for all integral types
long and ulong where missing. Generalize the code so that it'll work
for all integral types.

Change-Id: I74591e9c8b375e0ecdcfdd856970ce355eb2d4ce
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-06-01 20:57:44 +02:00
Lars Knoll
aac39167b7 Add QStringView::split() methods
Since QString::split() is not going away in Qt 6, we should aim
to provide API symmetry here, and ease porting existing code from
QString(Ref) to use QStringView.

This is easier than having to port everything to use tokenize() at
the same time. tokenize() will however lead to better performance
and thus should be preferred.

Change-Id: I1eb43300a90167c6e9389ab56f416f2bf7edf506
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-06-01 20:43:21 +02:00
David Faure
4f1ebf666e QMimeType::suffixForFileName shouldn't lowercase the file suffix
It was returning a lowercased suffix because it was extracting it from
the pattern (*.txt) rather than from the filename ("README.TXT").

This broke expectations on the application side, since this method is
documented to return a suffix from the given filename.

Ref: https://bugs.kde.org/show_bug.cgi?id=402388

Change-Id: I7dae13db31280249d3f592fa9592c4067804e22d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-06-01 13:36:05 +02:00
Lars Knoll
b0294bb1c7 Refactor splitString to use QStringView
Instead of a QChar * and a length.

Change-Id: Ic07e92fe0889e57c19ce7c1bf6902f3a598fad05
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-06-01 00:39:24 +02:00
Giuseppe D'Angelo
529f052add Port QRegularExpression to QStringView, drop QStringRef
The idea is pretty simple -- add QRegularExpression matching over
QStringView. When matching over a QString, keep the string
alive (by taking a copy), and set the view onto that string.
Otherwise, just use the view provided by the user (who is then
responsible for ensuring the data stays valid while matching).

Do just minor refactorings to support this use case in a cleaner
fashion.

In QRegularExpressionMatch drop the QStringRef-returning methods, as
they cannot work any more -- in the general case there won't be a
QString to build a QStringRef from.

[ChangeLog][QtCore][QRegularExpression] All the APIs dealing
with QStringRef have been ported to QStringView, following
QStringRef deprecation in Qt 6.0.

Change-Id: Ic367991d9583cc108c045e4387c9b7288c8f1ffd
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-05-31 21:46:32 +02:00
Kai Koehne
32a39c4ed1 Document how to use CMake for Qt Widgets
Task-number: QTBUG-73058
Change-Id: Ida459635e159334a4ef67979c0d28b1553317ea9
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-05-31 18:44:57 +02:00
Lars Knoll
c84e9c0700 Fix a bogus assert
advances and glyphIndices can be nullptr's as long as numGlyphs
is zero.

Change-Id: I29c3764792c1a0ffaafd3393c82a26af65699ab3
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-05-31 15:55:57 +02:00
Mike Krus
1d0384a385 Allow module names starting with digits
This was allowed with QMake.

Change-Id: Ia3052cd2086d633a343cfe59afddded2f79fc551
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-05-31 13:44:15 +01:00
Lars Knoll
6a6314df1e Add QStringView::constData()
This is doing the same as data(), but the method is widely being used in
Qt (e.g. in QString), so this will make it easier to change the type of a
variable from QString(Ref) to QStringView in a source compatible way.

Change-Id: Ic49bef688d3ce3c550336edf90130aa5cac8b497
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-05-30 23:11:20 +02:00
Lars Knoll
a1056096fc Add support for count() to QStringView
Make the API more symmetric with regards to both QString and QStringRef.

Change-Id: Ia67c53ba708f6c33874d1a127de8e2857ad9b5b8
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-05-30 23:11:09 +02:00
Eirik Aavitsland
2b7b75f721 gif image handler: check for out of range image size
Make the decoder fail early to avoid spending time and memory on
attempting to decode a corrupt image file.

Pick-to: 5.15 5.12 5.9
Change-Id: Ic556d4fbcb6b542fc110d10e48dac1a880e60697
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-05-30 15:37:12 +02:00
Andy Shaw
f71a400bf6 Android: Clear the clipboard when getting a null mimedata
From API 28 it is possible to clear the clipboard so we should ensure
that this is done if API 28 or later is being used. Otherwise it is not
removed, but that is due to limitations on the Android side.

Pick-to: 5.15
Change-Id: I1fe504d0e566c6923b39b2adf4540619c6b1daf7
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2020-05-30 12:49:42 +00:00
Eirik Aavitsland
6a2224fd58 bmp/ico decoder: fail early for unsupported bit depths
All the normal bit depths are supported, so no point in trying to go
through the decoding code path for others. Avoids wide bitshift
warning for claimed depths > 32.

Pick-to: 5.15 5.12
Change-Id: I61b72dbbf9558ca28db46f8168339f8174e56997
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2020-05-30 12:33:08 +02:00
Eirik Aavitsland
30571068b2 Gif decoder: avoid undefined values in enum
The gif standard allocates 3 bits for the disposal method, but values
4-7 are unused.

Pick-to: 5.15 5.12
Change-Id: I0f70b3f87b4cd8e98140c3da476702a22ebe93a9
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2020-05-30 12:32:56 +02:00
Samuli Piippo
10a0dc6600 Return correct threadId in all cases
If the assembler code cannot be used to retrieve the threadId, always
use pthread_self() for it. QObject uses QThread::currentThreadId() and
QThreadData::threadId to match threads, which makes address of the
currentThreadData unsuitable as the thread id.

Reading the threadId from currentThreadData is slower than calling
pthread_self(), as tested on Aarch64 linux and x86_64 QNX.

Change-Id: If9afc8ed2810ad1e04bd42ead8f40b43ef3bac30
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-05-30 09:55:05 +03:00
Alexandru Croitor
71e3b04282 CMake: Regenerate rest of configure.cmake files
Change-Id: I17cca57c18f33d4283eb6009ba4c5ebb0c1847c3
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2020-05-29 23:23:06 +02:00
Laszlo Agocs
e3361c1614 CMake: Update src\gui\configure.json and the conversion script
The ANGLE removal's manual configure.cmake changes are now replaced
by updating the conversion script's special cases instead.

Change-Id: I06317fe0202b25bd9f9524da14e1bb0ccbb30cc1
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-05-29 23:23:02 +02:00
Alexandru Croitor
a97a8fcc1a CMake: Regenerate src/platformsupport
Change-Id: If7b5359c457edee814dc7d3a71cf47ce052e6c5e
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-05-29 23:22:57 +02:00
Alexandru Croitor
77771116a4 CMake: Regenerate src/plugins
Change-Id: Icceceeb42023e7fa5edf320bb21f03d11bd357b7
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-05-29 23:22:47 +02:00
Alexandru Croitor
a9fbe53966 CMake: Regenerate tools and 3rd party
Change-Id: I38e065cddc954e8594a5dce823c3bb5385a8a1e8
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-05-29 23:22:43 +02:00
Alexandru Croitor
abe3dbe719 CMake: Regenerate src/opengl
Change-Id: I6a648c5fd2fa90e6e70d0ccffb34fd3cb1161e5e
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-05-29 23:22:39 +02:00
Alexandru Croitor
c67c05ee0e CMake: Regenerate src/corelib
Change-Id: I985f9cca78e173f066d65e704c101d499668163a
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-05-29 23:22:35 +02:00
Alexandru Croitor
41b1eaf579 CMake: Regenerate src/gui
Remove the manual modifications, and let the script do its work
and use the .pro file as the source of truth.

Change-Id: I510d5487a326d72a9c19e8148ec1daac9a23394b
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-05-29 21:22:31 +00:00