Commit Graph

51783 Commits

Author SHA1 Message Date
Volker Hilsheimer
05a04c80e0 macOS: render shortcuts in context menus correctly aligned
On macOS, shortcuts should be rendered along the imaginary line between
the modifiers, and the key. The modifiers are right-aligned on the left
side of that line, the key left aligned on the right side.

Make an exception for multi-chord sequences, render those always left
aligned.

Pick-to: 6.1
Fixes: QTBUG-73990
Change-Id: Ie03f3f40278700bdfafbfca7aa52075825e20234
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2021-06-02 23:56:17 +02:00
Volker Hilsheimer
64a64fd485 macOS: render shortcuts in context menus correctly aligned
On macOS, shortcuts should be rendered along the imaginary line between
the modifiers, and the key. The modifiers are right-aligned on the left
side of that line, the key left aligned on the right side.

Make an exception for multi-chord sequences, render those always left
aligned.

Pick-to: 6.1
Fixes: QTBUG-73990
Change-Id: Ie03f3f40278700bdfafbfca7aa52075825e20234
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2021-06-02 23:40:54 +02:00
Alex Trotsenko
01639b7cc2 QProcess: refine 'Channel' structure
- exclude unused notifier pointer on Windows;
- use default initialization for members;
- avoid bit fields in declarations as there are extra
  padding bytes anyway.

Change-Id: I2e03c4c269c885c90c0a6d18b8a935885f4b3feb
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2021-06-03 00:38:05 +03:00
Eirik Aavitsland
2b52452843 Add load/fromdata() overloads taking QByteArrayView to QImage
Handy when one has the data buffer to be read in a QBAV.

This also fixes an issue and compiler warning about passing a
qsizetype data length value as an int, and makes it possible to pass
a qsizetype-size length without going through QByteArray.

Makes the QByteArray overload redundant.

Change-Id: Iba8825cf0fd8003fb2eac5b1d30a61ec91b85ceb
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2021-06-02 23:02:45 +02:00
Karsten Heimrich
5b6f5c6fc2 Make bool isSymLink, isJunction inferred from resource.type
Change-Id: I90574b62c8d21e3559fb219543f564454b4335e1
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-06-02 23:02:45 +02:00
Eirik Aavitsland
7c0c0955ed Fix warnings about qsizetype used as int in qpainter.h
Fixes: QTBUG-89273
Change-Id: Ibf3aff3bdb42fe5260cac528355f412c6ae0218f
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2021-06-02 21:02:45 +00:00
Heikki Halmet
2a8cc9926e Avoid setting DCMAKE_C_COMPILER and DCMAKE_CXX_COMPILER twice
If these values already exist do not add them to configure. This also
allows setting these values from platform configurations

Change-Id: I2f2aea90d91fa3436953e0c4103f0ea204b3564b
Reviewed-by: Toni Saario <toni.saario@qt.io>
2021-06-02 21:02:45 +00:00
Karsten Heimrich
01f003f0aa Refactor createSymbolicLink() and createNtfsJunction()
Both functions now return a result object. Eliminates the need
to pass the errorMessage out-parameter. Adapt auto-tests.

Change-Id: I110b68fedc67b01f76796c44fa55383b2cc03460
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-06-02 23:02:45 +02:00
Karsten Heimrich
ebacf42561 Move createSymbolicLink() to the shared header
Change-Id: I737f521791faf07d704e15d36d57444b3187ba9d
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-06-02 23:02:45 +02:00
Friedemann Kleint
70cc0885f9 QtGui: Fix include convention
Use the module in qtx11extras_p.h, qguiapplication_p.h.

Pick-to: 6.1
Task-number: PYSIDE-1568
Change-Id: Iaf004d3fdad8472629d6f4d35031b517b3b735ce
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2021-06-02 23:02:45 +02:00
Heikki Halmet
e75bd6e09a Add option to use different ANDROID_EMULATOR
This change add option to determine used Android emulator version using
environment variable. If variable is not set @x86emulator will be used
as default value.

