Commit Graph

57836 Commits

Author SHA1 Message Date
Mikolaj Boc
d7ea07c8c1 Make it possible to mark a test as non-batchable
This is useful in some cases where extra parameters have to be set on
the test target.

Change-Id: Ic727fdaf0bc9c2e1c684d1a86352d31c0f974477
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-08-26 14:15:24 +02:00
Ivan Solovev
b057e32dc4 Port tests away from using q{Set}GlobalQHashSeed
These functions are marked as deprecated in future Qt releases.

Task-number: QTBUG-104858
Change-Id: I25d2932455d8c9e3e2d722b1c48fc2cfa2d1e679
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-08-26 14:15:24 +02:00
Ivan Solovev
804172f23c tst_qdtls: guard usage of the deprecated enum values
Guard the test that checks the deprecated protocol versions

Task-number: QTBUG-104858
Change-Id: I1b76e08d8fc985abf758bf86198fe3d33e5497d4
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-08-26 14:15:24 +02:00
Edward Welbourne
981b3336f6 Simplify one of the gap cases in QTimeZonePrivate::dataForLocalTime()
The code computed the transition gap and subtracted it from one side's
proposed UTC time, or added it to the other's; the effect was the same
as swapping these two values. Doing that overtly as a swap simplifies
the remainder of the code. Clarified the accompanying comment in the
process.

Change-Id: I00b8d2bb98ea08b6edd11e01d05a091cb39f3511
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-08-26 14:15:24 +02:00
Edward Welbourne
a6d6d919fa Trivial simplification in QDataStream &operator>>(..., QDate &)
The target date.jd is a qint64, so no need for a separate variable of
the same type to read into before copying to it.

Change-Id: I6f8990f6a74a785db205b8e2af1a3e3684759cd4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-08-26 14:15:23 +02:00
Lucie Gérard
75d2f167f4 Change the license of CMakeLists.txt file to BSD
This amends commit 32df595275

Task-number: QTBUG-105718
Change-Id: Ie3cadac4e424bfc26f3223dcee45491e3d6bd7e0
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-08-26 11:33:16 +00:00
Volker Hilsheimer
74397b4924 Refactor QApplication::event from if/else to switch statement
And it wasn't even 'else if' in all the places where it should have been.

Pick-to: 6.4
Change-Id: I5a48bfe27cc01fa1fbea1995e8c9cb1be427511a
Reviewed-by: Doris Verria <doris.verria@qt.io>
2022-08-26 13:33:16 +02:00
Harald Sitter
b646c7b76c add color picking support on wayland using the XDG desktop portal
On wayland applications are not trusted to perform screen grabs by
default, it is however possible to let the user specifically pick the
color of a pixel using the XDG desktop portal (otherwise used for
sandboxing etc.). Try to use this portal on unix systems by default.

To support this use case some extra abstraction is necessary as this
constitutes a platformservice rather than a platform feature. To that
end the QPlatformService has gained a capability system and a pure
virtual helper class to facilitate asynchronous color picking. When
supported the color picking capability takes precedence over the custom
picking code in QColorDialog.

Fixes: QTBUG-81538
Change-Id: I4acb3af11d459e9d5ebefe5abbb41e50e3ccf7f0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-08-26 13:33:15 +02:00
Tasuku Suzuki
f8409b6e9c QAbstractButton: do not steal wheel event when disabled
Fixes: QTBUG-102091
Pick-to: 6.4 6.3 6.2
Change-Id: I9a6683ad94a739c9997ebc68dd4ca8cf05438c45
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-08-26 11:33:15 +00:00
Friedemann Kleint
7e89e6bfe8 Windows QPA/QPlatformServices::openUrl(): Add work around for anchors on local file URLs
Retrieve the browser executable and pass the URL as command line argument
in this case to work around ShellExecute() failing to handle anchors.

Pick-to: 6.4 6.3 6.2 5.15
Fixes: QTBUG-14460
Change-Id: I44ccd1126d5db6a387b36729837edc045908a670
Reviewed-by: André de la Rocha <andre.rocha@qt.io>
2022-08-26 08:53:41 +02:00
Mikolaj Boc
b9053b55f8 Place test helpers in batched test output directory unless overridden
Change-Id: Ica209d10773d1acc38c3bad934cb53856e6a6c2a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-08-26 00:23:11 +02:00
Mikolaj Boc
cf2dc8d6f3 Remove support for min button in QWasmWindow
Minimizing windows is not supported on Wasm. The button has also never
been drawn, so remove the code that supports its hit test.

Change-Id: Ic1c26f1036aa9c7d65c8c61b7fd47ecce32889ca
Pick-to: 6.4
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2022-08-26 00:23:11 +02:00
Andy Nichols
e020a8eaf7 RHI: Make sure to compare bindings when comparing QShaders
It is possible, at least with Metal, that after the shader is converted
to the native shader that the native bindings will changes, so it is
important to also make a comparison against the bindings as well.

