Commit Graph

49843 Commits

Author SHA1 Message Date
Gatis Paeglis
2dc15e1f25 xcb: document QXcbEventQueue::PeekOption enum
And renamed PeekRemove* to PeekConsumed to document
better that nodes are not removed when peeking.

Change-Id: I7349f57fcfc3287d1a1309a31ee7f481f8d18755
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-01-01 17:58:20 +01:00
Christian Ehrlicher
f0818f6ed8 QAbstractButton: don't access nullptr in queryButtonList()
When a button has no parent, QAbstractButtonPrivate::queryButtonList()
unconditionally accessed parent which results in a nullptr access. Did
not crash because qt_qFindChildren_helper checks for nullptr and
therefore could only be found with a sanitizer.

Fixes: QTBUG-83865
Change-Id: I591e546e96acba50770935b9c3baaf08b09b833d
Pick-to: 6.0
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
2021-01-01 16:44:09 +01:00
Alex Trotsenko
e334d6f9a7 QProcess: allow pipelining for detached processes
[ChangeLog][QtCore][QProcess] Added support for
setStandardOutputProcess() with startDetached().

Change-Id: I61278cdb7084127f583c8c017688da392017b44c
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2020-12-31 12:16:46 +00:00
Alex Trotsenko
04c34eb799 QProcess: allow merged channels forwarding for detached processes
[ChangeLog][QtCore][QProcess] Added support for QProcess::MergedChannels
mode with startDetached().

Change-Id: I953ad2063322015332269522a297f8e2842e438c
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2020-12-31 12:16:38 +00:00
Alex Trotsenko
1fb9c5348e QProcess: consolidate channel management
We have the same channel forwarding, redirecting, and merging rules for
all platforms. This makes it possible to introduce the openChannels()
function, which consolidates the logic and performs high-level general
processing of the channels configuration properties.

Change-Id: Id3574fc42a56829328369b6a1a6ec9c95fce8eca
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2020-12-31 09:34:54 +02:00
Alex Trotsenko
8be9fb66f7 QProcess/Win: do not needlessly duplicate std handles in startProcess()
The idea was to create descriptors with HANDLE_FLAG_INHERIT. However,
this can be assumed to be already the case for std descriptors, and if
it isn't, the user messed up, and we shouldn't try to work around it.

This is consistent with what we already do in startDetached().

Change-Id: I8135c5e612c361e77a0442541f2d50cfbb5b4601
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2020-12-30 23:40:53 +02:00
Alex Trotsenko
efb3d87700 QProcess/Win: handle more errors in openChannel()
In theory, low-level functions like CreateNamedPipe() or
DuplicateHandle() could suddenly fail. Thus, in order to ensure the
correct configuration of the channels, we must check for these
errors.

Pick-to: 6.0 5.15
Change-Id: I3d6291043e5e394ec5c5a7d85dfb7b09bfdcd172
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-12-30 21:43:16 +02:00
Matthias Möller
6e9125608f fix potential mem leak on connection lost
The PostgreSQL driver can change it's connection status
after the first established connection.
In this case, the function "isOpen()" returns false
and the "close()" function would not free all resources.
With this fix, the "close()" function
always frees any allocated resource
independent of the connection status.

Fixes: QTBUG-88984
Pick-to: 6.0 5.15 5.12
Change-Id: I7c9add6a183bf46a8573952ab39f8cb1f728c00c
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2020-12-30 16:04:55 +01:00
Alexey Edelev
94b6bec01f CMake: Fix dirty summary file when reconfigure qt
Overwrite summary file during each configuration cycle.

Amends 6baf36d774

Fixes: QTBUG-87830
Pick-to: 6.0
Change-Id: Ie77f9aded4a7395592ff3cefad02265d836bebcc
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-12-30 15:06:14 +01:00
Alexey Edelev
34c3b12fd5 Revert "CMake: Fix missing report entries"
This reverts commit 642ee46f98.

Reason for revert: Issue when command_count is actually 0

Pick-to: 6.0
Change-Id: I1b2603f25b56e3bd50cfc22a08925930ad231498
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-12-30 13:00:06 +00:00
Alexey Edelev
642ee46f98 CMake: Fix missing report entries
Use LESS_EQUAL condition since qt_configure_command_count stores last
added command index but not actual count

Fixes: QTBUG-88054
Pick-to: 6.0
Change-Id: I8112820f9885bdad5a786a4f6b4890d8f2fbe14b
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-12-29 13:00:31 +00:00
Alexey Edelev
6baf36d774 CMake: Store config summary to file
Add generation of qmake-like config.summary in build folder