Change-Id: Ifc52d07d058bf078bf915ca78683822a966b58fb
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2021-06-02 21:02:41 +03:00
Assam Boudjelthia
01e35a2145 Increase the timeout for test targets
The Android test VMs take almost the same amount of time of that set to
the test timeout, this is causing it to be killed by COIN in some cases.

This is for example a stat from a successful test instance:
   Total Test time (real) = 7110.20 sec

It's very close to 7200 which is the timeout value. The VM is taking
that long because the tests are only half built, the projects' shared
libs are built during the Build step of the integration, and the actual
apk (Gradle build) is done later when doing a ninja tst_name_check.
This latter behavior should be changed so that the apks are built before
going to testing.

So it makes sense for now to increase the timeout and avoid having to
restage multiple times.

Task-number: QTBUG-94127
Change-Id: I31783bcc1255c7821134e174ab6b0fb199000272
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Heikki Halmet <heikki.halmet@qt.io>
2021-06-02 21:02:41 +03:00
Andrei Golubev
e6a2892772 moc: Add relative property index to JSON output of PropertyDef
Needed for QML compiler to know property index of C++ type at
compile time without going through QMetaObject::indexOfProperty

Change-Id: I404e71d6071d36812661df17d12b879a8dcbd146
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-06-02 19:03:45 +02:00
Janne Koskinen
6ef69bcef2 Fix system locale for Integrity
Integrity doesn't have langinfo, default locale is C, set to UTF-8

Change-Id: I6a6374195344641f64da895cd5f2745b61af060a
Reviewed-by: Kimmo Ollila <kimmo.ollila@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Tuukka Turunen <tuukka.turunen@qt.io>
2021-06-02 18:30:04 +03:00
Fabian Kosmale
d5ab0101ff Avoid use after free in tst_qsequentialanimationgroup
The test connects finished to the groups clear method, which in turn
deletes the animation instance. Thus, no member must be accessed after
calling stop, unless we use a (costly) QPointer to guard against
deletion.
Notify earlier that totalCurrentTime changed to avoid the issue.
As a drive-by, modernize the connect in the test.

Fixes: QTBUG-94143
Change-Id: I923101107b7f79115be69a58c8e8d5177a98d48f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2021-06-02 16:45:23 +02:00
Assam Boudjelthia
78ed8034d2 Add a const JNINativeMethod[] overload for registerNativeMethods()
The JNI interface expects a const JNINativeMethod[] and our wrapper
takes a non-const. Also, this was causing refactoring of exisisting code
with a const JNINativeMethod[] to fail because the call expects a
non-const.

Change-Id: If790c401650cb33fe31f93bafe41aab7714488e9
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2021-06-02 08:20:17 +00:00
Assam Boudjelthia
6d72896d0c Remove unnecessary = signs from build.gradle
Change-Id: Ic7090ec2003b20a809f8920bae28bc9b88733cb8
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2021-06-02 11:20:08 +03:00
Assam Boudjelthia
eaac5bae98 Silence misleading exception print in setQtContextDelegate
As I understand it, the call to getDeclaredMethod seems to be just there
to check if a given method is declared under before adding it to the
delegates list, and that's why the getDeclaredMethod is not returning
anything, so we could treat it as a failed check and not print anything.

This is an amendment to 80f7494e8a which
added this print.

Pick-to: 6.1 5.15
Change-Id: I5f69ed5b4fa655da53ac7fba20d4e07acc75607a
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2021-06-02 11:20:02 +03:00
Assam Boudjelthia
7134843793 CMake: Add Android's prepare_apk_dir target to ALL
Since Qt Creator uses androiddeployqt custom commands it still needs a
step to prepare the apk dir before building it, so add this to ALL
to avoid having to call it manually in creator.

Pick-to: 6.1
Change-Id: I0a2816244589e9b296a326fcc1abf8c08aabfea7
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-06-02 08:19:54 +00:00
Assam Boudjelthia
ed431caa27 Android: fix mimetype/namefilters handling for FileDialog
Android file dialog uses setType() to set the main mimetype for the
dialog if no mimetype or multiple (+1) mimetypes are provided, then
the additional mimetypes can be provided via EXTRA_MIME_TYPES flag.
The problem was that the mimetypes deduction from the namefilters was:

