Commit Graph

37378 Commits

Author SHA1 Message Date
Timur Pocheptsov
734ab493f7 Fix a BIC introduced by extending the namespace QSsl in _p.h files
Renamed the private part of the namespace to QTlsPrivate.

Fixes: QTBUG-91531
Change-Id: Id2d9c458d8d958b35e437eee42889177dad0a7a7
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit e4efa00c72c7011f4e5c27722c2a522b30274610)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-03-05 20:50:02 +00:00
Andreas Buhr
b2c96423bb Merge "Add documentation for Q_OBJECT_BINDABLE_PROPERTY" 2021-03-05 18:51:54 +00:00
Allan Sandfeld Jensen
d9da78b620 Merge "Add ARM version of the "AES" qhash algorithm" 2021-03-05 18:45:55 +00:00
Fabian Kosmale
9e6ad5dc22 Merge "qtypeinfo: make variable templates inline" 2021-03-05 17:18:47 +00:00
Øystein Heskestad
de658d8ca5 Merge "Make qdecompresshelper archive bomb check only trigger for large files" 2021-03-05 16:32:49 +00:00
Allan Sandfeld Jensen
ecf84e0989 Add ARM version of the "AES" qhash algorithm
Change-Id: Ia2c20e970a0149efb7665a5690538f83965e7be7
Reviewed-by: Erik Verbruggen <erik.verbruggen@me.com>
2021-03-05 18:31:27 +02:00
Andreas Buhr
89cc39a894 Add documentation for Q_OBJECT_BINDABLE_PROPERTY
The duo Q_OBJECT_BINDABLE_PROPERTY and QObjectBindableProperty
can only be documented together. The documentation is now with
QObjectBindableProperty. This patch adds a documentation entry
for Q_OBJECT_BINDABLE_PROPERTY which links the user to
QObjectBindableProperty.

Task-number: QTBUG-90511
Pick-to: 6.0 6.1
Change-Id: I9af4a99d49f4b02ee9645a2cc9a9a024a6a1a552
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-03-05 15:42:45 +00:00
Wang Yicun
89e9164abb Merge "Simplify code, remove redundant condition" 2021-03-05 15:35:26 +00:00
Zhang Hao
f13451539f Merge "Code tidies" 2021-03-05 15:14:28 +00:00
Giuseppe D'Angelo
bcedeb6d3d Merge "QPoint(F): declare as PRIMITIVE, not RELOCATABLE" 2021-03-05 14:38:41 +00:00
Fabian Kosmale
6de9acf779 qtypeinfo: make variable templates inline
And refactor the TMP to use std::conjunction and use variable template
specialization instead of template class specialization for the base
cases.

Change-Id: Iea6a03f13ea3443a0fa7365af21c496670c1e07f
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2021-03-05 15:30:05 +01:00
Øystein Heskestad
be73ca7eb1 Make qdecompresshelper archive bomb check only trigger for large files
This is to avoid false positives.
By default files are large if uncompressed size > 10 MB. Only configurable internally.
Also add auto tests.

Task-number: QTBUG-91392
Pick-to: 6.0 6.1
Change-Id: I32258cb7c957f2a23a05157ba4ed5c0af2ba585e
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-03-05 15:13:53 +01:00
Wang Yicun
a913002f13 Simplify code, remove redundant condition
'clazz || (!clazz && isCached)' is equivalent to
'clazz || isCached'

Done-with: Tang Peng <tangpeng@uniontech.com>
Pick-to: 6.1
Change-Id: Ie9eab4a94a61be2b360f64980c4666a622f3a209
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-03-05 13:52:31 +01:00
Paul Wicking
c1c61c3bb4 Doc: Fix section titles that confuse QDoc's autolinker
Fixes: QTBUG-91620
Pick-to: 6.1 6.0
Change-Id: I7c407c7158324d1fbbeb78e47d2198e8ddf5daa0
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-03-05 13:47:53 +01:00
Zhang Hao
2801dc7f04 Code tidies
The return type goes on the same line of the rest of the signature.

Change-Id: Icacf2e00ed2876c4c9b72b8f6c428c2e37ee42a7
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2021-03-05 12:26:47 +00:00
Toni Saario
90371e9250 Merge "Skip globalstatic threadStressTest on QEMU" 2021-03-05 11:02:17 +00:00
Giuseppe D'Angelo
48f685f5e5 QPoint(F): declare as PRIMITIVE, not RELOCATABLE
These types can be copied via memcpy, so use the correct tag.

Change-Id: Icba37d42dd8658225ce4889284661d108122d489
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
2021-03-05 11:19:46 +01:00
Giuseppe D'Angelo
5f501b0e97 QQuaternion: mark as PRIMITIVE type
Change-Id: I043fef8bfc66875b72f34e7939e78c7d1c7f5381
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-03-05 11:19:44 +01:00
Piotr Mikolajczyk
5c6b10c3ce Android: Place cursor correctly on screen when editing
When editing text the cursor is not placed correctly. So this
has been achieved by tricking Android into thinking that the
input area is only the line where the cursor is, so it is
forced to keep it on screen.

Fixes: QTBUG-91073
Pick-to: 5.15
Change-Id: Icc2e8315deb76ca1a84819d3fdceaa7b027b1174
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2021-03-05 07:57:14 +00:00
Wang Yu
852b070529 QContiguousCache: Remove redundant condition
The reverse condition was already checked three lines before.

Pick-to: 6.1
Change-Id: I2f78262004871ec2f3730e2a25f26fe22636cde7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-03-05 07:27:14 +00:00
Allan Sandfeld Jensen
9fb81fc287 Merge "Add QColorSpace::description" 2021-03-05 00:04:34 +00:00
Volker Hilsheimer
26b53173d6 Merge "QMenu test: turn tooltip animations off" 2021-03-05 00:02:41 +00:00
Volker Hilsheimer
a60f763f25 Merge "Protect against self-assignment, plug potential memory leak" 2021-03-04 22:24:48 +00:00
Joerg Bornemann
48488b810f Fix Android build
The Android build failed, because the namespace QNativeInterface could
not be found. Include the header file where it's defined.

Change-Id: If53eda4d4d4e6d5e66787d74c714215721ba0b60
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2021-03-04 22:39:21 +01:00
Allan Sandfeld Jensen
01c55405fa Add QColorSpace::description
A way to read the description of the profile from ICC, or set one
yourself.

Change-Id: I68622e30ee209cac99c41f3df934712c3548c0de
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2021-03-04 22:37:08 +01:00
Paul Wicking
3ae67b4434 Merge "Doc: Use correct include for QWGLContext" 2021-03-04 21:24:32 +00:00
Volker Hilsheimer
3ae09debab Protect against self-assignment, plug potential memory leak
Fixes static analyzer warning f03d95823e9f1395d64501cc111f0f63

As a drive-by, plug the potential memory leak if the assigned-to
QDockAreaLayoutItem already holds a QDockAreaLayoutInfo object.
The subinfo is deleted in the destructor, QDockAreaLayoutItem
has ownership for the subinfo.

Pick-to: 6.1
Change-Id: I8546adc6fb0537078eea9dfb45d1bd9967d8d149
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2021-03-04 19:58:44 +01:00
Paul Wicking
15f934dcea Doc: Use correct include for QWGLContext
Pick-to: 6.1 6.0
Task-number: QTBUG-91500
Change-Id: If487a2d14dd61d127dc35aa039f9b71915128da1
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-03-04 18:32:32 +01:00
Thiago Macieira
224c638f78 QProcess/Unix: use a common function to find the target executable
This harmonizes the execution between start() and startDetached(). Both
did QStandardDirs::findExecutable(), but duplicated code. However, only
start() supported launching .app bundles on Mac.

[ChangeLog][QtCore][QProcess] startDetached() now supports launching
.app executable bundles on macOS / iOS systems, like start() already
did.

Change-Id: Ic90d8429a0eb4837971dfffd1664f776b2c0edfd
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2021-03-04 09:14:04 -08:00
Alexey Edelev
3875575ab6 Merge "Fix build of Core module without regularexpression feature" 2021-03-04 13:32:07 +00:00
Joerg Bornemann
94d5c1bfe0 Merge "Remove win32_system_libs feature from src/corelib/configure.json" 2021-03-04 11:26:42 +00:00
Kai Köhne
52f99ff3d2 Merge "headersclean: Compile with -std=c++latest, -Zc:__cplusplus on MSVC" 2021-03-04 11:11:36 +00:00
Alexey Edelev
6e5e8016dd Fix build of Core module without regularexpression feature
qregularexpression.h requires FEATURE_regularexpression to be enabled.
Add a condition to the 'qt_pch.h' header to fix the build when PCH
are enabled and FEATURE_regularexpression is disabled.

It seems that the filter implementation of QSortFilterProxyModel
has QRegularExpression as its base. It's necessary to make
sortfilterproxymodel dependent on the regularexpression feature.

Fix the precompiler condition for the extractSections function in
the QString implementation. Use the same precompiler condition for
the QString::section and extractSections functions, since
QString::section depends on extractSections.

Change-Id: I5b775e0842a0aa1a8d47f8dded376bdfcf63b5bf
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-03-04 11:31:36 +01:00
Joerg Bornemann
4b9173e354 Fix QT_HOST_LIBEXECS for cross-builds on Windows
Like for LibraryExecutables, we must default to "bin" on Windows for
HostLibraryExecutables in our generated qconfig.cpp.

Pick-to: 6.1
Fixes: QTBUG-91496
Change-Id: Ib5a4b3b3fd6192bd953e615058b482e67ad19462
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-03-04 10:31:31 +00:00
Albert Astals Cid
eeb4c0a1c9 Merge "Fix signature of canDropMimeData used in code snippet" 2021-03-04 10:22:45 +00:00
Andrei Golubev
70bd6bf1e3 Merge "Fix compilation error in QDateTime" 2021-03-04 09:40:01 +00:00
Joerg Bornemann
00b75e86f3 Remove win32_system_libs feature from src/corelib/configure.json
This feature only existed to trigger the evaluation of the libs gdi32,
kernel32 and friends. Those libs only were relevant for the qmake build
of Qt and can be removed now.

Task-number: QTBUG-83932
Change-Id: Idfd4d8f70b6dbd1067412fecc1115b504b1ad347
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2021-03-04 09:56:09 +01:00
Sona Kurazyan
fcc453df5c Improve docs for Qt Concurrent run with promise mode
For the readers that are new to QtConcurrent, it may be confusing that
unlike the normal usage of QPromise, they don't have to call start() or
finish() when using Qt Concurrent run with promise mode. Be more
explicit about that.

Pick-to: 6.1
Change-Id: I08df6c4ca41bec4120e208a6643ee20c7adf265c
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2021-03-04 09:45:31 +01:00
Timur Pocheptsov
7c1aa0c48c Convert QDtls classes to the new plugin-based design
Essentially, the same code re-shuffled and placed behind
the new interfaces.

Fixes: QTBUG-91174
Task-number: QTBUG-65922
Change-Id: I8f14697f10713f9738c5c7805aed0150c084850c
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 6c835796c8ea2590008900ffb5f4bf0d902ee73d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-03-04 08:40:07 +00:00
Albert Astals Cid
b22fe78d85 Fix signature of canDropMimeData used in code snippet
Change-Id: I9026e11630651e740282466551ad78883a0421ec
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-03-04 09:04:17 +01:00
Eirik Aavitsland
ede0082f86 Update bundled libjpeg-turbo to version 2.0.6
[ChangeLog][Third-Party Code] libjpeg-turbo was updated to version 2.0.6

Pick-to: 6.1 6.0 5.15 5.12
Change-Id: I3e308d241853edf3c1d616955cda203220a258d8
Reviewed-by: Liang Qi <liang.qi@qt.io>
2021-03-04 09:04:02 +01:00
Andrei Golubev
538e9fa568 Fix compilation error in QDateTime
One of the changes done in 902505a058
results in a compilation error: somehow an expression
"int * enum value (with underlying type qint64)" has result type
"long int" and thus the compiler cannot find matching add_overflow

Return the qint64 cast back to overcome this
Compiler: gcc 7.5.0-3ubuntu1~18.04

Change-Id: Iaca882762e812bef69ec325df5f59e02082a0130
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-03-04 08:26:30 +01:00
Giuseppe D'Angelo
fe9d7bf759 QScopedPointer: deprecate swap
Follow up of 612a01be65
(deprecating QSP::take()): for the same reasons, swap()
functions do not belong to QScopedPointer, or they would
allow the pointer to escape:

  QScopedPointer a;
  {
    QScopedPointer b = ~~~;
    qSwap(a, b);
  }
  // b's pointer escaped its scope

Deprecate them as well.

[ChangeLog][QtCore][QScopedPointer] QScopedPointer swapping
functions have been deprecated, as they would allow the
managed pointer to escape the scope. If you need those semantics,
use std::unique_ptr instead.

Change-Id: I2b0938b62f2ef5a3561f61f595a3fb4c505a8f08
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-03-04 06:49:02 +01:00
Zou Ya
712117f8b8 Redundant condition: tornoff
Redundant condition: tornoff.
'!tornoff || (tornoff && scroll)' is equivalent to
'!tornoff || scroll'

Pick-to: 6.1
Change-Id: I8339faa4d53360db280173ee489e48eba4883b70
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-03-04 10:34:43 +08:00
Huang Jie
d3ec08eea0 Redundant condition: widget
Redundant condition: widget. '!widget || (widget && widget->isEnabled())'
is equivalent to '!widget || widget->isEnabled()'