Fixes: QTBUG-87830
Pick-to: 6.0
Change-Id: I08dd9b3116c6200f7e9f5de96605118c1ea474ad
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-12-29 13:58:26 +01:00
Jonas Karlsson
a0aafefd00 Add QRhiTextureSubresourceUploadDescription QByteArray constructor
Change-Id: I1be4ef1a15c4049f19d0401d6a1a62b3117180a0
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2020-12-29 09:59:09 +01:00
Jonas Karlsson
162a859045 Add getDataView() method to QTextureFileData
This method will return a QByteArrayView of the data range corresponding
to the level. This avoids a leaky abstraction by moving the needed data
pointer arithmetic from the caller to the method. It will also make it
easier adding cubemap support in the future.

Change-Id: I2415bd88365d8d69ba14aefc77f5f1117f9e0033
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2020-12-29 09:59:06 +01:00
Lars Schmertmann
89b2b60e63 Add version() to QOperatingSystemVersion
Change-Id: I6c7f0616d52b0d118ffd8c031f3f51212b8ed821
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-12-28 17:33:20 +00:00
Laszlo Agocs
d2b0856f59 eglfs: Enable building the fbdev-based Mali backend
The configure tests are all in place for CMake as well, and this one
has no special library depdendencies. Generate the CMakeLists and
remove the special case.

Change-Id: I55817045f9e259515fb3aad33d1446d9413111d9
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-12-28 16:46:23 +01:00
Ahmad Samir
824c726340 QRegularExpression: mention raw string literal in the docs
Raw string literals (since C++11 according to [1]), make writing/reading
regex patterns easier, since one can just use e.g. "\w\d" without having
to escape those backslashes e.g. "\\w\\d"; this is especially useful with
longer/more complex regex patterns.

[1] https://en.cppreference.com/w/cpp/language/string_literal

Pick-to: 5.15 6.0
Change-Id: I119f9566d27222b915af931ee7e13e064baede61
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2020-12-28 14:35:39 +00:00
Paul Olav Tvete
24cf218b39 Handle XCB_INPUT_DEVICE_TYPE_MASTER_POINTER properly
Make sure we use the new QXcbScrollingDevice class for the "core
pointer" as well.

Change-Id: I97575e8125cbb2aa280662aa675e61021c21ea59
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-12-25 09:07:18 +01:00
Lu Zhen
9a237257c4 Adjust the format of code blocks in handleScreenChange function
Change-Id: I5da777e2196c005d6d5402c254a9452c3a888036
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-12-25 10:40:29 +08:00
Andreas Buhr
741862875c Add test creating QDateTime in double-DST gap in 1947 Germany
In 1947, Germany had not only a summer time but also a
"Hochsommerzeit", a high summer time. This patch adds a test
creating a QDateTime in the time gap at the beginning of this
Hochsommerzeit on May 11, 1947.

Pick-to: 6.0
Change-Id: Ib81a23914965f092c3e3195e4c7258e5a4e0b30e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-12-24 19:41:48 +01:00
Christian Ehrlicher
41e665a452 QStylesheetStyle: fix push button label alignment
Due to a copy'n'paste error in 01ec11507d
the valign was not properly determined for text-align bottom.

Fixes: QTBUG-89366
Change-Id: I081e1b24bba0edd9dd3754599a111c1658b18746
Pick-to: 6.0
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-12-24 12:48:28 +01:00
Liang Qi
489ce6f91b tests: unblacklist tst_QWindow::modalWithChildWindow() on openSUSE
This reverts 3d53cf976d.

Task-number: QTBUG-66851
Change-Id: Ib2b76c539c57fe70ee60426635e6ba59291a1f90
Reviewed-by: Liang Qi <liang.qi@qt.io>
2020-12-23 19:41:42 +00:00
Liang Qi
ab8b061620 tests: unblacklist tst_qwidget::saveRestoreGeometry on xcb
This reverts b4977a332b.

Task-number: QTBUG-69666
Change-Id: I07b57d248f3a09969e9f0d89404a3366b882e097
Reviewed-by: Liang Qi <liang.qi@qt.io>
2020-12-23 19:41:39 +00:00
Sona Kurazyan
f1f4fd16fd Document that QtConcurrent::run doesn't support overloaded functions
After improving QtConcurrent::run() to use parameter packs for the
arguments (see c977e74afd), calling
overloaded functions is ambiguous. Updated the porting guide and the
documentation to mention this and describe possible workarounds.

Task-number: QTBUG-89648
Pick-to: 6.0
Change-Id: I4c1f996ae67bce8c13cc1f99f54240295db6ae1d
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2020-12-23 18:34:21 +01:00
Christian Ehrlicher
f3747c21d3 QStyleOption: avoid code duplication
Use delegate constructors to avoid code duplication

Change-Id: I5c7d3764966ec07d1e3d175ccb075c64408d2338
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-12-23 17:08:05 +01:00
Paul Olav Tvete
c80d6473fb Fix out-of-bounds write
Change ac210c73e4 introduced the requirement that all input devices with
Scroll capability must have a QXcbScrollingDevicePrivate as their d_ptr.
However, this was not enforced, and would fail for the "Virtual core
pointer".