* the namefilter used was empty, now we take the first item
nameFilters(), because mimetypes cannot be changed once the dialog is
open anyway.
* The regex extraction was getting a namefilter ending with an empty
char and that was giving a mimetype of any format thus making it show
all possible files.

Pick-to: 6.1 5.15
Fixes: QTBUG-83089
Change-Id: Ifaef40c2186732ad3a604d28e086409c35dafacf
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2021-06-02 08:19:47 +00:00
Assam Boudjelthia
2a6e30c9c4 Android: make the help print a bit easier to read and navigate
Add new line between each argument type in the help print to make it
easier to read and not a big wall of text.

Change-Id: I7c7b2d2b59ef3a0889d1bb8c7af3d00b82bf820d
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2021-06-02 08:19:37 +00:00
Li Xinwei
2c49f85380 CMake: Fix generated prl and pri files for MSVC
In MSVC static build, if we build Qt with 3rdparty library (e.g. zstd),
cmake will add"zstd" (without "-l" prefix) to Qt6Core.prl. Then we
use this Qt to build a qmake project, compilation will fail due to
missing zstd.obj. Without "-l" prefix, qmake will treat "zstd" as an
object file instead of a library.

Library names in qt_module.pri and qt_lib_*_private.pri are also
missing "-l" prefix.

This is because on most compilers, CMAKE_LINK_LIBRARY_FLAG equals
"-l". But on MSVC, it is an empty string. So we should pass
"-DLINK_LIBRARY_FLAG=-l" for MSVC.

Also add "-L/path/to/library" if the library path is not in default
linker search directories. This will write un-relocatable paths to prl
files only when using 3rdparty libraries to build Qt statically. Usually
it's not a problem.

In addition, CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES is also empty on
MSVC. So The third argument of "$<FILTER>" is empty, it is an invalid
generator expression. This means no include dir will be written to
qt_module.pri and qt_lib_*_private.pri on MSVC. So only use "$<FILTER>"
when CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES is not empty.

Pick-to: 6.1
Change-Id: Ib66f95dc09cf920363a4b9338fb97747dd2f8ab7
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-06-02 13:32:06 +08:00
Morten Sørvig
350902f1cd wasm: map named key attribute “Meta” to Qt::Key_Meta
This value is sent by Apple keyboards, and was missing
from the table.

Change-Id: I49ad7ea74f2571c60ee9f2547468777b1f4585d8
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2021-06-02 01:33:49 +02:00
Friedemann Kleint
6ac77e81ae Regular Expression example: Brush up and add a way to preview replacements
- Set a fixed font on text edits so that parentheses stand out
- Rearrange the layout to have the text at the top be prevent
  long texts from being wrapped
- Add a replacement field where one can exercise replacement
  with the \1, \2... placeholders.

Pick-to: 6.1
Change-Id: I140a62e1fb2cd1c6bfe02a2f01b7f06a6f3b5eb2
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2021-06-01 21:54:35 +00:00
Friedemann Kleint
c59fbf576d Fix QSettings documentation
QMainWindow::saveGeometry()/restoreGeometry() should be used
to save and restore geometries instead of saving pos/size
since it also works in multiscreen settings.

Pick-to: 6.1
Change-Id: I27cc5ec13e69266367f035796e208d214f84b043
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-06-01 23:54:35 +02:00
Joerg Bornemann
253d97cce6 Fix EXTRA_CMAKE_FILES behavior of qt_internal_add_tool
...and make it consistent with that of qt_internal_add_module.

Make EXTRA_CMAKE_FILES a multi value keyword.
Do not add include statements for every file in EXTRA_CMAKE_FILES.
Add the EXTRA_CMAKE_INCLUDES argument to specify includes.

This enables us to specify EXTRA_CMAKE_FILE that are not included.

Change-Id: I1a3667473b94ee44363b554ab9e6c380e5c11389
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-06-01 23:52:50 +02:00
Povilas Kanapickas
f6b149fffb xcb: Fix touch grab handling on pre-XI 2.2
This is only a theoretical bug fix because systems that don't support XI
2.2 are ten years old by now.