Pick-to: 6.4
Change-Id: I8b6ff99fbda04ea66e3cb7970d7c33df066734cf
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2022-08-25 20:36:57 +02:00
Edward Welbourne
612c345108 Reverse toLocalTime()'s and toUTC()'s delegation to toTimeSpec()
The implementations of toLocalTime() and toUTC() get marginally more
efficient and toTimeSpec() now manifestly does what its documentation
declares it does. Previously, passing TimeZone would have produced a
warning about passing it to toTimeSpec(), which was less than helpful;
it now gives a more appropriate warning.

Rationalize the \sa lines between these functions and their close
relatives in the process.

Change-Id: Ie94c63cbea8ef3d1d14c2f1febdc10f0e53023c0
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-08-25 20:34:54 +02:00
Edward Welbourne
47bafe6253 Reimplement fromSecsSinceEpoch() using setSecsSinceEpoch()
This avoids repeating the overflow-handling, which setSecsSinceEpoch()
does better in any case. Expand \sa linkage among related functions in
the process.

Change-Id: I929fca19d240b514c8167771a241ede5387bb418
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-08-25 20:34:54 +02:00
Edward Welbourne
7833b604b6 Eliminate ValidWhenMask; it duplicates ValidityMask
Apparently I failed to notice ValidityMask when I added ValidWhenMask
to simplify some code.

Change-Id: I780f329a6b21b51ba5fe0702c5c86ba07b88d81f
Reviewed-by: Mate Barany <mate.barany@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-08-25 20:34:54 +02:00
Edward Welbourne
572b12907b Clean up handling of status in QDateTime
Use QFlags's semantic methods more, eliminate some local status
variables we don't need, shorten some code. Rename one local variable
from status to dst to more accurately reflect its meaning.

Change-Id: Ib08ecacee13e91cff3ea0efd1d753963d7b7fa38
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-08-25 20:34:54 +02:00
Edward Welbourne
538535d88f Use QRoundingDown when converting UTC to local time
It simplifies the code.
Also add a comment on why the result is then checked for consistency.

Change-Id: Ic2d408c0ea39bc164e9a725284044b7dbd1f287c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-08-25 20:34:54 +02:00
Joerg Bornemann
ef1ff65b0a windeployqt: Directly access the 'relocatable' config feature
Before, we added the preprocessor define QT_RELOCATABLE if the
relocatable feature was set and checked for the define in the source
code.  This indirection is unnecessary.

Also, widen the scope of the feature check to avoid some unnecessary
code.

Change-Id: Ib5f38bf310699d528efdd24edbf14b861bf33935
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-08-25 19:37:29 +02:00
Volker Hilsheimer
52f4d0b0d2 QAbstractItemDelegate: tolerate that editor gets reparented
An item delegate might override destroyEditor to merely reparent the
existing editor out of the item view for later reuse, rather than
actually destroying the editor.

As of d0dffdfc01, the code calling
closeEditor() - which calls destroyEditor - might explicitly set focus
back to the item view parent of the editor. This needs to handle that
the parent of the editor might no longer be valid after the closeEditor
call returns, and rather store the old parent widget explicitly.

Add a test case that segfaults with nullptr access without the fix.

Fixes: QTBUG-105231
Pick-to: 6.4 6.3 6.2
Change-Id: I04a355673823c4941865f7a575864e991ceeb5f0
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2022-08-25 18:04:19 +02:00
Mikolaj Boc
b134300bc4 Make qt_internal_test_batch_target_name publicly available
The batch test target name is a useful thing to obtain in various
target-generating scripts.

Change-Id: I9605cf860fe1485e48108eba7e93f9064209d8fb
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-08-25 18:04:19 +02:00
Eskil Abrahamsen Blomfeldt
e8031906b5 Wayland: Skip test that queries window position
The client does not know its global window position on Wayland,
so testing for this will not work.

Pick-to: 6.4
Fixes: QTBUG-100888
Change-Id: Ibdfc84f1b33d25223dbd740603ce4783c21afc70
Reviewed-by: Inho Lee <inho.lee@qt.io>
2022-08-25 18:04:19 +02:00
Alexandru Croitor
2ca83a1fc9 qmake: Align iOS Info.plist file with the CMake one
Remove keys that are not needed: CFBundleSignature and
LSRequiresIPhoneOS.

Add CFBundleDevelopmentRegion, which is added by default in new Xcode
projects.