To fix this, always use qobject_cast to verify that the device is of the
correct type.

Change-Id: I4a6b1d4d79308eb04e9f52dda00294fffe377bdf
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-12-23 15:25:02 +01:00
Sona Kurazyan
3729d37dd9 Fix the CMake feature for docker-testserver to use correct mkspecs path
Use the QT_MKSPECS_DIR instead of QT_SOURCE_TREE to find out the
location for the testserver feature's data. QT_SOURCE_TREE points to
qtbase source location, which may not be always available. This allows
to use this feature by projects outside of qtbase.

Task-number: QTBUG-85034
Change-Id: If7fa6ef95777be9acf35d36f8d99776bf9568a79
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-12-23 10:56:16 +01:00
Samuli Piippo
d6c3d6355a qfont: blacklist tests for QEMU
Blacklist qfont tests that don't work correctly with qemu.

Task-number: QTQAINFRA-3836
Change-Id: I7f5d4b07428febb0adb82d38203226b5c56a2ad5
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
2020-12-23 10:55:56 +02:00
Nico Vertriest
776e1f92c2 Doc: Fix broken link in stylesheet examples
Task-number: QTBUG-89211
Change-Id: Idde01e22dd57c37c78d8c86305d047562e5c1f64
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-12-23 07:32:04 +01:00
Nico Vertriest
02f6a7b6ad Doc: Fix warning log error for parameter name
qcolorspace.cpp:522: (qdoc) warning: No such parameter 'primaries' in QColorSpace::QColorSpace()

Change-Id: Ie0df67e56e130fd07737c6f2e19ab8f40c317e93
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-12-23 07:31:19 +01:00
Christian Ehrlicher
6fbcfd9164 QListView: don't crash when an empty container is passed to itemsRect()
QIconModeViewBase::itemsRect() is crashing with Qt6 when an empty
container is passed.

Fixes: QTBUG-89434
Change-Id: I324f1a34b62e67c7bbd3fe33227f4174df7d3d37
Pick-to: 6.0
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2020-12-22 18:57:15 +01:00
Christian Ehrlicher
f8a175afba QPicture: Improve the documentation of Picture::play()
QPicture::play() does not save/restore the painting state when called
directly but this was not correctly stated in the documentation.
Therefore add a small note about this.

Fixes: QTBUG-83198
Change-Id: Ia820d32ccb4689d1e696fecffa9d6b5522e246b3
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2020-12-22 17:43:56 +01:00
Sona Kurazyan
701536b218 Allow other projects to use the CMake feature for docker-based tests
Introduce a new QT_TESTSERVER_COMPOSE_FILE variable for setting a custom
docker compose file path, which can be set by projects outside of qtbase
(e.g. QtCoap). If the variable is not set, fallback to the compose file
located in qtbase.

Task-number: QTBUG-85034
Change-Id: I4c0c9b161cad9787b089ef7e9da2aa00352a9159
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-12-22 17:28:39 +01:00
David Skoland
27d96b4789 Replace QtTest headers with QTest
Complete search and replace of QtTest and QtTest/QtTest with QTest, as
QtTest includes the whole module. Replace all such instances with
correct header includes. See Jira task for more discussion.

Fixes: QTBUG-88831
Change-Id: I981cfae18a1cabcabcabee376016b086d9d01f44
Pick-to: 6.0
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-12-22 15:20:30 +01:00
Alexey Edelev
bbebfa0be2 CMake: Add --enable-new-dtags flag support
Remove enable-new-dtags from feature mapping, handle it as regular
feature. Regenerate configure.cmake with 'enable-new-dtags' enabled.
Check for enable_new_dtags feature, add -Wl,--enable-new-dtags if
enabled.

Fixes: QTBUG-89013
Pick-to: 6.0
Change-Id: Ice57c02dc85f7f9ecf14e3bc65f31a57b589ce24
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Craig Scott <craig.scott@qt.io>
2020-12-22 10:28:34 +00:00
Topi Reinio
1021cbf45b Offline docs: Improve styling of unordered lists and external links
Use list-style-type correctly and replace background-image with
::before content for external link icons.

Pick-to: 6.0
Fixes: QTBUG-89470
Fixes: QTBUG-89471
Change-Id: Ib11a45baf5e92565b22e21f3bd1a929cbbbef608
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2020-12-22 10:23:07 +01:00
Morten Johan Sørvig
093e0d452f macos: Document that Drawer is obsolete
This feature is not much used on modern macOS, and
Qt 5 has never supported it.

Pick-to: 5.15 6.0
Change-Id: I9de195aaf7df954b63f0f816e93c91e870ef5852
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-12-21 22:48:44 +00:00
Morten Johan Sørvig
b3b95670b2 Call QEventDispatcher::startingUp() on thread start
...instead of during createEventDispatcher().