Change-Id: Ia3770a6ca626b60d0f1e4cd2fdc611adf99cbf25
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2021-06-01 21:25:33 +03:00
Joerg Bornemann
20feedac95 Pass OpenGL_GL_PREFERENCE variable to other Qt repos
When building Linux packages, we pass OpenGL_GL_PREFERENCE=LEGACY when
building qtbase. This is done to link against legacy OpenGL libs.

When building non-qtbase repos, we also need to set this variable to the
same value we have in qtbase.

Pick-to: 6.1
Task-number: QTBUG-89754
Fixes: QTBUG-94040
Change-Id: I567b629d245025d2b1544b91cfc265a9c921725f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-06-01 20:21:49 +02:00
Alexey Edelev
25888b068c Do not get LINK_LIBRARY of the interface libraries
Avoid getting the LINK_LIBRARY property of the interface libraries
when calling a resource object finalizer.

Amends a1fd4f51ad

Change-Id: I19d625a927c66994902f5c89e6c82183c94af91e
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-06-01 20:21:49 +02:00
Giuseppe D'Angelo
c2c4266c8c SQLite plugin: use QString::unicode(), not utf16()
utf16() reallocates a QString if it was created from raw data, in order
to ensure NUL termination. But here we don't need NUL termination
anyways because we also pass the string size, so just use unicode()
instead.

Change-Id: I4a01ab9f4e53b94b80d3d00272cb0f0e35e30959
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2021-06-01 20:21:49 +02:00
Alexandru Croitor
bc80067266 CMake: Create global imported versionless tool targets
Versioned tool targets are always promoted to global targets.
Versionless ones were not promoted to global targets.

This was an oversight which caused issues with conditions like
if(TARGET Qt::Tool) in top-level builds.

Fixes: QTBUG-93839
Change-Id: I5176899b5d0d80bfd0b350bc9c4b3fa5b53c0777
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-06-01 16:29:15 +02:00
Lars Knoll
6c1a9f2b4d Simplify storing of notification objects
QPropertyChangeHandler is a templated class and it's argument is
a functor. That makes it inherently cumbersome to use the class
in any context where the change handler needs to be stored.

Introduce a QPropertyNotifier class that stores the functor
in a std::function<void()>, and add a QProperty::addNotifier()
method that can be used instead of onValueChanged().

Also make QPropertyNotifier default constructible.

This significantly simplifies the code that needs to be written
and makes it possible to store notifications as class members
without major hassle.

Fixes: QTBUG-92980
Change-Id: Id5b7baec093b9ac0467946cded943d92ad21030b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-06-01 16:29:15 +02:00
Friedemann Kleint
de15836dbf uic: No longer generate star imports in Python
Use class WriteIncludesBase and store classes encountered in a
per-module hash (Qt/custom widgets). Write out only the required
classes.

Add --star-import as a fallback should the change cause issues.

Task-number: PYSIDE-1404
Change-Id: Ic50e26758ddd0f2f8aebbce470d32a36fb09a2c4
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
2021-06-01 16:29:15 +02:00
Mitch Curtis
b42e2d70fb Move QIdentityProxyModelPrivate out into its own header
qtquickcontrols2 needs to use it.

Change-Id: Ic5e3105095a8fcd36a38a3ce4353db4057ada0de
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: David Faure <david.faure@kdab.com>
2021-06-01 16:29:15 +02:00
Nicholas Bennett
190ef1c23b Update the COIN build instructions to also build creator help file
Changed the cmake build target from "generate_docs" to "docs"

Pick-to: 6.1
Fixes: QTBUG-93174
Change-Id: I244290888f578ccfee4c733cd8f93bb6faed4fda
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2021-06-01 11:58:50 +00:00
Topi Reinio
bee6f91686 Doc: QtCore: Fix documentation issues
* Add module header wrapper that loads the real QtCore header and
    qandroidextras_p.h to generate docs for those types
  * Add missing dummy typedefs to doc/include/jni.h
  * Use the correct \namespace name (QtAndroidPrivate) and mark it
    as \preliminary
  * Add missing 'const' specifier for Q[Untyped]Bindable methods
  * Drop documentation for removed method QProperty::markDirty()
  * qmath.h: Fix \fn commands for qFloor(), qCeil()
  * QHashSeed: Drop incorrect usage of \relates