Pick-to: 6.1
Change-Id: Ife915bd5ea66f8ccff48a1612f8c78c263075c89
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2021-03-04 10:33:40 +08:00
Huang Jie
8a226cd76b Variable is Assigned a never used value in qt_make_filter_list()
Variable 'i' is assigned a value that is never used in qt_make_filter_list()

Pick-to: 6.1
Change-Id: Id845ecb5231b97a899443bdcb9f49cccb7f20bea
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-03-04 02:33:03 +00:00
Volker Hilsheimer
6e334a85a8 QHostInfo: simplify assignment operator
The d_ptr is never nullptr. If it could be, then other's d_ptr could
also be nullptr, and we would dereference the null pointer.

Guarding against self-assignment is nevertheless a good practice.

Fixes static analyzer warning
5fc3780532e30c6350a0aa1ad2188a4c.

Pick-to: 6.1
Change-Id: I07ff808e4c4f5bf07b4d6663f1fb4a3301a0fec7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-03-03 23:41:25 +01:00
Volker Hilsheimer
90b51219dd QMetaType::create: don't leak memory if copy can't be made
QMetaType::construct will return nullptr if a copy is requested but
if there is no copy constructor. In that case, the memory allocated in
QMetaType::create will be leaked.

This case is covered in the unit tests in

template<>
void testCreateHelper<QMetaType::Void>()

so we can't assert in construct that a copy constructor is present if
a copy is requested.

Fixes static analyzer warning 618b1e6877f737df57c39fd35ad91cd4.

Pick-to: 6.1
Change-Id: Ic439b36b1f120b9d0f888efaeab2801d8acc13de
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-03-03 23:41:14 +01:00
Giuseppe D'Angelo
0eca1f4a46 Merge "Port some value classes away from QScopedPointer" 2021-03-03 21:18:38 +00:00
Giuseppe D'Angelo
1086d9a572 Port some value classes away from QScopedPointer
In preparation for deprecation of QScopedPointer::swap, port to
other established solutions:

* QPainterPath was basically a QExplicitlySharedDataPointer
re-engineered around a QScopedPointer. Just use the right class
for the job...

* QBrush is in a similar situation, although its deleter is
more complex; port to unique_ptr for that one to minimize the
code impact.

Change-Id: I7f7c1dd8702f84f5146043347af64dda3c7e6f09
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2021-03-03 19:36:23 +01:00
Volker Hilsheimer
7b3883614d Initialize out-variable
QMetaType::convert does have code paths where nothing is written to the
'to' out-variable. Those code paths shouldn't run in this particular
case, but it's good practice to initialize out-variables anyway.

Fixes static analyzer warning 1453920f5abe1e30471eca6aa01d22d1.

Change-Id: I6f6d1044759866c405e61cb51147ca0490c4f3a4
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-03-03 19:16:55 +01:00
Timur Pocheptsov
3bf0a40a3b Merge "Convert elliptic curves and DH params to work with QTlsBackend" 2021-03-03 16:17:48 +00:00
Volker Hilsheimer
9a1f2c2461 Merge "Don't access data in moved-from object" 2021-03-03 15:31:17 +00:00
Timur Pocheptsov
ff76599b59 Convert elliptic curves and DH params to work with QTlsBackend
The corresponding API is becoming a part of QTlsBackend interface,
since it's too minimalistic and does not require additional
interfaces, unlike certificates or keys.

Fixes: QTBUG-91177
Fixes: QTBUG-91175
Task-number: QTBUG-65922
Change-Id: I44dd0adbdf2427962451998664efe234d59fae24
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit cdf4976b5a01bc5b65aed746acc9cc7f87b0fd97)
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2021-03-03 14:52:16 +01:00
Paul Wicking
afde5faf85 Doc: Specify correct include for QWGLContext
Pick-to: 6.1 6.0
Fixes: QTBUG-91500
Change-Id: Ie842c9e911fe5492cc13aeba459d28d6553438fd
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2021-03-03 14:51:01 +01:00
Laszlo Agocs
2cfbce4bc6 QOpenGLTexture: Fix typo in enum value
Pick-to: 6.1
Fixes: QTBUG-91431
Change-Id: I59c37de527f53339130216997402f325d0badb12
Reviewed-by: Jonas Karlsson <jonas.karlsson@qt.io>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2021-03-03 14:50:59 +01:00
Volker Hilsheimer
4daf83a0dc Don't access data in moved-from object
It's undefined behavior, esp since we leave it to the compiler to
implement a move constructor for the ButtonInfo struct. So read the data
that we need first.

Fixes static analyzer warning
de76eedae524c86f89d6369c0f5af8c7.

Pick-to: 6.1
Change-Id: I8fc458b7e9ba8904ec7a3b1c26aac0628e336ea2
Reviewed-by: Doris Verria <doris.verria@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2021-03-03 14:12:08 +01:00
Zou Ya
b487a7929d The condition 'if(oldChild)' is redundant
Either the condition 'if(oldChild)' is redundant or there is possible
 null pointer dereference: oldChild.

Pick-to: 6.1
Change-Id: I28971cfa33294679ddd325158669b422b3a1c2eb
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-03-03 20:52:45 +08:00
JiDe Zhang
b18a845bef Merge "fix: Print a warning message if the Xcb EGL initialize failed" 2021-03-03 11:40:28 +00:00
JiDe Zhang
cc7911beb1 fix: Print a warning message if the Xcb EGL initialize failed
Before, No matter what the value of "success" is, Will print
the "Xcb EGL gl-integration successfully initialized".
If egl initialization fails, this line of printing will be very
confusing.

Change-Id: I6a06e2c14372913823c56ffe2fd8b831e084c719
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2021-03-03 17:10:06 +08:00
Volker Hilsheimer
d984fd13ad QGraphicsWidget: don't dereference nullptr
Unlikely that one item is nullptr and the other item doesn't have a
scene, but we do already test for the scene pointer, so don't continue
if it's nullptr.

Fixes static analyzer warning f59576ecf6618447c4f9c7be93fc737f

Pick-to: 6.1
Change-Id: I6d436bb1211ddd412821d6978bab25192033f5e5
Reviewed-by: David Skoland <david.skoland@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2021-03-03 10:00:30 +01:00
Volker Hilsheimer
95e34f7fbc QGraphicsWidget: Check for nullptrs in focus chain handling
The while loops terminate if focusAfter becomes nullptr (unless we break
earlier), so don't dereference those pointers without checking first.

Fixes static analzyer warnings 979f2d508db4d5838f6c9b296120ce60 and
481f2ec7b5851bf19414478428f944b7

Pick-to: 6.1
Change-Id: I60fc5999907fe3b3146d7047ee1eff197719ab31
Reviewed-by: David Skoland <david.skoland@qt.io>
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2021-03-03 10:00:27 +01:00
Volker Hilsheimer
98db996576 Add nullptr checks to QGraphicsView classes
The styleInfo parameter defaults to nullptr, and the scene can evidently
be nullptr since we test for it before ungrabbing the mouse.

Fixes static analyzer warnings
fbd03604cc701651595a2ea33c5562b4 and
30fcb05194f3a2d121fc57b05e0ccf10

Pick-to: 6.1
Change-Id: I8e9d4fe4055115c366ada1cbb22a8f0839ba41da
Reviewed-by: David Skoland <david.skoland@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2021-03-03 10:00:22 +01:00
Ville Voutilainen
6e0ce4ee80 Android: make calling exit() conditional on an environment variable
Task-number: QTBUG-82617
Task-number: QTBUG-85449
Task-number: QTBUG-83043
Change-Id: I5ac67b5d57550e5a1f816e5db01f4aab31127283
Pick-to: 5.15
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2021-03-03 08:18:41 +00:00
Alex Trotsenko
f265c87e01 Allow QWindowsPipe{Reader|Writer} to work with foreign event loops, take 2
When a foreign event loop that does not enter an alertable wait state
is running (which is also the case when a native dialog window is
modal), pipe handlers would freeze temporarily due to their APC
callbacks not being invoked.

We address this problem by moving the I/O callbacks to the Windows
thread pool, and only posting completion events to the main loop
from there. That makes the actual I/O completely independent from
any main loop, while the signal delivery works also with foreign
loops (because Qt event delivery uses Windows messages, which foreign
loops typically handle correctly).

As a nice side effect, performance (and in particular scalability)
is improved.

Several other approaches have been tried:
1) Using QWinEventNotifier was about a quarter slower and scaled much
   worse. Additionally, it also required a rather egregious hack to
   handle the (pathological) case of a single thread talking to both
   ends of a QLocalSocket synchronously.
2) Queuing APCs from the thread pool to the main thread and also
   posting wake-up events to its event loop, and handling I/O on the
   main thread; this performed roughly like this solution, but scaled
   half as well, and the separate wake-up path was still deemed hacky.
3) Only posting wake-up events to the main thread from the thread pool,
   and still handling I/O on the main thread; this still performed
   comparably to 2), and the pathological case was not handled at all.
4) Using this approach for reads and that of 3) for writes was slightly
   faster with big amounts of data, but scaled slightly worse, and the
   diverging implementations were deemed not desirable.

Fixes: QTBUG-64443
Change-Id: I66443c3021d6ba98639a214c3e768be97d2cf14b
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2021-03-02 22:53:06 +02:00
Timur Pocheptsov
d316ae8e83 QSsl: fix UB pointer use
Weird macro had inverted notion of type safety: instead of casting
parameters and return values (they are pointers) to work with generic
OPENSSL_sk_xxx functions, it was ... casting a function pointer to an invalid
type to get ... nothing, but UB. Home-brewed (un)'safestack'!!!

Change-Id: Ib91a7ba4cd472f370836797e422456f91a4385b0
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 9fc2f1f076b953ff0979fb73ed6e70ac9bde278c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-03-02 18:03:54 +00:00
Timur Pocheptsov
79138e41d6 Move QSslCertificate's details and cert-related code to the plugins
Also since we have to properly support 'no-ssl' configure option
(alas, we support QSslCertificate on such builds) - introduce
a minimal crippled QTlsBackendCertOnly, which depends on
X509CertificateGeneric.

Fixes: QTBUG-90954
Task-number: QTBUG-65922
Change-Id: Ib9d62903f16b7c0eaaa23e319a822c24a7631dc6
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 41fc143635c25f937a557f09890601f6c7d38736)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-03-02 18:03:00 +00:00
Giuseppe D'Angelo
49bed939b6 Merge "Add the 6.2 deprecation macros" 2021-03-02 16:55:19 +00:00
Morten Johan Sørvig
2a5262c0dd Merge "High-DPI: Set the minimum scale factor to 1" 2021-03-02 16:00:51 +00:00
Giuseppe D'Angelo
29c2a6059f Add the 6.2 deprecation macros
... which makes me wonder, why isn't this stuff bumped automatically
when a minor version branch is created?

Change-Id: Ia43f898163a4baa0896a09bd13d65cf534fe1df5
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-03-02 15:20:11 +01:00
Volker Hilsheimer
f28088873e Merge "QLabel: simplify createStandardContextMenu" 2021-03-02 13:58:43 +00:00
Morten Johan Sørvig
ee409e6f0c High-DPI: Set the minimum scale factor to 1
Avoid painting errors with dpr < 1, also for the PassThrough
mode.

This limits the minimum high-dpi scale factor to 1,
for the code path which determines the scale factor
based on screen DPI.

Pick-to: 6.1
Task-number: QTBUG-89948
Change-Id: I14b3f130f0ae141d5f05c87437f926a9f76d1dec
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-03-02 13:36:38 +00:00
Volker Hilsheimer
e718818745 QLabel: simplify createStandardContextMenu
If control is nullptr in the beginning, then it will be nullptr later as
well, and the function won't do anything. And if the effectiveTextFormat
is Qt::PlainText, then the linkToCopy will be empty, and the function
won't do anything, either.

So we can just handle these cases right away, making the code simplier.

Fixes static analyzer warning 43de3f3125108b4353afd94e94f59926.

Pick-to: 6.1
Change-Id: I5b8eb94a1e40c2725de6a168298d8f3bcde748eb
Reviewed-by: David Skoland <david.skoland@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2021-03-02 12:45:53 +01:00
Volker Hilsheimer
49113c905d Don't access moved-from object
Clang's static analyzer tooling warns about this access-after-move [1].
While the comment above the function indicated that this was deliberate
and relying on a moved-from QString being valid, it is still bad
practice.

Since 'str' is empty in moved-from state if - and only if - it was a
non-const reference, make a compile-time check of the constness of type
T instead.

[1] https://testresults.qt.io/codechecker/daily_analyses/qtbase/dev/qtbase-dev-20210301-e14ccf0553/qstring.cpp_clang-tidy_b0545db57a2cc5dac67a56f76322ffd0.plist.html#reportHash=209ee3db0b17d21919326a1ad6635318

Pick-to: 6.1
Change-Id: Iac1813b61b6a3c2ef4053b911a4043c5382f85e4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
2021-03-02 11:45:41 +00:00
Richard Moe Gustavsen
9d80deb92f cmake: disable snippets/graphicsview if "printdialog" is not available
The graphicsview doc snippet has an explicit
QT_REQUIRE_CONFIG(printdialog) check that will fail the
build if Qt is not configured with "printdialog".
This check should be mirrored in the cmake file, so that
we skip building the snippet in the first place if the
feature is not available.

As it stood, we would build the snippet if "printsupport"
was enabled. But this is too granular, as you can configure
Qt to have general print support, but at the same time, skip
the print dialog. This caused the build to fail on iOS.

This patch will check the correct feature in the cmake file.

