summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* QComboBox: reset indexBeforeChange to -1 if index is invalidatedAxel Spoerl2023-03-281-37/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The member variable indexBeforeChange is member-initialized with -1 and changed to the current row, if a valid index is set. It is used to check, if the model has been reset to an empty model and/or the index has been invalidated. The result is used to decide, if the currentIndexChanged signal is emitted or not. If a combo box had a valid index and it is invalidated afterwards (e.g. because the combobox has no more entries), indexBeforeChange is not reset to -1. The redundant signal emission is therefore prevented only the first time. This patch resets indexBeforeChange if the index is invalidated or the last item is removed from the combo box. It also adds a no-op check to tst_QComboBox::currentIndex. The test data sets "check that setting the index to -1 works" and "check that current index is invalid when removing the only item" check the respective use cases. As a drive-by, variable names and QObect::connect syntax have been cleaned up in tst_QComboBox::currentIndex. Fixes: QTBUG-108614 Pick-to: 6.5 6.2 Change-Id: Ib6dfa887d9247f2c47df065039d69ba57c32fa24 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Apply ScaleFactorRoundingPolicy to QT_SCREEN_SCALE_FACTORSMorten Sørvig2023-03-281-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | QT_SCREEN_SCALE_FACTORS is in many cases set on behalf of the user, instead of by the user, so we should apply the standard app scale factor policies to it, instead of interpreting it as a user override. Specifically, make it subject to the rounding policy set by QGuiApplication::setHighDpiScaleFactorRoundingPolicy(). This means that applications which support integer scale factors only will see integers only, also when QT_SCREEN_SCALE_FACTORS specifies a fractional factor. Users who want to override can set QT_SCALE_FACTOR_ROUNDING_POLICY=PassThrough to restore the default Qt rounding behavior. [ChangeLog][QtGui] The high-DPI scale factor rounding policy (settable with QGuiApplication::setHighDpiScaleFactorRoundingPolicy() or QT_SCALE_FACTOR_ROUNDING_POLICY) now applies to scale factors set with QT_SCREEN_SCALE_FACTORS. Fixes: QTBUG-95930 Fixes: QTBUG-99546 Change-Id: I936e96671fe2a0a43c3e8129f0768875cb011103 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* QPromise: add support for addResult(braced-initializer)Marc Mutz2023-03-281-0/+15
| | | | | | | | | | | | | The usual problem, the usual fix: default the addResult() template argument to the class template argument, cf. e.g. wg21.link/p2218. [ChangeLog][QtCore][QPromise] Added support for calls to addResult() with braced initializers. Fixes: QTBUG-111826 Change-Id: I9ad7294dbcefbc5d2609ca3d9e7304dbeb8b3f41 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QMetaType: Provide underlyingType for enumsFabian Kosmale2023-03-282-0/+56
| | | | | | | | | | | | | | | | | | | | | | Currently, Qt assumes that enums always have int as their underlying type (both in QMetaEnum::keyToValue and in the QML engine). This change makes it possible to to retrieve the underlying type from an enum's metaype - or rather, a metatype of an integral type with the same size and signedness. The use cases aobve don't really rely on the exact same type. In most cases, we wouldn't even need the signedness, however that is already available anyway, and it will come in handy once QML supports bigint, and we need to decide whether we should return While it would be possible for individual users of this function to manually query the size and signedness, having a function returning a metatype offers additional convenience - especially in QML, where the conversion APIs generally operate on metatypes. Task-number: QTBUG-27451 Task-number: QTBUG-84055 Task-number: QTBUG-112180 Change-Id: Icf733b42df0ea64017d69f4d94cb7c855d9e3201 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QFutureInterface: add a warning when an existing continuation is overwrittenIvan Solovev2023-03-281-0/+30
| | | | | | | | | ... and also extend the documentation to explain this case explicitly. Fixes: QTBUG-107545 Pick-to: 6.5 6.2 Change-Id: I9414cc677b037989de60e97871485018e5c8a569 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* SQL/IBASE: Time Zone support (firebird 4.x)Andreas Bacher2023-03-242-0/+126
| | | | | | | | | | Add support for time zones in the IBASE driver, which was introduced in firebird 4.x. TIMESTAMP WITH TIME ZONE data type is supported in order to store and retrieve a QDateTime with the time zone. Task-number: QTBUG-111879 Change-Id: I631b4262d17796a17630379b7d659f88244a23ad Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
* tests: blacklist tst_QImageReader::setClipRect() andLiang Qi2023-03-241-0/+8
| | | | | | | | | setScaledClipRect() svg tests on Wayland Task-number: QTBUG-112275 Pick-to: 6.5 Change-Id: Iaae1781df09b8402b349fd41111ea16ca26215f8 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* tst_QVariant: add a test contrasting Qt 5/6 isNull behaviorMarc Mutz2023-03-241-0/+7
| | | | | | | | | | | A null QString used to make a QVariant containing it null in Qt 5, but this is no longer the case. Add a test that get_if works as expected. Task-number: QTBUG-111598 Change-Id: I0f3511e1b33f4a9d67755269455680feda22ddca Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Implement [variant.get] for QVariant [2/2]: get()Marc Mutz2023-03-241-1/+88
| | | | | | | | | | | | | | | | | | | | | | | | | This second patch of the series implements get(). Unlike other get() implementations in Qt, don't use my trick with the constrained friend free function here. Instead, provide the four overloads manually, like mandated by the standard library for std::variant (and, indeed, tuple), such that these functions can also be used on subclasses of QVariant. [ChangeLog][QtCore][QVariant] Implemented the type-based std::variant access protocol (get<T>()/get_if<T>()) to allow easier access to the contained element than the previous solution of casting data(), as well as to allow generic code to treat QVariant and std::variant the same. The holds_alternative<T>() function is not provided, since it's the same as get_if<T> != nullptr. The index-based variant access functions (get<I>()/get_if<I>()) are also not provided, because, unlike std::variant, QVariant does not have a bounded number of alternative types, and QMetaType IDs are not (all) compile-time constants. Fixes: QTBUG-111598 Change-Id: Id7bc41f7d91761b3483ec5604f1a4685c8079844 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Implement [variant.get] for QVariant [1/2]: get_if()Marc Mutz2023-03-241-0/+159
| | | | | | | | | | | | | | | | | | | | | | | | | | | | QVariant supports non-default-constructible payloads, in principle (QTBUG-105140). And fromValue() works with such types, but value() insists on providing a wide contract and therefore accidentally requires default-constructible. We can now invent other "Qt-ish" API like optional::value_or() or a value() that returns optional<T>, but we should first get the interface in that generic code must use, and which at the same time is the most versatile, because it gives write access to the element stored in the variant: [variant.get], consisting of get_if(), get(), and holds_alternative(). The latter is the same as get_if() != nullptr, so we won't provide it. This first patch implements get_if(), adds test for it. As a Hidden Friend supposed to be called with explicit template arguments, we run into the problem that wg21.link/P0846 solved for C++20. Add the usual work-around, and check it works. The ChangeLog will be on the last patch. Task-number: QTBUG-111598 Change-Id: I23f57ea2de3946944810c5552c68a7a3060a44f2 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QVariant: ensure the type custom is registered on constructionThiago Macieira2023-03-231-0/+10
| | | | | | | | | | | | | | I must have broken this in the 6.5 work I did for QMetaType and QVariant, but I haven't searched which commit exactly did it. Our QVariant tests are old and thus only checked the type ID, which meant that they caused the registration by the act of asking for the ID in the first place; this commit adds a couple of explicit checks for the type registered by name before the ID. Fixes: QTBUG-112205 Pick-to: 6.5 6.5.0 Change-Id: Idd5e1bb52be047d7b4fffffd174f1b14d90fd7a3 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QTimer: fix new-style slot invocation for receiver in another threadThiago Macieira2023-03-231-3/+8
| | | | | | | | | | | | | | | | | | For single-shot timers, at least. QSingleShotTimer had either an optimization or the only way to make new-style slot invocations by storing the QSlotObject pointer and calling it directly. Instead of doing that, let's just actually connect and let QObject handle the actual delivery. [ChangeLog][QtCore][QTimer] Fixed a bug that caused slots connected to single-slot timers using the new-style connection mechanism to be delivered in the wrong thread. Fixes: QTBUG-112162 Pick-to: 5.15 6.2 6.5 Change-Id: Idd5e1bb52be047d7b4fffffd174eadb227ab65ee Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
* tst_bench_QCryptographicHash: swallow result() return valuesMarc Mutz2023-03-231-3/+6
| | | | | | | | | | | As usual, assign them to a [[maybe_unused]] variable, to avoid potential future [[nodiscard]] problems, and to indicate to readers of the code that there's a result that's being returned, we're just not interested in it. Pick-to: 6.5 6.2 Change-Id: I2bd47ca98418092ca885d50a1a6417a21a612a85 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* tst_bench_QCryptographicHash: use QMetaEnum trickMarc Mutz2023-03-231-60/+20
| | | | | | | | | | | | | | | | ... conveniently wrapped in a generator, to not have to keep an algoname() function in sync with QCryptographicHash::Algorithm. The MaxCryptoAlgorithm constant was already stale following the addition of BLAKE2b/s algorithms in 5d69aa3ee1214cf689e2357bff8688f2ff138471. Also make the data-driven tests have an actual Algorithm column (was: int) to minimize casting. Pick-to: 6.5 6.2 5.15 Change-Id: I89a6098e512a72f623fd50a6f88fc351c7bb1418 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* tst_bench_QCryptographicHash: port to QTest::addRow()Marc Mutz2023-03-231-24/+24
| | | | | | | | | Allows using printf-style tag formatting. Pick-to: 6.5 6.2 5.15 Change-Id: Icb8014dd476a32791c662a15b209dbb3bd7d6c96 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* rhi manual tests: allow having some gui controlsLaszlo Agocs2023-03-2328-51/+52606
| | | | | | | | | | | | | Having a simple Dear ImGui bridge is not just useful for the manual tests, which do not have any other means to displays GUIs, but is in itself an important exercise for the QRhi machinery. Have a new manual test that exercises the built-in ImGui demo window. Then use it in the displacement test for real, to replace the myriads of key presses with on-screen sliders and checkboxes (with less code). Change-Id: I296bafae2a5cce6fc7a447d97e68e5bcec15f451 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Change paintedwindow example to be a manual testLaszlo Agocs2023-03-235-0/+310
| | | | | | Pick-to: 6.5 Change-Id: I25a0f491f824c43fc75ba6358518133ede09adcd Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* Move hellowindow and qopenglwindow to be a manual testsLaszlo Agocs2023-03-2312-0/+1022
| | | | | | Pick-to: 6.5 Change-Id: I8d1517ee57df9b2dee0486f47562b0754e9dcbad Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* Change computegles31 example to a manual testLaszlo Agocs2023-03-227-0/+601
| | | | | | Pick-to: 6.5 Change-Id: I652daf3ccbb921c5eb73b48586ee9616c7704b97 Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* Move hellovulkantexture example to manual testLaszlo Agocs2023-03-2211-0/+984
| | | | | | | | | | Because it is the least documented one, and compared to the other Vulkan examples it does not add anything new, it just dives deeper into Vulkan. Pick-to: 6.5 Change-Id: Iecf3e04625fba256ea8134da57f54498ee2010db Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* Verify fix for manual get<I> calls for QVector<N>DMarc Mutz2023-03-221-0/+33
| | | | | | | | | | | | | | | The necessary QT_ENABLE_P0846_SEMANTICS_FOR is already provided by qpoint.h) here. Add a test to confirm it works. Amends 0e22001a3bb070d4e9956e89543ec0e5ac6f23f8. [ChangeLog][QtGui][QVector2/3/4D] Fixed manual get<I>() calls (Tuple Protocol) in C++17 mode. Task-number: QTBUG-111598 Change-Id: Id4a118b6439c2d1471b921f8d92ee558f9902eab Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Short live QT_ENABLE_P0846_SEMANTICS_FOR!Marc Mutz2023-03-225-0/+117
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In C++17, unqualified lookup doesn't find function templates that require ADL from a call with explicit template arguments, unless another function template of that name is in scope (otherwise, the < is parsed as operator less-than instead). P0846, merged for C++20, fixes this to repeat the name lookup, parsing the < as indicating a template. We have API in Qt (Tuple Protocol for some types, e.g. QPoint) that work for the purpose of Structured Bindings, but don't work for manual unqualified calls when P0846 semantics are missing, and we're adding more, to QVariant, so add a macro to handle the issue. The macro simply declares a function template overload of the given name for a throw-away struct, thereby bringing, for that one name, P0846 semantics into C++17. When we require C++20, we can drop this again. Amends: - fb6b7869e8bdda94f7e791db7f281f3bb6e0e004 for QPoint(F) - 8ae9431c792f14a32909ac013a1383547d6bcfa8 for QMargins(F) - 0e22001a3bb070d4e9956e89543ec0e5ac6f23f8 for the rest [ChangeLog][QtCore][QSize/F, QMargins/F, QPoint/F] Fixed manual get<I>() calls (Tuple Protocol) in C++17 mode. Task-number: QTBUG-111598 Change-Id: I2ffaef12c5bb6d82f75ce78a7c03c6789dfa0691 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Add QTextListFormat::start: html and markdown ordered list index offsetNicolas Werner2023-03-226-16/+248
| | | | | | | | | | | | | | | | | | | | | | | | This is useful for a lot of applications that render text coming from sources which already support arbitrarily numbered lists (like chat applications for example). Application-side workarounds usually have significant overhead; and this feature has been requested multiple times. It should be possible to both read and write HTML with the <ol start="x"> attribute, and read and write Markdown with arbitrary numbers for the first item in a list. [ChangeLog][QtGui] QTextList now supports specifying a start index using the new QTextList::{setStart, start} functions. The HTML start attribute on ordered lists in rich text documents is now parsed and used when rendering a text list. Non-negative indices in markdown lists are now also parsed and written properly. This allows starting a list with a different number than 1. Fixes: QTBUG-30407 Fixes: QTBUG-65384 Task-number: QTBUG-107562 Change-Id: Ib35b9378d9134ffedaa2d92f728b0984793aa7c1 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Add a manual test to show a QTreeView with QInputDevice::devices()Shawn Rutledge2023-03-214-0/+360
| | | | | | | | | | | | | | | At least on X11 this is a real hierarchy: slave devices come and go as children of the master devices. The goal is to verify that this tree and the output of `xinput list` are in sync. The model calls [begin|end]InsertRows() and [begin|end]RemoveRows() as necessary to attempt to keep the view updated. Task-number: QTBUG-46412 Task-number: QTBUG-98720 Task-number: QTBUG-104878 Task-number: QTBUG-112141 Change-Id: I8a2252f041cd1de777eef225d0e7f0db5c90a706 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Widgets/QCheckBox: change signature of stateChanged() for Qt7Christian Ehrlicher2023-03-211-11/+16
| | | | | | | | | | | Change the signature of stateChanged(int) to emit Qt::CheckState instead. This was forgotten during Qt6 porting so we have to wait for Qt7. Task-number: QTBUG-104688 Change-Id: Ica2504e5b9ae68612de81524faed0f31c9b10402 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Silence warnings from unused variablesVolker Hilsheimer2023-03-214-2/+5
| | | | | | | | | | Use them, or replace them with existing constants. Pick-to: 6.5 Change-Id: I808028296305e15b68aecb1f961ba6a85b8e9cc7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Øystein Heskestad <oystein.heskestad@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Corelib: s/Q_OS_MAC/Q_OS_DARWIN/wg except for doc and definitionEdward Welbourne2023-03-2017-40/+40
| | | | | | | | | | I got tired of being told off by the inanity 'bot for faithfully reflecting existing #if-ery in new #if-ery. Retain only the documentation and definition of the deprecated define. Change-Id: I47f47b76bd239a360f27ae5afe593dfad8746538 Reviewed-by: Ahmad Samir <a.samirh78@gmail.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Testlib: fix the last few s/Q_OS_MAC/Q_OS_DARWIN/wEdward Welbourne2023-03-201-2/+2
| | | | | Change-Id: I6fe6a865aea37c6a2d153bd2c3aace5242362c88 Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
* Revert "Skip socket and server tests on Ubuntu 22.04 and QEMU"Mårten Nordheim2023-03-205-23/+0
| | | | | | | | | This reverts commit 9286d46ee25f84d24a509e703e294f792cba1483. Reason for revert: Should be fixed by 5c6814fb18760f65bab0f8b9cd623ee5c874a58d Change-Id: I3a161df445af8dcbb61138d57e931a093a319027 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* tst_QMessageAuthenticationCode: avoid setKey() callsMarc Mutz2023-03-201-4/+2
| | | | | | | | | | We test setKey() in repeated_setKey() these days, so speed up the test of the test suite ever so slightly by passing the key to the ctor instead of an explicit setKey() call. Pick-to: 6.5 Change-Id: Ia2378c0f59cbfa9d95a0f3665b06655332247e2c Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* SQL/Tests: Cleanup of tst_databases.hChristian Ehrlicher2023-03-172-124/+84
| | | | | | | | | Cleanup tst_databases.h: fix identation, replace qGetHostName() with QSysInfo::machineHostName(), use QSqlTableModel::EditStrategy instead int for submitpolicy data to avoid casts. Change-Id: I4917ca23c4b39ab15bc0e006e6111baefb82d278 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* SQL/IBASE: fix testsChristian Ehrlicher2023-03-173-24/+31
| | | | | | | Fix some tests so they will correctly work with Interbase (Firebird 3.x) Change-Id: Ib3c8ceaf31fa01af3a00a9772350b49cee8b2342 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* SQL/OCI: add maximumIdentifierLength()Christian Ehrlicher2023-03-171-8/+5
| | | | | | | | A table name or identifier must not be longer than 30 (< Oracle 12.2) or 128 bytes (sadly not characters). Change-Id: I49192afaf908e12f5cfd20c754640b6117b03a71 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* SQL/Tests: Cleanup tst_QSqlDatabaseChristian Ehrlicher2023-03-171-35/+16
| | | | | | | | Remove driverQuotedCaseSensitive() as it's no longer needed, fix view creation for PostgreSQL. Change-Id: I72437252cfad762a5a245475d6652de3c7b5ef46 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QColorDialog: Support hex rgb values with and without leading #Axel Spoerl2023-03-171-0/+53
| | | | | | | | | | | | | | | | | | QColorDialog supports entering hex rgb values only with a leading #. That makes copy/paste impossible whenever the copy source has plain hex, without the leading #. This patch automatically adds a leading # character, when missing. As a drive-by, QObject::connect statements are altered to PTMF syntax, amending 9eb1b9e86ce3d1004e39e8ab7c7ecb6796d6df1a. The patch also adds an autotest for the new functionality. Fixes: QTBUG-111742 Pick-to: 6.5 Change-Id: I4ced29dc8b543457f411a3fa0ac756b550cdb09f Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Adjust window rectangle for menu baseline test caseSanthosh Kumar2023-03-171-1/+4
| | | | | | | | | | Capturing complete window for menu test cases makes it fail as there can be different window shapes (such as rectangular or rounded corners). To avoid this, its better to capture only minimal visual portion that can be compared against. Change-Id: I30e85589fce8c17115f511a7a345d46949e6c9e8 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Remove window frame for combo-box widget baseline test caseSanthosh Kumar2023-03-171-1/+1
| | | | | | | | | | The window frame differs across ms-windows version and this makes combobox test case either fail or more fuzzy. To avoid this provide only window geometry for screen capture instead of complete window rectangle. Change-Id: I0f1a1a95c45218ccc69fc92f589baee0135db943 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Handle device loss for texture widgetsDavid Redondo2023-03-171-0/+46
| | | | | | | | | | | | Previously the widget stayed black and we printed "QBackingStoreDefaultCompositor: the QRhi has changed unexpectedly, this should not happen". To make it work the compositor is recreated in addition to the rhi and the widgets are informed with the internal events. Change-Id: I982d08bd3530478fe0f827080154c008a92a812e Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Wasm testing: Refactor test framework and update testsPiotr Wierciński2023-03-171-310/+367
| | | | | | | | | Update tests so they take into account minimum QWasmWindow size constraints. Refactor test framework and make it easier to read and write new tests. Change-Id: I621c5eee6577f1569eef93e883d1cf0828e3946f Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
* QCryptographicHash: check addData() with null QByteArrayViewMarc Mutz2023-03-171-0/+23
| | | | | | | | | | | | | | When this code was using QByteArray, whose data() is never nullptr, the strings presented to the underlying C APIs were always valid NTSs (nullptr is not a valid NTS). With QByteArrayView, or with QT5_NULL_STRINGS != 1, this is no longer the case. Check that all implementations are fine with that. Pick-to: 6.5 6.4 Change-Id: I78251288a4784440af4a2daf095aed7c53867287 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QMessageAuthenticationCode: add move SMFs and swap()Marc Mutz2023-03-161-0/+45
| | | | | | | | | | | | QCryptographicHash is move-only these days, so QMessageAuthenticationCode should not be left behind. [ChangeLog][QtCore][QMessageAuthenticationCode] Added move constructor, move assignment operator and swap() function. Fixes: QTBUG-111677 Change-Id: I420f24c04828e8ad7043a9e8c9e7e2d47dd183e0 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QDate: add epochDate() helper to unittestsAhmad Samir2023-03-161-6/+14
| | | | | | | Drive-by change: add an assert for JULIAN_DAY_FOR_EPOCH. Change-Id: I891ef253f1f16b1efb8354d1b179f319b3553feb Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add basic test for QWindow foreign windowsTor Arne Vestbø2023-03-162-0/+137
| | | | | | | Only implemented on macOS and Windows for now. Change-Id: Ib6330bc7024453d23675c1770367e8da6c4c9a34 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* moc: Allow anonymous propertiesUlf Hermann2023-03-161-0/+51
| | | | | | | | | | | | This is private for now. It's very handy to have anonymous properties for the QML model/delegate adaptors. There are models with only "singular" model data that doesn't have any sub-properties. Such model data should be available from the model object via an empty string as role. This way we can get rid of a lot of special casing. Task-number: QTBUG-104752 Change-Id: I229e355a7cab064ee1c9f89557bc0244a5d0c90a Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QPlainTextEdit: Don't block signals on page stepAxel Spoerl2023-03-151-0/+26
| | | | | | | | | | | | | | | | | | | | | | | | | Signals of the vertical scroll bar were blocked when scrolling with pageUp/pageDown keys or clicking on the scroll range outside the scroll bar. This has lead to inconsistent signal emissions: The vertical scroll bar's valueChanged signal was emitted only on single steps and when the scroll bar was moved with the mouse. When it was moved in page steps by clicking on the scroll range or pressing pageUp/pageDown, it was not emitted. This patch removes the signal blocker for page step movements, which was added in 94fd108ea42a99dacefa819bc3fd4363fb95e886 to replace explicit calls to blockSignals(), which were added in c14d442b08ac81327b173b0a220c7b1840667899. The patch also adds test function to tst_QPlainTextEdit to check if the valueChanged signal is emitted correctly. Pick-to: 6.5 6.4 6.2 Fixes: QTBUG-8682 Fixes: QTBUG-25365 Change-Id: I4385a5387c91497f623978e35bbbe3e06f473afe Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* QString: change test data to compile with QT_NO_CAST_FROM_ASCII [10/13]Ahmad Samir2023-03-152-154/+159
| | | | | | | | | | | | Drive-by changes: - Cleanup creating a QChar[], by creating a char16_t[] and reinterpret_cast'ing it - Use human-readable Unicode characters where possible Pick-to: 6.5 Change-Id: Ice2c36ff3ea4b6a5562cf907a7809166a51abd28 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Replace ushort*/uint* with char16_t*/char32_t* in private API [1]Ahmad Samir2023-03-152-2/+2
| | | | | | | Task-number: QTBUG-110403 Pick-to: 6.5 Change-Id: Ie20a831f22212d56659cf3c6940d17134ab5f2c5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix tst_qfilesystementry in unity buildAmir Masoud Abdol2023-03-152-3/+2
| | | | | | | | | | | | | | | Previous setup of the test was failing in minimal static build if built using the unity build because of the explicit inclusion of the qtcore source files. By removing them, it surfaced that QFileSystemEntry doesn't export all its necessary symbols for testing. So this patch does that, as well as removing the qtcore sources from the test. It also makes sense to make the test private. Pick-to: 6.5 Task-number: QTBUG-109394 Change-Id: Icdabe32485b7ce4ed6049bcc24918f531406b4bd Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* emit QAbstractSlider::valueChanged() only on value changeAxel Spoerl2023-03-151-3/+7
| | | | | | | | | | | | | | | | | The signal has been emitted also, when the slider position has changed without a value change (e.g. on QWidget::show() or on resizing). This patch stops emitting the signal without a value change. It adds a verification to tst_QAbstractSlider::setValue(), that valueChanged is not emitted on a no-op value change. As a drive-by, the patch removes an unnecessary assignment and changes signal spy constructions to PTMF syntax. Pick-to: 6.5 6.4 6.2 Task-number: QTBUG-25365 Change-Id: I9932e45d4e680aa53422ca75aa42a16306213a38 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* QLockFile: tryLock(): use chrono firstAhmad Samir2023-03-141-8/+10
| | | | | | | | | | | | I.e. tryLock(chrono::milliseconds) shouldn't call the int overload as that truncates the timeout (milliseconds is typically int64_t). Add a note to the tryLock(millisecons) docs that passing milliseconds::max() will make it wait forever to obtain the lock. Task-number: QTBUG-110059 Change-Id: Ib48d9b1b117ce816348625331543d6ba8a788973 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>