Pick-to: 6.4
Task-number: QTBUG-95838
Change-Id: I090c14561bc812ec255f55001b658d2dc60e11f3
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-08-25 17:28:16 +02:00
Alexandru Croitor
4a13083bad qmake: Reformat mkspecs/macx-ios-clang/Info.plist.app
Replace tabs with spaces.
Add some newlines.

Pick-to: 6.4
Task-number: QTBUG-95838
Change-Id: I0fa0e7b74590e7a093d22de85e24d4456ece4a63
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-08-25 17:28:16 +02:00
Alexandru Croitor
5b43a673df CMake: Fix storyboard entry in an iOS Info.plist file
It should not contain the .storyboard file extension, just
the base name.

Amends 578f4ba00c

Pick-to: 6.4
Task-number: QTBUG-101064
Change-Id: I70ce4581baec7cd62c2dae25c1ed963be28eddfe
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-08-25 17:28:15 +02:00
Alexandru Croitor
c81da821c4 CMake: Remove NSHumanReadableCopyright from iOS Info.plist
The key only applies to macOS bundles. Also, qmake doesn't have it.

Pick-to: 6.4
Task-number: QTBUG-95838
Change-Id: I438f0079cc7b74672dfbe956769138a8bb006669
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-08-25 17:28:15 +02:00
Alexandru Croitor
f16c7e15a2 CMake: Default CFBundleDevelopmentRegion to $(DEVELOPMENT_LANGUAGE)
That's what new projects in Xcode set.

Pick-to: 6.4
Task-number: QTBUG-95838
Change-Id: Id07dca0f56c8849a93085c5d36910679e45381b4
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-08-25 17:28:15 +02:00
Alexandru Croitor
6bbd77737f CMake: Default CFBundleName to ${PRODUCT_NAME} for iOS
This matches what we do in qmake.

Pick-to: 6.4
Task-number: QTBUG-95838
Change-Id: I59fab289a2febc38b50aced89c93612ac6a817a3
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-08-25 17:28:15 +02:00
Alexandru Croitor
c0bb65ec02 CMake: Replace tabs with spaces in iOS Info.plist template
Change-Id: Ied8f31a22c14688fd250955bb54f161f07bea90b
Pick-to: 6.4
Task-number: QTBUG-95838
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-08-25 17:28:15 +02:00
Mikolaj Boc
6cd0dc213b Move titlebar drawing routines to QWasmWindow
The title bar drawing routines belong in QWasmWindow, not in the
compositor. This provides better encapsulation as many properties
don't have to be leaked from QWasmWindow. Extensibility will also
improve.

Change-Id: If73dd4e87602f62bff0de92e1405f89e7a9f3b43
Pick-to: 6.4
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2022-08-25 16:53:47 +02:00
Sona Kurazyan
713f1c633a Move definition of QT_MOC_COMPAT from qgloabl.h to qtconfigmacros.h
Task-number: QTBUG-99313
Change-Id: I331aa5f1805a7e774d0fe8b819720c17767670b0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-08-25 16:53:47 +02:00
Sona Kurazyan
48aa320569 Extract header qmalloc.h from qglobal.h
Definitions of qMallocAligned()/qReallocAligned()/qFreeAligned() were
already in qmalloc.cpp, so add qmalloc.h for declarations.

Task-number: QTBUG-99313
Change-Id: I8028402a2c48dede855ad7de35d7b77e9911c761
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-08-25 16:53:47 +02:00
Sona Kurazyan
d9544394b0 Extract header qtypetraits.h from qglobal.h
Task-number: QTBUG-99313
Change-Id: I6cb76607213ca5d64dec669a39e8a59e13b21497
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-08-25 16:53:47 +02:00
Sona Kurazyan
9c706e2567 Extract header qswap.h from qglobal.h
And move qSwap() docs from qalgorithms.qdoc to qswap.qdoc.

Task-number: QTBUG-99313
Change-Id: I2385d5162a8dbb2de51a0c0509eced77b6a17159
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-08-25 16:53:47 +02:00
Sona Kurazyan
8aefcd4756 Extract header qtresource.h from qglobal.h
Task-number: QTBUG-99313
Change-Id: I4dd219dcb9181bf23feb6639821764cd5dc19a24
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-08-25 16:53:47 +02:00
Sona Kurazyan
4da3350f15 Extract header qconstructormacros.h from qglobal.h
Task-number: QTBUG-99313
Change-Id: I3861a3095148c7927aabd8becf6f7b534f214fba
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-08-25 16:53:47 +02:00
Sona Kurazyan
e57d2d7279 Move docs for qlonglong and qulonglong to QtTypes
These were missed by fc3441101b.

Change-Id: I3a0c3a24d584e9cdc753647bcb6a3829291c9499
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-08-25 16:53:47 +02:00
Tor Arne Vestbø
848e64ea8a Add qfunctions_win_p.h header for Windows helper functions
For now just includes qfunctions_winrt_p.h