Change-Id: I31acc1f7c257e08374ea7b84a7fc38c66f214271
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-03-02 11:08:07 +01:00
Allan Sandfeld Jensen
b984689ec8 Handle para tags the same way for OOB checks as the other tags
Do not include the first parameter in the main tag anymore. That is
a left over from before unaligned access was added.

Pick-to: 6.1
Change-Id: I2caf027c6b9930d3e23fe5ec8bdcd45db34835a9
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2021-03-02 08:09:03 +01:00
Hou Lei
b46b33c817 Merge "Canonical type conversion" 2021-03-02 05:12:15 +00:00
Hou Lei
2b83e78f6e Canonical type conversion
Avoid C-style casts when possible.

Change-Id: I623d7bc62bd0e48a5e0493c892d6ad9b11b0ca0c
Reviewed-by: David Faure <david.faure@kdab.com>
2021-03-02 03:04:44 +00:00
Oliver Eftevaag
426b363761 Font style name 'Normal' and 'Regular' have the same meaning
Some popular fonts on linux systems follow a naming convention,
where font styles are named 'Regular', 'Italic', 'Bold' and
'Bold Italic'. Qt so far only accepts the words Italic and Oblique
interchangably, but not with Regular and Normal. This change will
make sure that Regular is interpreted the same as the Normal font
style.

Fixes: QTBUG-90396
Pick-to: 6.0 6.1 5.15
Change-Id: Ibbaf086de742c91f4d380c937ca80e846aa32a2e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-03-02 03:54:36 +01:00
David Faure
101581484b QCommandLineParser: fix crash if there's no QCoreApplication
It'll display <executable_name> instead in the help output.

Fixes: QTBUG-91430
Change-Id: Ib6211b24cdaa4683a4f62c90b5a1a20ba69f1cff
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-03-01 23:03:00 +01:00
Friedemann Kleint
b579d8a05b Merge "Brush up the imageviewer example" 2021-03-01 21:27:22 +00:00
Alexey Edelev
d1101c460e Simplify prefix-related functionality of qmake
Since the QT_CONFIGURE_HOSTBINDIR_TO_HOSTPREFIX_PATH and
QT_CONFIGURE_HOSTBINDIR_TO_EXTPREFIX_PATH definitions keep the same
value in modern CMake build, no need to have special handling in cases
where these values are used in qmake. Also it will be useful to
specify the relative path to the prefix directory from the directories
different of 'bin' when use QMakeLibraryInfo.

Task-number: QTBUG-75870
Change-Id: I5a777001eb334dcf05e22853a514d4257352d59b
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-03-01 17:36:56 +01:00
Alexey Edelev
93f55570c4 Remove unused definitions
QT_CONFIGURE_CROSSBUILD is always '0', so it's not necessary to keep
conditional compilation in QMakeLibraryInfo.

Also the QT_CONFIGURE_SYSROOTIFY_PREFIX definition is never used
in the project.

Task-number: QTBUG-75870
Change-Id: I1fe42dce40fddc6a72254736883f93aa4727f6b3
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-03-01 17:36:48 +01:00
Allan Sandfeld Jensen
90e9974f15 Handle desc tags the same way for OOB checks as the other tags
Including one entry of the value in the header is pointless after
the unaligned access rewrite, and a potentially dangerous pattern,
though safe here due to overchecking.

Pick-to: 6.1
Change-Id: I4c0380040f89920467c309503408f1df6f88423f
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2021-03-01 15:51:24 +00:00
Edward Welbourne
b4ee126a75 Simplify QDateTimeParser::fromString() to always record the date-time
Previously, *datetime was only written to if the parse was a success.
When parsing a date-time that's invalid by virtue of falling in a
spring-forward gap, the parser returns a date-time that is invalid but
has a toMSecsSinceEpoch() suitable for use in creating a sensible
interpretation of the parsed string (in offset by the width of the gap
from the specified position in the gap). It is more useful to return
this value than a default-created QDateTime.

Change-Id: I89f39e729b1f9fede1532d8b82f6f676477ddadb
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
2021-03-01 16:45:17 +01:00
Edward Welbourne
83421e320b Try again if mktime() fails when we thought we knew DST-ness
When refreshing a QDateTime(,, Qt::LocalTime) we call mktime on data
obtained from it, passing in the DST status (when known; this keeps
two otherwise identical times in a fall-back distinct). One of the
tests relies on changing zone under the feet of such a date-time,
created in Hawaiian standard time; it serializes it, the reads it back
in Western Australian Daylight-saving time and expects the results to
be equal. However, the two differ in DST-ness, which leads to mktime()
failing for the Hawaiian original, with unwelcome results.

Notice this case, failure with DST-ness claimed known, and retry
without the claim, so as to correct the DST-ness.

Change-Id: Id0278df53130f76fc587769efe946ca9af1adc26
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-03-01 16:45:07 +01:00
Edward Welbourne
4a07947375 QTimeZonePrivate::dataForLocalTime: avoid {ov,und}erflow
When computing a recent and imminent time, to bracket the time for
which we want data, take care not to cycle round to the other end of
the range of representable times.

Rephrased comments on this function, in the process, to more
accurately reflect what we're doing.

Change-Id: Iacd36186abc6b19d0ca03981aec80b2c5af077b3
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-03-01 16:45:00 +01:00
Edward Welbourne
63fbabde23 Only store offsetFromUtc when sane (and assert sanity)
The addition of a sanity-assertion revealed that, for an invalid
time-zone, refreshZonedDateTime() left epochMSecs unset but computed
offsetFromUtc from it none the less. Leave it as zero in that case, or
any other where the conversion to UTC didn't give valid date and time.

Change-Id: I0ebd955798532e91e7e211bf065667e313ee5c2d
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-03-01 16:44:51 +01:00
Edward Welbourne
5af6b59b6e Rework an assertion to eliminate a common sub-expression using a lambda
This take more lines but makes the condition clearer and the lines
shorter, even after converting to use the names for constants in the
condition.

Change-Id: I9e5b7b79ff62095ed11b8723be238444fd32d9c1
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-03-01 16:44:43 +01:00
Edward Welbourne
902505a058 Use qint64 as base-type for an enum mostly cast to that type
Various constants used in qdatetime.cpp were cast to qint64() where
used. There ware also some Q_INT64_C()s, two of which should have used
members of this enum; the third suggested a new addition to the enum.
Adding that and basing the enum on qint64 eliminates the need for
casting, although one asprintf() does now require a cast back to int.
There were also some redundant casts to qint64(), so I removed those.

Change-Id: Ia51ad8020f037badb1506ca379da19098a8655f8
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-03-01 16:44:37 +01:00
Robert Löhning
976fede67c Limit value in setFontSizeFromValue()
Avoids overflows in QFreetypeFace::computeSize and
QFontEngineBox::boundingBox

Fixes oss-fuzz issue 30290

Pick-to: 5.15 6.0 6.1
Change-Id: If8e9ff74bf706a701e26832ad21b3439a3b437f7
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-03-01 15:42:23 +00:00
Giuseppe D'Angelo
e14ccf0553 Kill qHash(QPointF)
QPointF operator== is fuzzy, hence it can't be hashed efficiently.
Prevent the erroneous addition of the overload by client code
by providing it as deleted.

Change-Id: I2cfaaf5c2c8896ec9a7929f7c7bf52a912d0450f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-02-28 20:31:31 +01:00
Qiang Li
269fdef53d Fix z-value of QGraphicsItems being ignored during draw
In QGraphicsScene's function draw, don't copy the children into a
const copy (to prevent detaching in the loops), as they might get
sorted. Instead, use a const reference.

Amends e349f787d5, which introduced
the bug by making a copy of the unsorted list.

Fixes: QTBUG-81316
Pick-to: 6.0 6.1
Change-Id: Iab9b87e75178a883806088a9db234c7a2aaa9301
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-02-28 19:05:32 +00:00
Giuseppe D'Angelo
cd13ec38a7 QBrush: get rid of an unused private function
No idea why it's there, it's unused.

Change-Id: Icf7b48e1e4ab37158a81e15ffa5a7125bfd10822
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2021-02-28 18:54:16 +01:00
Allan Sandfeld Jensen
840c8b4de2 Fix out-of-buffer in ICC curv parsing
After the unaligned ICC profile fix, we could read 2 bytes past the end
of the buffer for curv elements with 0 parameters, though we wouldn't
use or return the data.

Pick-to: 6.1 6.0 5.15
Change-Id: Ibea9fa2840c01d690716d8f48e301fbfa67aa163
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2021-02-28 17:45:05 +00:00
Fabian Kosmale
9d6ba110e8 QMetaType: Store QMetaObject for pointer to const QObject, too
Before this change, the QMetaType for T const* where T is derived from
QObject would not store the static QMetaObject of T. This commit changes
this. As a consequence, the metatype system can now convert between
const and non-const pointers to QObject. Note that this allows casting
const away; but so does C++ with const_cast.
In addition, a new flag, QMetaType::IsImmutable is introduced, and used
to tag the metatypes of pointer to const types. This allows code to
discern between pointers to mutable and const QObjects, which is
relevant for the QML engine.

Task-number: QTBUG-82354
Change-Id: I3e4e4f39f565bd99a65e161528ce5304df73d6d6
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-02-26 09:10:31 +01:00
Fabian Kosmale
50e857a9cb QJsonValueRef: add missing operator[]
Change-Id: Iae165cd7bb2a7ea02d819fa25e0618d81f9a54f4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-02-26 09:10:31 +01:00
Andreas Buhr
d1fcc5d94a Document requirements for getters and setters of bindable properties
Getters and setters of bindable properties have to be carefully
written to avoid several problems. This patch adds documentation
for this.

Task-number: QTBUG-89505
Task-number: QTBUG-90511
Change-Id: Ib25590b3d8d95c490d9555c0f258f48cb6cfe4a9
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-02-25 17:21:15 +01:00
Volker Hilsheimer
8cc72e0f63 Assert that QWidgetPrivate::create creates a window
Assert the expected side effect of createTLSysExtra, which might not
allocate a window, but must do so in this case (as we have already
returned if the QWidget is not a window).

Fixes static analyzer warning 2f3bbfe8addb586445e96f8906d6769e

Pick-to: 6.1
Change-Id: I4d5b8651b3510eff8e4a7b25889c0521ba6a4247
Reviewed-by: David Skoland <david.skoland@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-02-25 17:11:09 +01:00
Allan Sandfeld Jensen
6315257184 Reduce warnings from ICC parsing
Messages about Qt deficiencies reduced to info, and info set as the
default message level.

Pick-to: 6.1 6.0 5.15
Fixes: QTBUG-91401
Change-Id: Ia97438f08de5e0383e77631dca9b253b47ef8167
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2021-02-25 16:08:44 +01:00
Alex Trotsenko
b7e08599cc QEventDispatcherWin32: get rid of the hook procedure
Instead of intercepting the WM_QT_SENDPOSTEDEVENTS message in the hook
procedure, we can handle it at receive points, making
qt_GetMessageHook() unnecessary.

Including general performance improvements, this patch fixes the issue
where some applications (e.g. Ableton Live) do not call a chain of
nested hooks for plugins.

Pick-to: 6.1 5.15
Fixes: QTBUG-90949
Change-Id: If8e96848392c6f10d45af2aac0567707d16af673
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Nuno Santos <nunosantos@imaginando.net>
2021-02-25 17:08:44 +02:00
Allan Sandfeld Jensen
f493d41722 Fix logic problems with table based grayscale ICC profiles
White-point was calculated wrongly and some tables could cause bad
behavior in the tables.

Pick-to: 6.1 6.0 5.15
Change-Id: I24e8f5f3cc1306f5f898a4acbf7b008e26bd04e2
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2021-02-25 16:08:44 +01:00
Giuseppe D'Angelo
0e22001a3b Add more support for structured bindings
After QPoint(F), it's now the time of QSize(F) and QVectorND,
which can be unambiguously decomposed.

[ChangeLog][QtCore][QSize] QSize is now usable in a structured
binding declaration.

[ChangeLog][QtCore][QSizeF] QSizeF is now usable in a structured
binding declaration.

[ChangeLog][QtGui][QVector2D] QVector2D is now usable in a
structured binding declaration.

[ChangeLog][QtGui][QVector3D] QVector3D is now usable in a
structured binding declaration.

[ChangeLog][QtGui][QVector4D] QVector4D is now usable in a
structured binding declaration.

Change-Id: I67bb152f4210f2be27607179cd2ec522174cc483
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-02-25 16:08:44 +01:00
Volker Hilsheimer
2af45d0cee Assert that we have a socketEngine before calling it
If we are connected or bound, then we must have an engine.
Otherwise in code we frequently test for the d->socketEngine pointer,
including in waitForConnected.

Fixes static anlyzer warning 3b37ce4102843c97ceef2b7bb68a409d.

Pick-to: 6.1
Change-Id: Ib9818282ad2813db97859cbe1f184bcfb5ea4ab4
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-02-25 16:08:44 +01:00
Volker Hilsheimer
2de7f4f771 QIcon::setIsMask: don't dereference nullptr
QIcon::detach might result in the d pointer being nullptr, and other
code tests for that condition and allocates the d pointer explicitly.

Change the order of the tests in setIsMask as well, fix static analzyer
warning 0a4723ca2d216ec8883a3d412aeded4c.

Pick-to: 6.1
Change-Id: Idca12f230036362f13cbaee1ae4f0e5ce6726015
Reviewed-by: David Skoland <david.skoland@qt.io>
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2021-02-25 16:08:44 +01:00
Alexey Edelev
43c28aa904 Use Core library for qmake instead of the Bootstrap library
Move the qmake-specific logic of the QLibraryInfo class to
qmake internals. 'qconfig.cpp.in' now stores information about
the library info entries to keep them consistent between qmake
and the Core library. qmake requires specific features enabled
in the Core library, so building qmake will be skipped if the
features are not enabled.