Fixes: QTBUG-93942
Task-number: QTBUG-93995
Change-Id: If76b5aa4b79a64add3cb6275eac82ec44ef10319
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2021-06-01 11:44:43 +00:00
Elvis Lee
96afaf41ca Support hardware composition for webOS
In similar way with vsp2, the interfaces are needed to support
qtwayland hardware layer for webOS.

https://doc.qt.io/qt-5/qml-qtwayland-compositor-waylandhardwarelayer.html

Change-Id: I14481373d696b501a774b9258da789554065a6ea
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Elvis Lee <kwangwoong.lee@lge.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2021-06-01 11:44:43 +00:00
Andrei Golubev
bf1fdfd4fb qpixellayout.cpp: mark some specializations of fetchPixel as unused
Triggers -Wunused-function warning (a.k.a. error) when building this
part of the code:
qpixellayout.cpp:292:25: error: unused function 'fetchPixel' [-Werror,-Wunused-function]
inline uint QT_FASTCALL fetchPixel<QPixelLayout::BPP64>(const uchar *src, int index)
                        ^
qpixellayout.cpp:300:25: error: unused function 'fetchPixel' [-Werror,-Wunused-function]
inline uint QT_FASTCALL fetchPixel<QPixelLayout::BPP16FPx4>(const uchar *src, int index)
                        ^
qpixellayout.cpp:308:25: error: unused function 'fetchPixel' [-Werror,-Wunused-function]
inline uint QT_FASTCALL fetchPixel<QPixelLayout::BPP32FPx4>(const uchar *src, int index)

Change-Id: I8ff40e3cf02f8a7ad7534f58ac23eeb8eb716d3a
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2021-06-01 09:02:15 +02:00
Inho Lee
7ea2fbddcf QtGui/math3d : Fix QQuaternion::getEulerAngles
When rotating M_PI_2 based on x-axis, quaternion to euler conversion
makes NaN for the x-rotation value.  This patch fixes this corner case.

Fixes: QTBUG-93600
Pick-to: 6.1 6.0 5.15
Change-Id: Ice321a80ad90dba9cf3ee3a14ec7d3d047c21bd3
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2021-06-01 09:01:23 +02:00
Shawn Rutledge
4f853744c9 Add fingerCount to qDebug output for QNativeGestureEvent
Followup to 31f90e99b8.
The number of fingers involved in a gesture will likely become a key
feature to make different behaviors distinct.

Change-Id: Ib41b2fa7ab4ea7d008a6479c018b3d475a62a8fd
Reviewed-by: Povilas Kanapickas <povilas@radix.lt>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-06-01 06:08:55 +02:00
Alexandru Croitor
42eb1e4aa6 CMake: Allow printing config summary even if module is not built
In the future it might be useful to print the config summary entries
of a Qt module configure.cmake file even if the associated module
is not built and thus qt_feature_module_begin is not called.

The repo src/CMakeLists.txt could then use a combination of
qt_feature_evaluate_features and a conditional
qt_feature_record_summary_entries to ensure the that summary entries
are still shown.

Change-Id: I124efc82163ddae48d9e72c70a677ec4c6588fac
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-06-01 02:49:41 +02:00
Giuseppe D'Angelo
0f38259cb3 SQLite driver: fix crash when binding a QByteArray/QString
Passing SQLITE_STATIC to sqlite3_bind_*() means that ownership
of the data stays in the caller, i.e. SQLite itself doesn't make a copy;
such data must be therefore be kept valid until sqlite3_step() is called.

The code in the SQLite driver uses that option to avoid copying byte
array or string data. But, unlike what the comments in the code say, we
do NOT keep the QByteArray/QString alive long enough: they're contained
by a temporary QVariant object which gets destroyed at the end of the
loop that binds each argument.

Luckily the fix is simple: since that QVariant is just a copy of the
QVariants used as bound parameters, and these are held in a container
(which lives long enough), simply create a reference to the container's
elements rather than a copy. This ensures that the data is alive by
the time sqlite3_step() is called.