This way, startingUp() will be called [on the thread
being started] also for custom event dispatchers installed
with QThread::setEventDispatcher().

This prevents crashes when installing event dispatches which
expects that startingUp() will be called.

Crash reproducible with test case from QTBUG-51961.

Change-Id: I71bd696539689d928a61ff9b47d05297cf803b2f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-12-21 22:48:29 +00:00
Morten Johan Sørvig
cd6d805d93 offscreen: always create a valid QPlatformIntegration
Commit f4a66e5c accidentally made it so that the offscreen
plugin would produce a null QPlatformIntegration on
X11 if QT_QPA_OFFSCREEN_NO_GLX is set.

Restore previous logic where the generic QOffscreenIntegration
is created if the X11 code path did not create an object.

Change-Id: Ic71fb04bbd824f4121480dbaf8fa0571ebb39f42
Pick-to: 5.15
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-12-21 23:48:06 +01:00
Morten Johan Sørvig
79cb003020 Doc: Don’t use \note when documenting enum values
qdoc does not render these nicely when outputting html:
the enum value table table is split in two around the
\note.

Pick-to: 5.15
Change-Id: Ic2b8c5a247d1100a766e4ae10161aa6ee7644514
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-12-21 22:47:53 +00:00
Alexey Edelev
b4b33846b4 CMake: Use Release build type by default
Use developer-build feature to set Debug build by default instead of
.git folder detection

Task-number: QTBUG-89410
Fixes: QTBUG-89476
Pick-to: 6.0
Change-Id: I2a4f529299d4875e7b0eef5b41dd7a6b9402178b
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-12-21 16:16:29 +00:00
Friedemann Kleint
f6bf303cee tst_qimagereader.cpp: Fix MSVC int conversions warnings
Change-Id: I1b002ffde60dea9c54a8c41985ed295c05c45858
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-12-21 16:21:28 +01:00
Friedemann Kleint
4a6a45ac38 sqlite: Replace NULL by nullptr
Change-Id: I8e845ae093a68d2d7ecf0e358a2316a54d0f2144
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-12-21 16:21:18 +01:00
Friedemann Kleint
7f02071503 sqlite: Fix MSVC integer conversion warnings
Change-Id: I58ab6a8d7787abce5b0f73562eb53f40e39c8186
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-12-21 16:21:14 +01:00
Volker Hilsheimer
2b9a9cfddd Fix qdoc warning, reference parameter correctly
Change-Id: Icb3d0aa005752f291f81a47a15f7157009fd09f2
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-12-21 15:40:50 +01:00
Christian Ehrlicher
950c1925b1 QCheckBox: cleanup autotest
Avoid possible memory leaks by creating the checkbox on the stack, adopt
coding style.

Change-Id: I25f8b9048c8318d2897fd942492254a036c3a706
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-12-21 13:55:47 +01:00
Alexey Edelev
56bdef9437 CMake: Use host variables instead of hardcoded directories
'QT_HOST_PATH' indicates that we use crosscompilation toolchain
to build project. In this case 'Qt6Config.cmake' loads
'Qt6HostInfoConfig.cmake' from host QT_HOST_PATH, that defines
correct paths to host tools.

Replace hardcoded paths for host tools by paths recorded
in Qt6HostInfoConfig.cmake.

Correct conditions for QT_HOST_PATH, evaluate it explicitly as
string, but not as boolean expression.

Fixes: QTBUG-86557
Pick-to: 6.0
Change-Id: Ib52bbd32478051d019a932dcb1f735e2d4aacfbf
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-12-21 13:41:13 +01:00
Craig Scott
50f939bfe8 CMake: Don't rely on versionless commands or targets existing
Commands like qt6_finalize_executable() should not rely on versionless
commands or targets being available, since they can be disabled by a
build option.

Pick-to: 6.0
Change-Id: I6a9ab6a9b6a6b731590e5b8c43f73b518ed38e81
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-12-21 23:23:16 +11:00
Joerg Bornemann
ed432b070a CMake: Do not link "prefixed" openssl libs on Android
This reverts e52239f525, because we do not
have multi-ABI builds currently, and we must link against what the
WrapOpenSSL package provides.

Fixes: QTBUG-89473
Change-Id: I4f38a2c41e90ec8b602e28f8ca77f0ebd009639c
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-12-21 13:22:55 +01:00
Joerg Bornemann
9f432a540a configurejson2cmake: Rename assimp to qt3d-assimp
Adapt to changes in qt3d.

Change-Id: Ie21425ef30442c9ca4d6f288f8ca8bf8d4e4f6e3
Reviewed-by: Mike Krus <mike.krus@kdab.com>
2020-12-21 13:22:49 +01:00