All flags directly related to the qmake have been removed from
Core lib.

Remove all bootstrap related sections from qmake CMakeLists.txt

Task-number: QTBUG-89369
Change-Id: I26de157d3bfd4a5526699296e9d46e1c180b89ae
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2021-02-25 16:08:43 +01:00
Sona Kurazyan
5624b35d65 Improve docs for QFuture::then() with context
Be more precise about attaching a continuation with the default
(QtFuture::Launch::Sync) launch policy after a continuation with
context.

Pick-to: 6.1
Change-Id: I5b80063df2443e5742033864ba012bf34ed4cdf7
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-02-25 16:08:43 +01:00
Allan Sandfeld Jensen
c2bec047e2 And fix handling and test of QImage::fill(uint) as well
Only RGB444 and RGB666 were treated slighlty different from the rest,
but the test had a few additional mistakes.

Pick-to: 6.1 6.0 5.15
Change-Id: I4728b4036affedfffce8bca5c1e7be3869344fbe
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2021-02-25 09:46:55 +01:00
Allan Sandfeld Jensen
e3ebbca540 Improve QImage::fill(uint) documentation
Remove paragraph about long gone methods, and rephrase it
as a note on corresponding getters. At the same time
document 64-bit behavior as undefined.

Pick-to: 6.1
Change-Id: I26ffd95040eb0aea30585aa0fa8526417b0ecc7a
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2021-02-25 09:38:19 +01:00
Volker Hilsheimer
976d8b1f74 Assert that setCurrentAnimation has the assumed side effect
setCurrentAnimation(0) is expected to set the currentAnimation pointer -
which it does, as long as there are any animations.

Fixes static analyzer warning 106daf11ddfe9bb4fa7cf98c9097962c

Pick-to: 6.1
Change-Id: I3739bcfda103db391d21f135485f0b700c48ead1
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-02-25 00:38:45 +01:00
Volker Hilsheimer
e38b55c47c Consistently test for nullptr
m_view might be nullptr, which is checked before setting up the palette,
so don't set the QTextCharFormat up without checking first as well.

Fixes static analyzer warning 0ef07dd07bebe04b93d1fc802eddb57a

Pick-to: 6.1
Change-Id: Ia1c92eb4183c9e368e92875775cff90e2883ddaf
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2021-02-25 00:38:40 +01:00
Friedemann Kleint
1128e0bea1 QSystemSemaphore: Fix broken translated messages
Add Q_DECLARE_TR_FUNCTIONS() and use tr().

Pick-to: 6.1
Change-Id: I31a27afa06ee2a592a7e588283e5ff08b5d14f3b
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2021-02-24 14:00:26 +01:00
Volker Hilsheimer
3be3848338 Assert that either both or neither pointer are nullptr
Identical change to qmetatype.cpp

Fixes static analyzer warning 0267bc9b3ba521cf8bf0a7fea8981ee5

Pick-to: 6.1
Change-Id: Id6219f5025d703dd43b1742a067aa934d6aacd8c
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-02-24 13:43:41 +01:00
Friedemann Kleint
f0cc9f10da QStandardPaths: Add translation comment for macOS-specific item
Pick-to: 6.1
Change-Id: Idde81ee9badb41ff7893dcbdfd39ec4cb8db9742
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2021-02-24 13:17:33 +01:00
Kai Koehne
ea1c35d557 Disable NetworkManager plugin for -no-dbus
The plugin depends on Qt::DBus, so do not try to configure it if
Qt::DBus is not available.

Pick-to: 6.1
Fixes: QTBUG-91155
Change-Id: I70ddca63a277cd57a253092f97160f89ebc76f06
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-02-24 11:59:02 +00:00
Edward Welbourne
e8c52d0e8c Fix transitionEachZone() failures on Android
In QTimeZonePrivate::dataForLocalTime(), mistrust the Android
backend's hasDaylightTime(), as it has a comment saying it only knows
about future transitions, not past. This caller of it really needs to
query "has ever had a transition", which this doesn't answer. Many
zones that have no plans for future transitions have had transitions
in the past; these were failing the transitionEachZone() test.

In the process, refine the test itself, making sure we catch some
quirk cases that shouldn't arise and making the debug message on
failure more informative (while eliding the zone name, as this is part
of the test name anyway, so added to the output by qDebug() itself).

Fixes: QTBUG-69131
Change-Id: I88a0528182c247acb8b6327b40516178e455bcc0
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-02-24 12:08:57 +01:00
Volker Hilsheimer
88d8309290 Add null pointer check
The detailsText widget might be nullptr even if detailsButton is not.
Both are tested elsewhere in code, e.g. in the _q_buttonClicked
private slot, so be consistent.

Address static analyzer warning 00b85157447772462c3b8ffc1da0ae3a

Change-Id: Ib8c31b79653a6e8a9011692cb84ffaa2fb8047e7
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2021-02-24 11:51:47 +01:00
Volker Hilsheimer
1f6dbbd539 Assert that we have a layout before dereferencing
Since we test the pointer in the beginning, it might be nullptr.
But if we receive events that require a layout, then it must not be
nullptr. Assert that assumption.

Address static analyzer warning 06f8cc945ead26f20c6b9599faf76c83.

Pick-to: 6.1
Change-Id: I1c6eb9e9d2c9444fcb9bd1d1d9c345237dc72b33
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2021-02-24 11:51:47 +01:00
Volker Hilsheimer
52b5e9b766 Assert that either both or neither pointer are nullptr
If called by QMetaType::canConvert with two nullptr values,
the QMETATYPE_CONVERTER_ASSIGN macro will expand to code
dereferencing both 'to' and 'from' pointers.

Assert that others callers provide two valid pointers.

Fixes static analyzer warning 02dc34cc2ad1d4c3c6e55b44e08983f2

Pick-to: 6.1
Change-Id: I24de914faa25dc7cb1da5eae09a125506caac389
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-02-24 11:51:47 +01:00
Volker Hilsheimer
f6c9dec610 Assert that dereferenced pointer is never nullptr
It can't be, since then 'o' (which is never nullptr) would be different,
and we'd return in the previous line.

Since we test for d->popup a few lines above, help clang static analyzer
to not report this with hash
27ff831d79d1779825fd964239cbefe7.

Pick-to: 6.1
Change-Id: I9f0b14bd88418b897cee2d7a63e8a10fc4a0b01c
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2021-02-24 11:51:47 +01:00
Eirik Aavitsland
8daa944313 Avoid int overflow in QImage rotate90/180/270
Pick-to: 6.1 6.0 5.15 5.12
Fixes: QTBUG-91223
Change-Id: Ice53c80d695a5ffdf9162df84e7c9b1e43106bae
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2021-02-24 11:51:47 +01:00
Craig Scott
279ebfd487 qt6_finalize_executable(): Enable finalizers to be set per-target
Some plugins need to append additional processing to targets that use
them. This is most commonly needed for static builds to identify
additional plugins that need to be linked, but which cannot be
determined automatically by CMake as part of its transitive
dependency handling. Check for finalizers on directly linked targets
as a way to help automate common scenarios.

Because we need to lookup dependency targets and these may have
visibility limited to the depender target's scope, we now formally
document that finalizers should be called from the same scope as
the one in which the target was created. This was loosely expected
before, but is now made explicit.

Task-number: QTBUG-90819
Task-number: QTBUG-86669
Pick-to: 6.1
Change-Id: I065a3f3a4ab6eeff6a98a655835427949e2fe0f1
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-02-24 10:38:02 +11:00
Craig Scott
fe29159aad cmake: Don't give plugins PUBLIC usage requirements
The pro2cmake.py conversion script faithfully reproduced the .pro files
for the plugins, which specified the libraries as public. But in CMake,
the implications of this are that public usage requirements should then
be propagated to consumers. We don't expect any consumers, since a
plugin is created as a MODULE library in CMake, so for Windows we don't
even have an import library to link with. The only exception to this is
for static builds where plugins are created as STATIC libraries
instead, but only in certain controlled situations do we then link to
plugins. Even then, usage requirements are not expected to propagate to
the consumers, so these relationships should always be specified as
private.

This change warns on any PUBLIC usage requirements specified for a
plugin. This check is disabled by default to avoid spamming CI builds
for repos that haven't been fixed yet. The check can be enabled by a
CMake cache option, which is intended for developers to use locally
when fixing this issue in other repos (all plugins in qtbase should
not trigger this warning as a result of changes in this commit).

Task-number: QTBUG-90819
Pick-to: 6.1
Change-Id: I09f2c8da77db1193ad3370f85d367dfc6ab7b9a6
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-02-24 10:37:49 +11:00
Joerg Bornemann
1f30bcf336 Move build tools to libexec instead of the bin dir
[ChangeLog][Build System] Tools that are called by the build system and
are unlikely to be called by the user are now installed to the libexec
directory.

This is a step towards easier co-installability of different Qt
versions.

Pick-to: 6.1
Task-number: QTBUG-88791
Change-Id: Id19575b5ba27795f7715e4ea6a09391b26dd4942
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2021-02-23 17:02:30 +01:00
Valery Volgutov
462410a08b evdevtouch: Fix wrong addTouchPoint for "mtdev"
Origin patch 359546b069
has following rule:
"the state for processed released points is reset
to zero at the end of the SYN_REPORT handler"

Patch 4e400369c0
changed state according new event refactor, but not fully.

Task-number: QTBUG-86013
Pick-to: 5.15 6.0 6.1
Change-Id: If35b756d5c726533f11d18e7b73c98fffa17d809
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2021-02-23 14:22:20 +00:00
Andreas Buhr
dec429e077 Fix handling of virtual/native pixels in QAndroidPlatformWindow
f92e195369 made sure a new
QAndroidPlatformWindow always has a geometry. However, it did not
take into account HiDPI handling. This patch fixes it and introduces
proper HiDPI handling.

Pick-to: 5.15 6.0 6.1
Fixes: QTBUG-91161
Change-Id: Iddf31b7abfd0a1bada3b051ed4de3bf6c2897d8e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-02-23 15:15:45 +01:00
Volker Hilsheimer
4f24e1e9b1 Initialize out-variables
QSplitterPrivate::getRange might return early, and then the variables
will contain garbage.

Fixes warning from clang static analyzer.

Pick-to: 6.1
Change-Id: I0081ad9847f158da4440b945ba2db7e7f5d4780b
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2021-02-23 15:15:45 +01:00
Andy Shaw
5540c9c107 iOS: Pass the text to handleExtendedKeyEvent when known
This will ensure that the QKeyEvent also has this information passed on
as appropriate.

Pick-to: 6.1
Change-Id: I52436404115b453664b9b3414f8ec4e715dd6a28
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-02-23 09:36:40 +01:00
Friedemann Kleint
9a5a2d61c0 QtNetwork: Fix build with QT_NO_SSL
Fix:
qsslcertificate_qt.cpp.obj : error LNK2001: Unresolved symbol ""public: static struct QMetaObject const QTlsBackend::staticMetaObject" (?staticMetaObject@QTlsBackend@@2UQMetaObject@@B)".

Pick-to: 6.1
Task-number: QTBUG-90953
Change-Id: I4eb99c2ee4be67dfdf07e52219b73c6b14436344
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2021-02-22 15:17:11 +01:00
Timur Pocheptsov
9e5d7af6ef A follow-up fix for potentially missing OpenSSL symbol resolving
This patch also adds 'isValid()' to know if a backend from a plugin
is in working condition (say, there is 'openssl' plugin but no or
old openssl libraries in some system).

Task-number: QTBUG-65922
Change-Id: I0b846536a069ca8c5a94e7191f11c81bac6ad527
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 573ba145d76f239dbc7464a78aabc06ed4d00419)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-02-22 13:00:56 +00:00
Assam Boudjelthia
f265736e9f Re-order includes in qjniobject.cpp
Pick-to: 6.1
Change-Id: I80acd829bfd0940d17170f2277e92bc9620ce929
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-02-22 13:49:50 +02:00
Volker Hilsheimer
85af149c9b Initialize QStyleOptionHeaderV2 with correct version
Amends 4c6579eacd

Pick-to: 6.1
Task-number: QTBUG-91224
Change-Id: I9a41db9354bff2fa706cf6053aa229cdca16759e
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2021-02-22 10:54:40 +01:00
Volker Hilsheimer
7f1dc4bb75 Complete documentation for QStyleOptionHeaderV2
Document the isSectionDragTarget variable, and add \inmodule command.
Put code and documentation together.

Amends 4c6579eacd.

Pick-to: 6.1
Change-Id: Id8837ca75cd6af13c8dc4c028b304b279e507ade
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2021-02-22 10:44:49 +01:00
Dong Rui
c5904cb96a QLineEdit: Fix editingFinished() not being emitted when pressing the clear button
When pressing the clear button, the editingFinished() signal was not
received when focussing out.

Call  _q_textEdited(QString()) when pressing the clear button.

Pick-to: 5.15 6.0
Fixes: QTBUG-83295
Change-Id: Ie4bc6d9a2f27f89163c05c4c15175540c7631a30
Reviewed-by: Liang Qi <liang.qi@qt.io>
2021-02-22 07:18:43 +00:00
Thiago Macieira
d012e953bf QProcess/Unix: remove outdated notices about use of posix_spawn() on QNX
We haven't used the spawn functionality on QNX since Qt 5.7 (commit
005a8bfbf0) because that's when we dropped
support for QNX 6.5.0.