This problem doesn't normally appear because of implicit sharing of
QByteArray/QString. When the QVariant is copied, the inner element
is just a shallow copy. Getting the pointer to the data, and destroying
the QVariant, does not destroy the data (it's kept alive by the
QByteArray/QString inside the *copied-from* QVariant).

Of course there's a catch: if the *copied-from* QVariant contains a
QString created via fromRawData, then everything blows up. In this case,

1. the copied QVariant is created (which bumps the QString refcount)¹
2. the QString inside of it is accessed directly (via
QVariant::constData)
3. utf16() is called on that string, which detaches it (!)
4. the result of utf16() is passed to SQLite, with SQLITE_STATIC
5. the copied QVariant is destroyed; this destroys the inner QString,
which, being detached, deallocates the data too early.
6. sqlite3_step() is called, kaboom.

(The copied-from QVariant still has the string created by fromRawData.)

¹ Note that QString uses the Small QVariant Optimization, so the QString
object itself into the QVariant is copied, it's not just a *QVariant*
refcount increase.

Change-Id: Idcdb192809f1f8f79b4a901e1247f933eb06e854
Pick-to: 6.1 5.15 5.12
Fixes: QTBUG-94070
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2021-05-31 23:12:46 +02:00
Alexey Edelev
459529ace9 Add the 'Private' suffix to the internal module name by default
Modify pro2cmake to add the 'Private' suffix to the internal module
name by default.

Change-Id: Ia7b2fce387fad5f207a7379ac738173ff9262071
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-05-31 20:50:07 +02:00
Alexey Edelev
75fffe0067 Add the 'Private' suffix to the internal module names
Rename internal modules to adjust their names to the internal module
policy. Also modify mappings of the qmake file converters.

Change-Id: I69aee1e8136c2379608d9d22d718f8c8a5f73124
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-05-31 20:50:07 +02:00
Alexey Edelev
4333bfd9d8 Move the framework related information to the common function
Since the information about framework is performed in multiple places
it's quite hard to control its consistency. This moves the obtaining
of framework related information to the common function and adjusts
the use of the information across the repo.

Change-Id: I1f488d41dcea75a1e8c361926792a6b7c45e5a3f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-05-31 20:50:07 +02:00
Alexey Edelev
a1fd4f51ad Rework resource finalizer approach
In the previous implementation of the resource object finalizer, we
used the name of the resource object library without namespaces when
recording it in the resource libraries list. This causes an issue when
we or users export resource targets.

This approach marks resource object libraries with the exporting
property instead of collecting resource targets when creating them.

Amends 19e789bace

Change-Id: I8596815921f2c681ddd78d9b2e9a4e1cafe5000b
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-05-31 20:50:07 +02:00
Alex Trotsenko
64d6003f49 Introduce QProcessPrivate::closeChannels()
Avoid duplicating code for both platforms.

Change-Id: Iae00023672b63e8539cf824fa3aaaff2bf9ae0c5
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2021-05-31 21:50:07 +03:00
Alex Trotsenko
86542054d0 Consolidate debug string generation
Several QIODevice subclasses use the qt_prettyDebug() function to get
a printable representation of the buffer data for debug output.

Rather than having this feature statically implemented in each
respective file, this patch introduces a generic function in the
QtDebugUtils namespace. Accordingly, some inaccuracies in the
use-cases have been corrected.

Change-Id: I1a8465cab08c8acf5fdcdba5085182511b1cbb7b
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-05-31 21:50:07 +03:00
Mårten Nordheim
59a0539690 QNetworkInformation: Captive portal support for Android
Task-number: QTBUG-93848
Change-Id: Ia74ed0a756dc2bf71c7172e21ac4ff2361150b32
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2021-05-31 17:25:25 +02:00
Mårten Nordheim
da955aadf5 QNetworkInformation: Behind captive portal
This patch adds the API, with no supporting backends

Task-number: QTBUG-93848
Change-Id: I50454717f928819e1b990df91872675e842f9987
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2021-05-31 17:25:22 +02:00