Once submodules have been moved over to qfunctions_win_p.h we can move
non-WinRT specific content from qfunctions_winrt_p.h to _win_p.h.

Change-Id: I467bb4991c67a8769b60b9cf9f26aa553c439b92
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2022-08-25 14:43:37 +02:00
Morten Sørvig
407a39d3ca wasm: use matchView() instead of match()
QRegularExpression::match() is deprecated.

Change-Id: I66c7b3043a3805614fedcdb081c7e704e9925e5e
Reviewed-by: David Skoland <david.skoland@qt.io>
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2022-08-25 14:43:37 +02:00
Thiago Macieira
d2e9d70ec1 QMetaObject: add revision 11 for Qt 6.5
We changed qTryMetaTypeInterfaceForType() so it does record void and
void* (see commit 2d0c31e7d9 and commit
3695b35dfc). By incrementing the revision
number, we make it possible to determine at runtime whether the new
information ought to be present.

We may add even more types (namely, non-const references) before 6.5.0
is out. For pointers, the restriction remains that the metatype is
recorded only if the pointer is a pointer to a complete type.

Change-Id: Ic6547f8247454b47baa8fffd170dad79b1a90f6b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-08-25 03:31:28 -03:00
Yuhang Zhao
c1bdaf0a1a QSystemLibrary: Use Windows functionality directly
Passing LOAD_LIBRARY_SEARCH_SYSTEM32 to LoadLibraryEx() can also
only load libraries from the system directory, so in this case
we can use it directly instead of doing all the work ourself.

Change-Id: I4971781e55c9f1476861d599d58233114c280bc9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-08-25 12:42:18 +08:00
Mitch Curtis
502c47820a qt_fusionPalette: make links more legible on dark backgrounds
QPalette's default for Link is Qt::blue, which is difficult to read
on dark backgrounds.

Use the same blue that is already used for Highlight, as it is
consistent and easy to read.

Task-number: QTBUG-90504
Pick-to: 6.4
Change-Id: Ic7aceafb2bd0e57b65448917c352e3551ad26610
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-08-25 09:29:06 +08:00
Ivan Solovev
c6c41cc1a9 QtBase tests: remove QT_DISABLE_DEPRECATED_UP_TO defines
The value will be propagated from Qt build.

Task-number: QTBUG-104858
Change-Id: Iae2c32c3037438f41b92f9ee28004f30eb4e3210
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-08-24 22:08:49 +02:00
Ivan Solovev
373c7fe17e DBus tests: port away from deprecated APIs
Replacing QVariant::Type with QMetaType::Type

Task-number: QTBUG-104858
Change-Id: If03e2ad72b46c33f68f4382c7ed5c5801d2e70b2
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-08-24 22:08:49 +02:00
Ivan Solovev
e5c184ecd1 tst_qshortcut: port away from deprecated APIs
Explicitly call QKeycombination::toCombined() instead of deprecated
implicit operator int().

Task-number: QTBUG-104858
Pick-to: 6.4
Change-Id: I46b0863eda445e832a9490bc2a3d05811c2df8c6
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-08-24 22:08:49 +02:00
Ivan Solovev
6180e496c2 tst_qmessagebox: port away from deprecated methods
* Wrap some tests that specifically test deprecated APIs
  into #ifdefery
* Refactor some tests to use available methods

Task-number: QTBUG-104858
Change-Id: I03e318004ce1c2718ee574bf11e00df9bc04bcaa
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-08-24 22:08:48 +02:00
Mikolaj Boc
906dfef22b Use the qt type Qt::Edges instead of wasm-specific
The types essentially do the same job - the one that is more general
should be used, the other - removed, as it is redundant.

Change-Id: Iec09d3311681abce1405fcf8c2cebfb72f3fd51c
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2022-08-24 21:12:00 +02:00
Ilya Fedin
a4a51f6a64 Re-create TLW's window only when its surface type is really changed
Fixes: QTBUG-105017
Pick-to: 6.4
Change-Id: If5826172efb53b6df15dd3b7ba91b09d733cc77f
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2022-08-24 23:12:00 +04:00
Morten Sørvig
953272eb45 wasm: add manual auto-test for websockify-tunneled sockets
Test TCP sockets usage on the main thread, on secondary threads,
and with asyncify.

Pick-to: 6.4
Change-Id: I466df8c253c6a18a9c12d44fa8f53e76f81a0437
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2022-08-24 21:12:00 +02:00
Morten Sørvig
a2d0ce32cd wasm: add echo_server test TCP server
Test server for in-browser TCP usage.

Pick-to: 6.4
Change-Id: Ia1a29c0e14a6d2ee8075ce202c9f6998a3ccc4c9
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2022-08-24 21:12:00 +02:00