Change-Id: Ic90d8429a0eb4837971dfffd1664f9712bdce2d8
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2021-02-21 22:48:38 -08:00
Thiago Macieira
5d977b0fd2 QProcess::startDetached/Unix: report which function failed
Like QProcess::start().

Pick-to: 6.1
Change-Id: Ic90d8429a0eb4837971dfffd1664ef1293a6523d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2021-02-21 22:48:30 -08:00
Thiago Macieira
f0ce50d335 QProcess::startDetached/Unix: simplify handling of the pipes
Use a structure that will automatically close them for us. This doesn't
apply to startProcess() because the pipes there are long-lived (though
each of them in QProcessPrivate could be an AutoPipe...).

The destructor only runs in the parent process, so the child processes
don't need to worry about setting file descriptors to -1.

Pick-to: 6.1
Change-Id: Ic90d8429a0eb4837971dfffd1664ed98f3d74d1c
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2021-02-21 18:47:19 -08:00
Thiago Macieira
089bcb0074 QProcess::startDetached/Unix: remove unnecessary ignoring of SIGPIPE
This is unnecessary because we can only get SIGPIPE if the reading end
of the pipe is closed. And that can only happen if the parent process
has exited, meaning there's no one to read our message anyway.

Change-Id: Ic90d8429a0eb4837971dfffd1664ec6821993ada
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2021-02-21 18:47:11 -08:00
Thiago Macieira
f4e3b073b3 QProcess::startDetached/Unix: fix the resetting of SIGPIPE
This should have been SIG_DFL, as we're about to execute a child
process. It's the child's responsibility to ignore SIGPIPE if it wants
to, or get killed by it when it writes to an pipe with no readers.

Qt itself does this for its own purposes (see qt_ignore_sigpipe() [until
I can get some time to teach Linux about O_NOSIGPIPE]). Therefore, we
ought to reset what we've done.

Change-Id: Ic90d8429a0eb4837971dfffd166585a686790dde
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2021-02-22 02:47:07 +00:00
Thiago Macieira
73a04edce1 QProcess::startDetached: set the error condition on failure to start
And set *pid to -1.

[ChangeLog][QtCore][QProcess] If a startDetached() fails to start the
target application, the QProcess object should now have a proper error
string in errorString().

Pick-to: 6.1
Change-Id: Ic90d8429a0eb4837971dfffd1664e825ffcb923e
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2021-02-21 18:46:28 -08:00
Friedemann Kleint
86ebdc07df QAbstractFileIconProvider: Use platform theme icons
Add code paths to use platform theme icons should icon themes fail.

Task-number: QTBUG-66177
Change-Id: I9554637f5230b1f57faaeef6b2c04cf082271edb
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-02-21 09:22:32 +00:00
He MingYang
c0112c2346 Initialize some uninitialized member variables
Change-Id: Ia8e06850a2288f40906602adfbe40abb0faf8057
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-02-20 23:02:26 +00:00
Assam Boudjelthia
255459250d Add QAndroidApplication as a nativeInterface
QAndroidApplication provides the Android specific app context() and
isActivityContext() to determine whether the context is an Activity or
otherwise a Service.

Task-number: QTBUG-90499
Change-Id: Iae2eef7ec44859a89825b09f52f09506b20b5420
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-02-20 22:53:05 +02:00
Volker Hilsheimer
4c6579eacd Unbreak binary compatibility in QStyleOptionHeader
4d94384612 introduced a new data member to
QStyleOptionHeader, and reduced the size of the orientation member.
This changed the binary layout of class instances, and breaks ABI.

180c662b07 added another member within
the new bitfield.

Introduce a new QStyleOptionHeaderV2 class instead with the new members,
and use that in QHeaderView, and the styles using the new members.

Fixes: QTBUG-91224
Pick-to: 6.1
Change-Id: I47e6841e6652e4b67f247b7b4514e90be5609156
Reviewed-by: David Faure <david.faure@kdab.com>
2021-02-19 22:21:30 +01:00
Morten Johan Sørvig
bb110cee5d Add scaledPixmap() override
QAbstractFileIconEngine implements the QIconEngine interface
and creates a new interface where subclasses override the
filePixmap() function.

QIconEngine subclasses must now also override scaledPixmap();
add implementation which forwards to filePixmap().

(The intermediate implementation in QPixmapIconEngine is not
used by QAbstractFileIconEngine.)

Pick-to: 6.1
Task-number: QTBUG-91104
Change-Id: I229e3a003ad0c3fff768eac7e75c59fe7145fcaa
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-02-19 15:23:33 +01:00
Volker Hilsheimer
24b07b2b2d macOS: don't let windows that are transparent for input become key window
Such windows are typically used as mostly transparent overlays on top
of other windows underneath. Letting such an overlay become the key
window breaks cursor updates and focus handling.

Pick-to: 6.0 6.1 5.15
Fixes: QTBUG-83632
Change-Id: I192d419a5bdb8dfa0e9223e9fbbd7876c62fe743
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-02-19 15:05:37 +01:00
Nico Vertriest
3fa50b7b41 Doc: Fix warnings about wrong snippet path or missing .pro file
Task-number: QTBUG-91147
Change-Id: I6a55b2b713dd70cf1cbb0b93a8d4152e175e2c4d
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2021-02-19 14:04:21 +01:00
Timur Pocheptsov
43d933bf50 Port QSslKey to the new plugin-based implementation
The idea is to have QSslKey(Private) backend-neutral and hide
all library-specific code inside plugins.

Fixes: QTBUG-90953
Task-number: QTBUG-65922
Change-Id: I2eeee3b2b72c78c2e24f2fb914abce3caa913be8
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 0352cf8e1bf57615b9faf3f6f383896444e762ac)
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2021-02-19 11:57:05 +01:00
Timur Pocheptsov
9385e54071 qssl.h - address comments from API review
Enumerators initially were to be flags, but this changed later, no
initialisers needed now.

Change-Id: I72b24f979e207e21d6f42a11cf0ae8887df473d3
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit b6778832636fc8f6911eb30bc9767ea6caaf6642)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-02-19 10:42:22 +00:00
Alex Blasche
0f4b2ccea4 Remove assignment to variable which is never read
Highlighted by static code analysis.

Pick-to: 6.1
Change-Id: I0e0d33c66c3aac5135204212bea2d5d48bad3739
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-02-19 09:51:18 +01:00
Lars Schmertmann
3466fc5b76 [Android]: Fix exception when using Qt to create a service on Android
Fixes: QTBUG-91194
Pick-to: 5.15 6.0 6.1
Change-Id: Idd243c17bf82150fe2ea8b0100f8c432d75ef249
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2021-02-19 09:46:12 +01:00
Morten Johan Sørvig
33ddacdd24 QMdiSubWindow: Set correct ControlLabel size
The label pixmap may be a high-dpi pixmap. Set the ControlLabel
fixed size to be the pixmap device independent size.

Fixes: QTBUG-87871
Pick-to: 5.15
Pick-to: 6.0
Pick-to: 6.1
Change-Id: Ib836e322d25599cb5e79011ea597e32ee1f8d093
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2021-02-19 09:38:13 +01:00
Thiago Macieira
31bb141aed QProcess::startDetached/Unix: move up the chdir() and remove qWarning
That qWarning cannot be in the child process (we don't know if a user
logger is fork-no-exec-safe) and the failure to chdir() should be
reported as a failure in QProcess::startDetached() instead.

Change-Id: Ic90d8429a0eb4837971dfffd1664e7577c81610b
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Reviewed-by: David Llewellyn-Jones <david.llewellyn-jones@jolla.com>
2021-02-18 12:34:17 -08:00
Thiago Macieira
e274d56eff QProcess/Unix: remove unnecessary chdir("/") before _exit()
That only created an opportunity for qWarning(), which should never be
in the child process in the first place.

Change-Id: Ic90d8429a0eb4837971dfffd1664e57a2291ea78
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Reviewed-by: David Llewellyn-Jones <david.llewellyn-jones@jolla.com>
2021-02-18 12:34:17 -08:00
Thiago Macieira
7507d87285 QNetworkInterface/Linux: make the IFLA_OPER_STATE set IsRunning
We were setting IsUp for both the ifinfomsg::ifi_flags field and
IFLA_OPER_STATE message. Turns out the second matches the "RUNNING"
state that ifconfig used to return (IFF_RUNNING from SIOCIFFLAGS).

Example:
$ ip link show vboxnet0
4: vboxnet0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN mode DEFAULT group default qlen 1000
    link/ether 0a:00:27:00:00:00 brd ff:ff:ff:ff:ff:ff
$ ifconfig vboxnet0
vboxnet0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether 0a:00:27:00:00:00  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

In this example, ifconfig is not showing "RUNNING", so its "UP" matches
iproute2's in the <> section (that's the interface's ifi_flags). In an
interface that ifconfig shows RUNNING, iproute2 will show "state UP",
which is the IFLA_OPER_STATE.

Exception: looks like the loopback has IF_OPER_UNKNOWN.

Change-Id: Ic90d8429a0eb4837971dfffd1664bfc3f4b4e030
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-02-18 12:34:17 -08:00
Timur Pocheptsov
64a878e36b Introduce QSsl::X509Certificate interface and its implementations
To enable QSslCertificate to use TLS plugins. All backend-specific
code is to be moved from QSslCertificate(Private) making them
backend-neutral.

Task-number: QTBUG-90954
Task-number: QTBUG-65922
Change-Id: Ic9d5abf91e42ce81fe56239f95ae97b64035e950
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 405337ee7276be4b76e86745c0694c51283b6b07)
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-02-18 17:13:30 +00:00
Mårten Nordheim
0d4fb41e8c QNetworkInformation: Address API review feedback
Added missing NOTIFY for Q_PROPERTY.
Switched one Q_ENUM to Q_FLAG.
Declared missing operators for QFlag.

Pick-to: 6.1
Change-Id: I8e6756838e44e205844a34c95f436df6b51a862f
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-02-18 13:28:14 +01:00
Mårten Nordheim
c98e92b8ca QNetworkInformation: Revise locking during creation
Potential issue caught by the Mårten static analyzer.
In case another thread somehow ended up creating and returning
an instance while another was waiting to relock it would deallocate
the previous instance, which could lead to some bad situations.

Pick-to: 6.1
Change-Id: I6e1843f8a483b2c3e0540e998c383e41f59c8655
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2021-02-18 12:27:50 +00:00
Lars Schmertmann
15572f9efe Android: replace stacktrace with debug message in search for setService
Don't print stacktrace when setService is not found but only print a
debug message, QtServiceDelegate will continue to look for setContext
which might actually be a problem if not implemented.

950e628fd8
did this change for QtActivityDelegate.

Fixes: QTBUG-86733
Pick-to: 5.15 6.0 6.1
Change-Id: I8f2c6494da9133a3e9dedaabbe5fc931732d0d72
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2021-02-18 13:08:47 +01:00
Edward Welbourne
36ea42effc Remove redundant code in androiddeployqt/main.cpp
Prompted by a PVS-studio article.

Pick-to: 6.1 6.0
Change-Id: I9699cc9baf9c90a6cf5b9564cd175205a9b2fa6b
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2021-02-18 13:05:50 +01:00
Nico Vertriest
9c6df426b7 Doc: Fix qdoc warnings in qtbase
Task-number: QTBUG-90662
Change-Id: I894ed70ca8514cfb0afc7e547c7fe3efadcaad50
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-02-18 11:43:31 +00:00
Ulf Hermann
a2e23bca0f QJsonObject: Fix operator<=()
We had a copy-paste error there.

Pick-to: 6.0 6.1
Change-Id: Ib1448197ac4f4641c6559f133f41dcf326f210f1
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-02-18 11:22:51 +00:00
Volker Hilsheimer
c0b6725674 Make constructing QFont from families explicit
Disallow implicit conversion from QStringList to QFont.
Address API review comment.

Pick-to: 6.1
Change-Id: I73eb3a49182865e050965e97d459463e73bcddfd
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2021-02-18 12:15:43 +01:00
Volker Hilsheimer
6c883f0341 Use same version in deprecation macros
Address API review comment.

Pick-to: 6.1
Change-Id: Ifd9f9dafc958ab8304f36e2ae6ab2fb5a01a29d8
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2021-02-18 12:15:37 +01:00
Joerg Bornemann
edd1225489 qmake: Introduce QT_HOST_LIBEXECS property
This will be used to access host tools that are installed in
${prefix}/libexec instead of ${prefix}/bin.

Pick-to: 6.1
Change-Id: I36c4b5736330f8229d267a117c65d55cd5e12758
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2021-02-18 11:46:42 +01:00
Nick Shaforostov
0ad434c2e9 fix windows build when both whatsthis and tooltip are disabled
msvc produces warning there and it is treated as error

Pick-to: 6.0 5.15
Change-Id: Ic386df615df591fa1563b147342d670bbec771d2
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2021-02-18 11:42:31 +01:00
Mårten Nordheim
9d19a8ca2f Mark QSocketNotifier::activated(int) QT_MOC_COMPAT
Fixes: QTBUG-83888
Pick-to: 6.1
Change-Id: I0833812376a5bf1a024a4b036c09b23760437862
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-02-18 10:32:12 +00:00
Edward Welbourne
563dc357fb Fix misguided conditional, simplify code
Prompted by a PVS-studio article.
The count <= 0 check made a later !count check redundant.

Change-Id: I6c00ad6137b14db13c9c31c61833b4546f663072
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-02-18 11:22:29 +01:00
Edward Welbourne
a54177cb94 Remove redundant invalid socket check
It happens after the same socket check has lead to an early return.
Prompted by a PVS-studio article.

Change-Id: I63b42abed9102df73d29e6ff8a89a475751d4b91
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-02-18 11:21:49 +01:00
Edward Welbourne
94b9ee03b5 Correct qt_mktime()'s check for last second in 1969
It was comparing time->second() to MSECS_PER_DAY - 1, but
time->second() is the second within its minute, so is at most 59.
It should be comparing seconds into the day to SECS_PER_DAY - 1.
Prompted by a PVS-studio article.

Pick-to: 6.1 6.0 5.15
Change-Id: I1802c49fa18818f4b4fe74f187da5f799df7d1de
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-02-18 11:21:37 +01:00
Edward Welbourne
755c678f0f Provide calendar backends with a unique ID
Registration by ID allows for detection of duplicate instantiation of
built-in back-ends, which can be detected and flagged by setting the
ID to ~size_t(0) instead of the enum value for which it sought to be
registered. A new method, calendarId(), is provided to access this;
while the old calendarSystem() becomes non-virtual, as it can be
inferred (when registration was successful) from the ID.

Make registration by name or alias conditional on successful
registration by ID. Previously, failed registration by name precluded
registration by ID, which now becomes the authoritative registration.
This incidentally makes it possible to add a QCalendar constructor
taking the unique ID of a backend, for use in conjunction with custom
calendar implementations.

Change-Id: Ib22925a8ac3ef9439a09ec3855f6231cf9b91c21
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-02-18 11:21:19 +01:00
Edward Welbourne
76c2e9ea23 Fix a typo, simplify an increment, add an assertion
Trivial details picked up during the course of investigating a
time-zone issue.

Change-Id: I4d6e7ab1787a2500bd950e7f12ed8618a31f1f8e
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
2021-02-18 11:20:54 +01:00
Edward Welbourne
1b34d68623 Drop some over-rides that duplicated the base-class's implementation
QAndroidTimeZonePrivate overrode the transition-related methods of its
base, but there was no point in doing so, since our Android backend
has no access to transition data, just the same as the base
implementation.

Change-Id: Ie4ff375381b463078b412f50e8ddc925ab1587a3
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-02-18 11:20:29 +01:00
Friedemann Kleint
868242b6e1 Fix some qdoc-warnings for 6.1
Fix:
qtbase/src/testlib/qtestelementattribute.cpp:89: (qdoc) warning: Undocumented enum item 'LET_Message' in QTest::LogElementType
qtbase/src/testlib/qtestelementattribute.cpp:89: (qdoc) warning: No such enum item 'LET_Error' in QTest::LogElementType
qtbase/src/testlib/qtestelementattribute.cpp:89: (qdoc) warning: Undocumented enum item 'LET_SystemOutput' in QTest::LogElementType
qtbase/src/network/ssl/qsslsocket.cpp:1666: (qdoc) warning: Unknown command '\cl'
qtbase/src/corelib/kernel/qproperty.cpp:883: (qdoc) warning: Unknown command '\T'
qtbase/src/corelib/kernel/qproperty.cpp:799: (qdoc) warning: Undocumented return value (hint: use 'return' or 'returns' in the text
qtbase/src/corelib/kernel/qjnienvironment.cpp:250: (qdoc) warning: Undocumented return value (hint: use 'return' or 'returns' in the text

Pick-to: 6.1
Change-Id: I116f5d8ace2c29ba7b6b93256d5761591e01296a
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Nico Vertriest <nico.vertriest@qt.io>
2021-02-18 11:12:04 +01:00
Fabian Kosmale
fe6338bded QMetaType:🆔 add fastpath
This inlines the fastpath of QMetaType::id and splits the slowpath into
its own function. With that change, we can also use id in operator==,
simplifying the code there.

Change-Id: I286fe173b43a495dbda8faa151a93895b4fd22e4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-02-18 11:06:29 +01:00
Friedemann Kleint
51e50bd1e6 Bump the version of QDataStream
Amends f731802ba8.

Change-Id: I1ba758ef4c9d80fbc11ecc78e0480f57c95007e2
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
2021-02-18 08:03:19 +01:00
Nico Vertriest
27f2ef24cd Doc: Fix documentation warnings qtbase
Task-number: QTBUG-90662
Change-Id: If31847f8f2b8b57a8a8624d0406a030b5752f1c8
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2021-02-18 07:03:19 +00:00
Kimmo Ollila
cf08673836 Build fix for GHS Compiler 2020.1.4
Fixes error: explicit specialization of class "QTypeInfo<QRingChunk>"
must precede its first use

Change-Id: Ib60f8fc1feb97953f5b0eeed63734e81f067d9b3
Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io>
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2021-02-16 08:20:42 +02:00
Fabian Kosmale
5481601deb Mark QPropertyAlias as internal
That class was only really meant for the QML compiler, and it is dubious
if event that one needs it. The current implementation is also broken.

Pick-to: 6.1 6.0
Change-Id: Ie40d282707f3fabc8079bee9e98f082aeb9d30b3
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-02-15 21:37:41 +01:00
Fabian Kosmale
99db1d54ed QPropertyBindingPrivate: Support QQmlProperyBinding
QQmlProperyBinding needs the ability to suspend binding evaluation, and
needs access to the propertyDataPtr.

Change-Id: If82079ffdf28fb277c6e5083714c28478f6e1729
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
2021-02-15 20:39:09 +01:00
Fabian Kosmale
4d579851c8 QPropertyBindingPrivate: Add further support code for QML
This adds a public function to check whether the QPropertyBindingPrivate
is a normal binding, or a QQmlPropertyBinding. In addition, this check
is used so that the source location function doesn't return garbage, but
instead indicates that the binding was set up from QML.
A function to retrieve the binding location from C++ can be added to
declarative at a later point.

Change-Id: Ica0f70780735fe9c60d01c2b21057d59714079e0
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
2021-02-15 20:38:58 +01:00
Liang Qi
f61b140482 xcb: unset old states and set new ones for window
This partly reverts a02959bb5b.

Pick-to: 6.1 6.0 5.15 5.12
Fixes: QTBUG-87078
Change-Id: I69e18ad3c0a8d142b2e1f5ab87990addc97d9df1
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-02-15 17:09:44 +01:00
Alexey Edelev
01e32d5c4a Remove the corelib_add_mimetypes_resources call for the Core library
Looks like the corelib_add_mimetypes_resources call is redundant and
deprecated. It duplicates the mime-type database in the Core library.

This also fixes the static build of the qmimedatabase tests, since
avoids propagation of the resource symbols by the Core library.

Fixes: QTBUG-89952
Pick-to: 6.0
Pick-to: 6.1
Change-Id: I5c0dbd761b7726589fdf6970cd546af89d2ff837
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-02-15 15:07:33 +00:00
Andreas Buhr
6bdffefaa8 Fix QTimer::setInterval to remove existing bindings
A recent change ( a7ca8b1a28 )
led to failure of binding removal in setInterval().
This was fixed by introducing setterScope.
This patch add unit tests for this regression.

Change-Id: Ic8da1f2d82ad6c8ccd81c9b1eff72d42cf75f28a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-02-15 13:47:31 +01:00
Edward Welbourne
18bf641777 Use newlines more consistently in generate compile-test code
The generated code contained many repeated blank lines.
Most main()s were preceded by one, but not all.
Only include blank lines for actual empty entries in lists, where
configure.json specified them, plus one before main if anything else
precedes it.

Change-Id: I6e6c34940e08712a1aa848a3c9ad1b0fb5806d77
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-02-15 13:45:14 +01:00
Edward Welbourne
c462793d67 Drop parsing of antique TextDate format
Apparently we used to have (back in 2007, only on Windows,
incompatibly with what we were then using on Unix) a TextDate format
(only for QDateTime, QDate used what it still uses) that put the
day-of-month number, with a dot after it, before the month's short
name. We have retained parsing of this format, on all platforms, ever
since.

It no longer matches the format we now use (since 5.2, in 2013, commit
61b56a89a1, which harmonised the format
with Unix and QDate); now seems like a good time to stop complicating
our parser for its sake.

[ChangeLog][QtCore][QDateTime] The parsing of Qt::TextDate in
QDateTime::fromString() no longer supports the old TextDate format
used (only) on Windows by Qt < 5.2 ("ddd d. MMM yyyy" with an
"HH:mm:ss" time either appended or inserted before "yyyy").

Change-Id: I73a798ab78f187543e415119cc4a11f1cfd73820
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-02-15 13:44:48 +01:00
Edward Welbourne
517578e071 QDateTime::toString(): use UTC-offset as time-zone suffix
Since fromString() can't parse the (ambiguous at the best of times;
also backend-dependent and thus potentially system-locale-dependent)
abbreviations currently produced (since 5.9) and can parse UTC-based
offsets, the OffsetName of the zone is a more robust format for the
zone-suffix. This also makes it possible to consistently use the C
locale, compatibly with everything else about post-6.0 date-time
serialization.

[ChangeLog][QtCore][QDateTime] When spec is Qt::TimeZone, the
offset-suffix now used for the toString(Qt::TextDate) format is now a
UTC-based offset string, compatible with the parsing (now) supported
by fromString(). The zone-abbreviation suffix in use since 5.9 was not
parseable.

Change-Id: I4024ae87980c6d3590c68a67b8d1c8f433e36855
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-02-15 13:44:21 +01:00
Edward Welbourne
3cf84287e7 Prepare TextDate to use UTC-offset rather than GMT-offset zone suffixes
There are GMT-offset zones whose convention for the sign of the offset
is the reverse of what we are (still) using, which is the usual
convention for UTC-offset zone: for example, the Olson Database's
Etc/GMT+3 has offset -3 hours in the UTC-based system we use, so we
give it suffix GMT-0300. The UTC-based suffix is also what we use as
the abbreviation for OffsetFromUTC() in toString().

For now this only adds support for parsing a planned future form: the
old form using GMT is retained, to give client code some chance to
prepare for a backwards-compatible transition. Although the GMT prefix
is matched case-insensitively, only match UTC if fully upper-case;
there is no meaningful precedent for case-insensitive usage here.

[ChangeLog][QtCore][QDateTime] The Qt::TextDate format now recognizes
UTC-based offset suffixes in addition to suffixes based on the
deprecated alias GMT. This prepares for toString() to use such
UTC-based suffixes for time-zones (fromString() cannot parse the
present abbreviation suffix). A future release of Qt shall use
UTC-based suffixes in place of the present GMT-based suffixes (which
conflict with GMT-based IANA zone names) for Qt::LocalTime and
Qt::OffsetFromUTC time-specs. Client code is encouraged to use and
recognize UTC-based zone suffixes in preparation for that transition,
unless compatibility with versions before 6.2 is required.

Change-Id: I5a42a488f1232a30f4b427b7954759283423b9b3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-02-15 13:44:06 +01:00
Edward Welbourne
73fbf8bd30 Simplify test-snippets in configure.cmake
The main(void) signature obviates the need for unused parameters and
has existed since (at least) C89; so use that instead of the
old-fashioned argc/argv arguments we don't use in any of these tests.

Change-Id: Ibfe850a1fce378673c9781011475ea623fd75ad4
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-02-15 13:43:52 +01:00
Edward Welbourne
5645ef305a Add some special case markers that seem to have been neglected
At least, running util/cmake/configurejson2cmake.py changes these lines.
Adding them has provoked the script to add a .prev_configure.cmake file.

Change-Id: Idc123d1dee2ce51cd640c090c7910ecc1f0fc5a4
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-02-15 13:43:42 +01:00
Edward Welbourne
42101f3871 Update two .prev_configure.cmake files that seem to be out of date
Running the script updated them, without updating the configure.cmake
files they relate to.

Change-Id: I050d2131fa575811ae9ff4b51ef786a073c554c9
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-02-15 13:43:30 +01:00
Friedemann Kleint
5de72ac915 QRectF/Documentation: Fix malformed table
The colspan should be 2. Manifests as error in the Qt for Python documentation.

Pick-to: 6.0 5.15
Change-Id: Idec8a2b62a3495e00b7f2b31e8ed9d04b551f22e
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
2021-02-15 12:30:43 +00:00
Mårten Nordheim
10aa4b5c61 MinGW: fix warning in QMatrix4x4::map functions
The definitions get the following warning (treated as error):

redeclared without dllimport attribute after being referenced with dll
linkage [-Werror]

I take it to mean that because they are labelled 'inline' the compiler
disregards the 'dllimport', but that makes it inconsistent with the
declaration. So we label the declaration inline as well.

Pick-to: 6.1 6.0 5.15
Change-Id: I87bb42141a1086b2c565db881077f33acb4aab64
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2021-02-15 12:11:53 +00:00
Nico Vertriest
7846e2f40d Doc: Fix warning on undocumented enum value
Change-Id: Ia917b86a24bdb621b1040f1e1a9fe4946a1e57ae
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2021-02-15 09:47:57 +00:00
Mårten Nordheim
6d4da1340f Schannel: Fix incomplete downloads with read buffer restricted
When the read buffer has a max size we do our best not to exceed it.
Usually there's no problem and we just read more when the next
tcp frame arrives. However if there's data leftover after the last
tcp frame arrived then we won't receive any more data. To counter
this QSslSocket would try to invoke QSslSocketPrivate::transmit
indirectly if there were any bytes available on the plain socket.
The problem is that with Schannel the last few remaining bytes
would not be in the plain socket, but in the 'intermediateBuffer'.
So let's make QSslSocket aware of that.

Fixes: QTBUG-90625
Pick-to: 5.15 6.0 6.1
Change-Id: If56e4cce558f99c9a08a1f6818e005a887712ef2
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Norbert Pfeiler <norbert.pfeiler+git@gmail.com>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2021-02-15 10:45:44 +01:00
Juha Vuolle
08ace69f0e Fix minor documentation typos in bindable properties
Change-Id: I4f8474820db613a675950a858438337558f1c88f
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2021-02-15 10:49:16 +02:00
Kai Köhne
df255a4a04 Fix attribution for tinycbor
Amends cbdf2ba46a

Pick-to: 6.1
Change-Id: Ie1a89ec9367ecc2d674b5f8b27ab3d9bc5a16eca
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2021-02-15 08:11:33 +01:00
Thiago Macieira
91f6460aff Implement futexes for Windows
Windows 8 added this pair of functions that can be used to implement the
same functionality as we have on Linux. For ease of understanding, I'm
calling them "futex" on Windows too.

From Qt 6 our minimum platform is Windows 10 so we can use this
unconditionally.

Change-Id: Ifea6e497f11a461db432ffff1448c6806ecfc36c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-02-13 17:53:12 +01:00
Allan Sandfeld Jensen
b2631c72c0 Extend colorspace testing and fix bug it uncovered
When changing transferfunction the look-up-tables needs to be
regenerated.

Pick-to: 6.1 6.0 5.15
Change-Id: I83ca5fe570f85d478a374f52c0a82db84e70c3b8
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2021-02-13 09:16:38 +01:00
Samuli Piippo
0ce443691f Move QEMU emulation detector to QTest
The emulation detection has been usable only on qtbase tests, move it to
QTest so that it can be used in other modules as well.

Pick-to: 6.1
Change-Id: I4b2321b7856414d7b1cfd5e6b1405a633c6bb878
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-02-13 10:02:51 +02:00
Shawn Rutledge
bfa78aedc0 Fix Wacom Art Pen detection on xcb
Fixes: QTBUG-91102
Change-Id: I6cd7af26153457609c1fa8fb0a9e167939d592fc
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-02-12 18:25:51 +01:00
Allan Sandfeld Jensen
95712c5e54 Fix QImage::fill with semi-transparent QColor
A few formats were not treating the input QColor correctly. Fixed and
added more exhaustive test.

Pick-to: 6.1 6.0 5.15
Change-Id: I872aeeb45e518f9a34b4ac35642264821f9927f2
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2021-02-12 17:40:44 +01:00
Christian Ehrlicher
77e1cc4b39 QHeaderView: pass sectionSize to createSectionItems()
.. instead complete size for the affected range. The complete size was
calculated before for every call of createSectionItems() and then the
function calculated the size per section back for no reason.
Passing the sum of all sections is therefore not needed and may lead to
an integer overflow for big datasets.

Task-number: QTBUG-88728
Change-Id: I8af0b0c3e97021ff0637fe1ee3ca3adfa23a2d0e
Reviewed-by: David Faure <david.faure@kdab.com>
2021-02-12 17:39:37 +01:00
Edward Welbourne
1fc3c6f9b9 Update QDateTime::timeZoneAbbreviation docs
Include Qt::TimeZone as a possible spec, use a \list for the spec
values.  Incidentally use the public QTimeZone::abbreviation() instead
of digging around in its privates to achieve the same effect.

Change-Id: Ibabbeac9b085b4d09de46bda911356c20faadae8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-02-12 11:59:12 +01:00
Edward Welbourne
02ae1b5221 Fix tst_QDateTime::systemTimeZoneChange() for 32-bit systems
The test verified that a LocalTime's time since Epoch changes when the
system time-zone changes. This works when the QDateTime object is in
short form and recomputes its offset from UTC every time it is needed,
but fails with a pimpled QDateTime, as this caches its offset from UTC
when it is created, saving the recomputation which - in the far more
usual case where the system time-zone does not change in the lifetime
of a QDateTime object - would normally produce the same result.

Changed the test to use a newly-created QDateTime constructed with the
same parameters, which doesn't have the cached out-of-date knowledge
of its zone offset. Removed the XFAIL. Made the test data-driven and
added test-cases: one so close to the Epoch that it should be short
even on 32-bit systems, one so far that it's pimpled even on 64-bit
systems (used in reproducing the issue in order to debug it).

This then revealed that Android 5 doesn't seem to support the POSIX
zone IDs used by this test, so it now verifies that LocalTime has the
expected offset from UTC after zone changes, QSKIP()ping if not.

Documented that the behavior of LocalTime is undefined after a change
to the system time-zone. Cleaned up the existing doc of Qt::TimeSpec
in the process.

Fixes: QTBUG-89889
Pick-to: 6.1 6.0 5.15
Change-Id: I1058f47a1ff3ee1c326f3579ac80bd8bab242e28
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-02-12 11:58:49 +01:00
Nico Vertriest
3183673303 Revert "Remove the qmake project files" for snippets
This reverts a limited part of commit ad2da2d27a
that deleted .pro files for snippets compilation.
Some .pro files which contain snippets used in the documentation
itself should be restored.

Task-number: QTBUG-90483
Change-Id: I1b03833c8ff17b5fca43a5b6c5417e8545b1711b
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2021-02-12 09:43:50 +01:00
Mårten Nordheim
5bd16f132d Fix compilation with system double-conversion
A recent patch made it so we don't need to keep patching the includes
of the sources. However it changed how we use double-conversion ourselves
which meant that system installs would no longer work. Keeping an extra
directory and adding another INCLUDE_DIRECTORY fixes both of our problems.

Amends dca74b45a3

Fixes: QTBUG-90961
Change-Id: If17aa1670535867343374eec846055441592f36b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-02-12 09:41:45 +01:00
Assam Boudjelthia
886a2d4511 Add build.gradle to easily modifying Java project with Android Studio
Pick-to: 6.0 6.1
Change-Id: Ie030ff0a3569caa0eacfa331d21f59e5455c90ed
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2021-02-12 08:12:19 +00:00
Assam Boudjelthia
448ea34637 Fix docs misuse of escape character \
Use {} instead of \, this fix a badly generated block of text.

Task-number: QTBUG-89632
Pick-to: 6.1
Change-Id: Ia4aad4c06285eb016a092f4340669fcbef1a6780
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2021-02-12 09:39:12 +02:00
JiDe Zhang
32a2c8b4e4 remove friend class of QClassFactory for QCoreApplication
from this commit: 38be0d1383

Change-Id: I3c1cbdf793f321febfda0c3b5a931eb1190e9195
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-02-11 23:19:41 +00:00
Giuseppe D'Angelo
654a216499 QMatrix4x4: deprecate operator*(QVector3D, QMatrix4x4)
The operation is sketchy for a number of reasons:

1) Mathematically, it doesn't make sense. The code interprets the
QVector3D as a point, extending it with w=1, and uses it as a
row vector. But similarly, the vector could be intepreted as a
directional vector, with w=0. No semantic is "better" than the
other.

2) QMatrix4x4 is not meant to be post-multiplied. Granted,
one could use a QMatrix4x4 as arbitrary storage for 16 floats,
but QMatrix4x4 builds itself to be always *pre* multiplied
(e.g. translate changes the 4th column, not the 4th row). We
can keep post multiplication for the general case if we do it
against a QVector4D, but I don't feel that we should support it
also for QVector3D.

[ChangeLog][QtGui][QMatrix4x4] The multiplication operator
(operator*) between a QVector3D and a QMatrix4x4 has been deprecated.
User code needs to extend the QVector3D to a QVector4D first
(by specifying the intended w coordinate), and then multiply
the QVector4D by the matrix.

Pick-to: 6.1
Change-Id: I41b64d8ab7eb6126dc4c49fe29cf3f1b7afc7987
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-02-11 21:16:22 +01:00
Mårten Nordheim
92b15beb9a QNetworkInformation fixups
Addressing feedback that came after the reviews
ended from both bot and people.

Added CLASS_NAME to the CMakeLists files for the plugins so that
cmake can generate the correct import.

Fixes: QTBUG-91061
Change-Id: Ib3f1e863100c1c421a6c0a4081b1d40696d67b23
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-02-11 18:13:01 +01:00
Mårten Nordheim
153ffff7d5 Fix mingw compiler warnings
Mark overridden functions with override.
Remove unused static function.

Change-Id: I06bd52c66ac7b970dfced0e553eac9c4a4d44d79
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2021-02-11 16:59:35 +01:00
Mårten Nordheim
6e89ed5a3c Add a shortcut in QDateTimeParser::findTimeZone for UTC
In a small example program using HTTPS (on Windows with Schannel) >40%
of the time was spent initializing the backend, attempting to find the
time zone used in various certificates.

By adding an early check to see if the requested time zone is UTC (or an
alias ('Z')) we can skip most of the lookup that was required.

In the example program this cut away ~200ms of a total of ~550ms.

Change-Id: I4d29568653e02b64feebbf329469899eb7be1494
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-02-11 15:38:17 +01:00
Mårten Nordheim
6ec3321875 QTimeZone: Avoid creating quite as many QByteArrays
Cuts off 1 second from the timezone test locally

Change-Id: I184728e97bcd65ca0362df4c26a3407576e12dfb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-02-11 15:38:15 +01:00
Giuseppe D'Angelo
6862ce3d77 QMatrix4x4: deprecate operator*(QMatrix4x4, QVector3D/QPoint(F))
The operation does not make sense at the "fundamental" level
for these classes (algebraic, in this case), so it shouldn't exist.

It's also a semantic trap:
* it interprets a _vector_ as a _point_ instead (the vector gets
  1-extended in 4D)
* after the multiplication, it gets perspective divided.

These semantics do not belong to operator*.

operator*(QVector3D/QPoint(F), QMatrix) will be tackled in a next commit;
we don't have a straightforward replacement for it.

Drive-by, document that map() interprets vectors as points.

[ChangeLog][QtGui][QMatrix4x4] operator* between a QMatrix4x4 and a
QVector3D, QPoint, or QPointF has been deprecated in favor of map()
and mapVector().

Pick-to: 6.1
Task-number: QTBUG-89708
Change-Id: Iad78d6eb68cc8cdc3ac16b1635c4d3b522c95213
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-02-11 15:07:12 +01:00
Assam Boudjelthia
c7bcc51e2c Refactor duplicate code for clearing JNI exceptions before returning
Add a private function to handle checking/clearing and deleting the
local reference to jobject before returning a QJniObject.

Task-number: QTBUG-89633
Pick-to: 6.1
Change-Id: I0ea28c8ba4da0bfc1e341c6b4c1f61fecfec87a6
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2021-02-11 14:03:58 +00:00
Assam Boudjelthia
deca7cd730 Fix registerNativeMethods for good
The initial implementation and the commit
c00ab6f8ea was wrong:
* env->findClass() in fact returns a global reference, and in any
case we shouldn't be calling that, instead QJniObject would be
enough.
* The size param provided to env->RegisterNatives was wrong.
* A test for registerNativeMethods() is added to ensure such break
is not repeated again.

Task-number: QTBUG-89633
Pick-to: 6.1
Change-Id: I4d3a6a9270755f465c40add25521fb750dd4de0a
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2021-02-11 14:03:50 +00:00
Assam Boudjelthia
3348107c03 Android: take JavaVM() from QJniEnvironment and not QtAndroidPrivate
Task-number: QTBUG-89482
Pick-to: 6.1
Change-Id: Idfd442afc90c00e672b28b43c78c789813f46c7d
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2021-02-11 16:03:43 +02:00
Tor Arne Vestbø
f0f00dbd11 iOS: Disable three-finger-tap editing interaction menu when there's no focus object
A typical Qt application, such as a QML application, is a single full
screen QUIView, containing all of the granular controls of the UI.

The view accepts first responder status, so that we can pass on text
input to a possible text field inside the UI. That however triggers iOS
to bring up the editing interaction menu whenever the user taps with
three fingers, as iOS can't know that only parts of our view is suitable
for interaction.

To mitigate that we override the editingInteractionConfiguration getter
of the view, as documented, and dynamically report the correct enablement
based on whether we have an active focus object that accepts input.

This works because iOS queries the getter from the three finger tap
gesture recognizer, before showing the menu.

Change-Id: I0874340c42e437e1d7251896993f2eafe122f09e
Fixes: QTBUG-89735
Pick-to: 6.0 6.1 5.15
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2021-02-11 15:01:45 +01:00
Tor Arne Vestbø
bda8d7a0b0 testlib: Don't abort on unrecognized -AppleFoo command line arguments
Allow passing command line arguments such as -AppleLocale, that override
user preferences for the test process.

Change-Id: I9e58e91fcb01a36f9d6c64ef52369308be5e95b5
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-02-11 15:01:45 +01:00
Tor Arne Vestbø
d8158c6c93 macOS: Be honest about the system locale
The system locale of a macOS application is not affected by environment
variables like LANG. Yet, we were reporting a name determined from
environment variables as the fallbackUiLocale(), rather than one based
on the language and country of the actual system locale.

This lead, via the usual CLDR likely-subtag fallback, to claiming the
system locale's name, language, script and country were those obtained
from these environment variables, even when they were at odds with the
actual locale being used by the system, which was being used for some
queries.

Worse yet, any data not supplied by these queries was being obtained
from the same CLDR locale as the name, making for an inconsistent mix
of locale data.

While we cannot avoid the likely-subtag fallback step for fallback
data, it is more consistent to use the actual system locale's name
as start-point for that fallback.

At the same time, add support for the language, script and country
queries, so that the QLocale::system() describes itself faithfully,
instead of claiming to be the locale that results from that fallback.

If we want to support LANG or other environment variable overrides,
they should be handled by the layer above the system locale, by
changing the default locale of the Qt application, as if the user
had called QLocale::setDefault().

[ChangeLog][QtCore][QLocale] QLocale::system() on macOS no longer
pretends to support LANG or other environment variables as overrides,
as this is not a feature that the system locale on macOS supports.
To override the locale of an application, use QLocale::setDefault(),
or pass -AppleLocale en_US.

Fixes: QTBUG-90971
Change-Id: Ibdaf5ff9a2050f61233a88eabf3c29094f7757f1
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-02-11 15:01:45 +01:00
Tor Arne Vestbø
62af65551f macOS: Initialize standard NSUserDefaults as early as possible
The standard user defaults are initialized from an ordered list of domains,
as documented by NSUserDefaults.standardUserDefaults. This includes e.g.
parsing command line arguments, such as -AppleLocale "fr_FR", as well as
global defaults. AppKit does this during [NSUserDefaults init], which in
turn initializes the locale returned by CFLocaleCopyCurrent() and
NSLocale.currentLocale.

If those functions are called before NSUserDefaults does its thing the
locale will already have been created, and the logic in NSUserDefaults
won't have any effect -- nor is there any way for us to set/override
the locale after this.

To ensure that the -AppleLocale command line override is available through
the lower level Core Foundation preferences APIs, we need to initialize
the user defaults as early as possible via the Foundation-API.

Change-Id: I906a5a8b05a7216e60020ec45f8da725b801d2c5
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-02-11 14:01:45 +00:00
Venugopal Shivashankar
746393545f CMake: Port the snippet project setup to CMake
Change-Id: I411e58e94752f3b2d0a3e8aac0ab7c4c2272db89
Fixes: QTBUG-89826
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-02-10 21:19:15 +01:00
Eirik Aavitsland
1549dff04c Filter cosmetic lines using transformed, not world coordinates
Lines smaller than 1e-12 would not be drawn even when scaled up.

Pick-to: 6.1 6.0 5.15
Fixes: QTBUG-75630
Change-Id: I8f261876c325b60f61e95ca2e5fde2cb227d4cba
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2021-02-10 21:17:48 +01:00
Andreas Hartmetz
e6bd5a5ca3 Fix QNetworkInterface IsUp and IsRunning enum documentation
The information is based on common Linux knowledge, StackOverflow
answers (this is just one of them):
https://stackoverflow.com/questions/11679514/what-is-the-
difference-between-iff-up-and-iff-running
an LKML thread about IFF_UP and IFF_RUNNING:
https://lkml.org/lkml/1999/7/9/69
and the FreeBSD manpage for "ifnet" - e.g.
https://www.freebsd.org/cgi/man.cgi?query=ifnet&sektion=9

Pick-to: 6.0 5.15
Change-Id: I50a47b7fb26a63ac9d3f7eeef559fa7f56003cff
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-02-10 16:07:32 +01:00
Assam Boudjelthia
0d42f4df92 CMake: always pass QT6_INSTALL_PREFIX to androiddeployqt
Qt CMake uses a fake_prefix as install dir when running tests instead of
the main qt install path, this will throw androiddeployqt off since it
expects the real qt install path which has gradle and java sources.

Fixes: QTBUG-88579
Pick-to: 6.0 6.1
Change-Id: I6580470840ae14d4a4a68a95f217b30408d7ab44
Reviewed-by: Craig Scott <craig.scott@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-02-10 11:40:02 +02:00
Alex Blasche
04eb9b7c32 Fix typo in android APK generation log
Pick-to: 6.0 6.1
Change-Id: I9e593f35e1c4a51ef2cd4b08fe7e4b7c1a35a5d6
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2021-02-10 10:39:16 +01:00
Alex Blasche
9828559a3d Several fixes to porting guides
Change-Id: I46b1754103d33d21e6cdeb338e3c6e3b0d0a4e29
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-02-10 10:39:06 +01:00
Andrei Golubev
6512a7fc64 Restore pre-Qt6 QList::fill() behavior
Somehow QList::fill(t, newSize) introduced a regression in Qt6:
when newSize < QList::size() we should resize to the newSize.
This is aligned with QVector::fill() in 5.15 and std::vector::assign()

While 6.0 is already out, picking it to 6.0.x could save someone who
haven't migrated yet as well as fix some accidental bugs in Qt's code

[ChangeLog][QtCore][QList] Fixed QList::fill() regression introduced in
6.0: calling fill() with size < current list size wouldn't truncate the
list

Fixes: QTBUG-91042
Pick-to: 6.0 6.1
Change-Id: Ic166e2c5e42390b61df1030f7c705e344433f7f2
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2021-02-10 10:36:59 +01:00
Assam Boudjelthia
ab907053bd CMake: fix typo in qt_finalize_executable snippet
Task-number: QTBUG-90943
Pick-to: 6.1 6.0
Change-Id: Idea90f1a5fdd2070102ebda85feed79abcba3f70
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-02-10 00:00:38 +02:00
Mitch Curtis
1c2aa56cfa Doc: link to QScopeGuard in QScopedValueRollback documentation
Pick-to: 6.1 6.0 5.15
Change-Id: I02b9960fe37b09bc373ed52dec84b1efc8f43397
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-02-09 20:44:56 +01:00
Alexey Edelev
43cb801ccb Fix compilation of the QPSQLDriverPlugin plugin with enabled PCH
PostgreSQL package delivers several header files such as pthread, zlib,
zconf, uuid, etc. within Windows installation package. The headers are
exposed to the compiler by PostgreSQL include paths and have different
versions. When compiling PCH of the QPSQLDriverPlugin plugin, MinGW uses
the pthread.h header from the PostgreSQL include paths, that cause an
error related to pthread implementation mismatch.

Disable PCH for the QPSQLDriverPlugin plugin, when using MinGW.

Fixes: QTBUG-90850
Change-Id: I0be91bbefe37731acb2658d679b5b644ef552b23
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-02-09 15:49:47 +01:00
Jonas Karlsson
2861cfb6f8 QTextureFileData: support key value metadata
Task-Id: QTBUG-76970
Pick-to: 6.1
Change-Id: I9dba1b373250cea4d0c806997290a7afcdc900d7
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2021-02-09 13:39:47 +01:00
Morten Johan Sørvig
d66cb667ef Windows: Change default to ProcessPerMonitorV2DpiAware
Fixes: QTBUG-68712
Change-Id: Id73c4a5422e50b5bee2160468feb4d2f09c5461a
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-02-09 13:33:17 +01:00
Tor Arne Vestbø
7a1be5ee1e Properly name system locale data to clarify its use
Change-Id: Iace9644388444260c59ae46c9ca07bfada739bfd
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-02-09 13:29:26 +01:00
Tor Arne Vestbø
f218d89522 Clarify what QSystemLocale::fallbackLocale() is used for
Change-Id: I8f073f996505ccb42020b32fd76520ecef54e628
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-02-09 13:29:22 +01:00
Wang Chuan
13ae47d980 QPlainTextEdit: adjust scroll bars when showing up
The text of QPlainTextEdit might change when it is invisible, so an
adjustment of scroll bars is needed when the QPlainTextEdit showing
up, otherwise the range of scroll bars might be incorrect.

Fixes: QTBUG-77937
Pick-to: 5.15 6.0 6.1
Change-Id: I45c686c7e09ca7b2944c36122e9157de0ec4f0e0
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2021-02-09 20:00:59 +08:00
Assam Boudjelthia
817f8ac03c Documentation improvements to JNI API
Amends 4e60681c87.

Fixes: QTBUG-89632
Pick-to: 6.1
Change-Id: I7856e9b63eea5ba68a5472575016540ae656ec5f
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-02-09 11:22:17 +00:00
Joerg Bornemann
9d84bafeba Make it possible to disable the PrintSupport module
Introduce the 'printsupport' feature to control whether the PrintSupport
module is built.

[ChangeLog][QtPrintSupport] Building of QtPrintSupport can be disabled
by passing -no-feature-printsupport to configure.

Fixes: QTBUG-90778
Change-Id: I8a9a4b7f8dd8f39a81565c8eb14ce1ae0839267d
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Nodir Temirkhodjaev <nodir.temir@gmail.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-02-09 09:17:21 +01:00
Hou Lei
841e63cb77 Canonical pointer usage
Other affected rows have also been fixed.

Change-Id: Ie0a32f724bd2e40e7bfacfaa43a78190b58e4a21
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-02-09 10:27:14 +08:00
Christian Strømme
86e10e1acd Android: Fix the input type for date/time
The default variation of the DATETIME class is to show the layout for
date and time. If either date or time is requested, then only set one
of them.

Pick-to: 6.1 6.0 5.15
Change-Id: I5178f5f80490b7b0d7e7011d11da402a316d164a
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2021-02-08 18:31:25 +00:00
Mårten Nordheim
e940ab807c Schannel: fix suspicious sizeof marked by clang
sizeof(1) should be fine, but it looks weird, so let's just use the type
instead.

Change-Id: I543462a837b0214883ca389be0e7e6ba2057cdd0
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-02-08 17:02:31 +01:00
Laszlo Agocs
faebfdea1b Long live VK_KHR_display platform plugin!
Experiment with this once again, this time in a more forward looking
manner: move the code previously placed into eglfs's eglfs_viv backend
into its own plugin.

Move our attention to devices like the Raspberry Pi 4, where
VK_KHR_display has recently been introduced to the Mesa v3dv
backend. This is not in Mesa 20.3.3, the latest release at the time of
writing, but is available and functional when building master. This
serves as the reference system for testing the plugin, because it
looks like a fairly robust implementation.

The sole thing the plugin enables at the moment is creating a
QVulkanInstance and a QWindow with surfaceType VulkanSurface. This is
sufficient to run plain QWindow+QRhi (with QRhi::Vulkan), Qt Quick,
and Qt Quick 3D (with QSG_RHI_BACKEND=vulkan) applications.

One display and mode is chosen, by default the first in the
enumeration lists reported by the Vulkan extension. This can be
overridden with QT_VK_DISPLAY_INDEX and QT_VK_MODE_INDEX (modeled
after QT_VK_PHYSICAL_DEVICE_INDEX). The indices can be determined
based on the logs printed to the debug output. Changing the mode seems
to be working nicely with v3dv.

Multiple screen setups, where there would be more than one
VkDisplayKHR enumerated, have not been tested yet. Regardless,
multiple screens (reporting more than one QScreen, with a different
QWindow on each, eglfs style) are not currently supported. This may be
improved later (while keeping in mind that VK_KHR_display does not
have a fully-featured output management API).

Multiple (non-fullscreen) windows and especially raster windows
(QWidget) are not and will not be supported. Our single QWindow is
always forced to fullscreen.

When it comes to input, the level of support should match linuxfb and
eglfs. Note that while mouse input is fully functional, there is no
mouse cursor. (and this is unlikely to be implemented)

[ChangeLog][Platform Specific Changes][Embedded Linux] Introduced a
vkkhrdisplay platform plugin to run Vulkan-based applications in
fullscreen, without a windowing system, on systems where
VK_KHR_display and VK_KHR_display_swapchain are supported by the
Vulkan implementation.

Change-Id: I6388416f7fb2bfdc4b412a0a4971f25cc05d4668
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2021-02-08 13:01:22 +01:00
Laszlo Agocs
d8c771c53a egl: Add debug option to print all EGLConfigs
QT_QPA_EGLFS_DEBUG=1 prints the attributes for the chosen EGLContext.
Make QT_QPA_EGLFS_DEBUG=2 print the same for all EGLContexts.

Pick-to: 6.1
Change-Id: Id161d04789fbd015e29e5a5a89a0901000096ea3
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2021-02-08 12:32:13 +01:00
Laszlo Agocs
3bda970935 eglfs: kms: Log gbm bo handle and stride as well
Pick-to: 6.1
Change-Id: Ie345a3f4a4ab0407e3c532c6385ae31ca698d628
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2021-02-08 12:32:12 +01:00
Mårten Nordheim
2d5506dd9c QNetworkInformation backend for Android
Based on the old bearer manager code!

A lot of the old code went away though since it had been deprecated
in the time since it was written.

Task-number: QTBUG-86966
Change-Id: I21a6db1d4ebd8367084355a8e3202f4c05d9dce5
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 8652493529a46a375c11bbaf16d2122ee8466c29)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-02-08 11:30:37 +00:00
Allan Sandfeld Jensen
0ffdbb2126 Handle macOS 11 issues in softHyphens test
Calculate the effective width of the hyphen better, and compare with
ceiled sizes.

Pick-to: 6.1 6.0
Fixes: QTBUG-90698
Change-Id: I7ed2eb44c54240ecb2f8a38e5acf1f32608b2bfb
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2021-02-08 11:22:08 +01:00
Ulf Hermann
4e5d0cf5e5 QLibraryInfo: Rename Qml2ImportsPath to QmlImportsPath
The "2" is meaningless. We retain the old name as alias for source
compatibility, but we don't document it anymore.

Task-number: QTBUG-85064
Change-Id: Id10d58f6d39a0faaec042304b374ae6b23469362
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2021-02-08 11:00:12 +01:00
Morten Johan Sørvig
c35643dba3 Windows: Add support for PerMonitorV2 DPI awareness
Add support for opting in to PerMonitorV2 DPI awareness
on the command line:
	-platform windows:dpiawareness=3

This mode is supported on Windows 10 and up. Setting it
requires using the new SetProcessDpiAwarenessContext
API, which can be resolved from user32.dll.

Task-number: QTBUG-68712
Change-Id: I37821e27a67e08c2e9fef25e494cfd7abed13314
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-02-08 08:13:56 +01:00