summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Fix irrelevant error case in QSplitter testEskil Abrahamsen Blomfeldt2020-04-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | The tst_QSplitter::replaceWidget() is testing that if you replace a longer QLabel with a shorter one in a horizontal splitter layout, then we *only* get a resize for the new, shorter label (expanding it horizontally to match the replaced widget, as documented). But the test accidentally triggered the QTextDocument backend for the QLabel by including HTML tags in its text. Due to QTBUG-82954, it is possible that the QTextDocument height includes the leading of the font in the last line, so if the default font has a leading, the new label will be higher than the QSplitter, and the splitter will expand its height, causing resizes for the other labels as well. Since this is not the case we are testing here, and it is currently blocking the fix for QTBUG-80554, we simply make the new label use the same plain text backend as the others. Task-number: QTBUG-82954 Change-Id: I6bfa1f3648b0fc9758c57ab2fa95be2451995df3 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Remove bearermanagement usage inside QNAM and QNetworkProxyMårten Nordheim2020-04-012-376/+0
| | | | | Change-Id: I2c4fdf598b46daf1b69a65848ebe0fd78ef8be24 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Add support of failure handler callbacks to QFutureSona Kurazyan2020-04-011-0/+333
| | | | | | | | | Added QFuture::onFailed() method, which allows attaching handlers for exceptions that may occur in QFuture continuation chains. Task-number: QTBUG-81588 Change-Id: Iadeee99e3a7573207f6ca9f650ff9f7b6faa2cf7 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Store QFuture exceptions as std::exception_ptrSona Kurazyan2020-04-011-16/+86
| | | | | | | | | | | Replaced the internal ExceptionHolder for storing QException* by std::exception_ptr. This will allow to report and store exceptions of types that are not derived from QException. Task-number: QTBUG-81588 Change-Id: I96be919d8289448b3e608310e51a16cebc586301 Reviewed-by: Vitaly Fanaskov <vitaly.fanaskov@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Enable qmetatype test with CMakeFabian Kosmale2020-04-012-1/+2
| | | | | | Change-Id: I34dcc0ae9187092ae1e277c2b3676d551a76991a Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Remove QRegExp based API and QRegExp usage from QTextDocumentLars Knoll2020-04-011-75/+24
| | | | | Change-Id: Ib5cc2d747f215a483585b703f9b4f6415e0d59f7 Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
* Remove all QRegExp dependencies from widgetsLars Knoll2020-04-012-89/+0
| | | | | | | | | QRegExp is deprecated in Qt6 and will get moved to the Qt 5 compat library. As such we need to remove all API and usages of QRegExp in Qt. Change-Id: I33fb56701d3d7c577f98a304c1d4e6f626fcb397 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Make QLocale(QString) explicitLars Knoll2020-04-016-11/+12
| | | | | | | | We should not implicitly convert a QString to a QLocale object. It can easily create unwanted side effects. Change-Id: I7bd9b4a4e4512c0e60176ee4d241d172f00fdc32 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QFuture - add ability to move results from QFutureTimur Pocheptsov2020-03-311-1/+224
| | | | | | | | | | | | | | | | | | | | | | | | | | | | QFuture's original design pre-dates C++11 and its introduction of move semantics. QFuture is documented as requiring copy-constructible classes and uses copy operations for results (which in Qt's universe in general is relatively cheap, due to the use of COW/data sharing). QFuture::result(), QFuture::results(), QFuture::resultAt() return copies. Now that the year is 2020, it makes some sense to add support for move semantics and, in particular, move-only types, like std::unique_ptr (that cannot be obtained from QFuture using result etc.). Taking a result or results from a QFuture renders it invalid. This patch adds QFuture<T>::takeResults(), takeResult() and isValid(). 'Taking' functions are 'enabled_if' for non-void types only to improve the compiler's diagnostic (which would otherwise spit some semi-articulate diagnostic). As a bonus a bug was found in the pre-existing code (after initially copy and pasted into the new function) - the one where we incorrectly report ready results in (rather obscure) filter mode. Fixes: QTBUG-81941 Fixes: QTBUG-83182 Change-Id: I8ccdfc50aa310a3a79eef2cdc55f5ea210f889c3 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Port autotest to QRegularExpressionLars Knoll2020-03-311-23/+26
| | | | | Change-Id: Id632ed191add8beab6a857c4c949cc78e4c5eccf Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Port autotest away from QRegExpLars Knoll2020-03-311-8/+9
| | | | | Change-Id: I630fb93eca3f087f20d44a76058f7d6fe988ba5f Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Port test to QRegularExpressionLars Knoll2020-03-311-2/+2
| | | | | Change-Id: I4026fa2fa5da34974cdc37353e7ea5a8e8806033 Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
* Remove QRegExp usage from QSslCertificate and QSslSocketLars Knoll2020-03-311-84/+0
| | | | | | Change-Id: I81abe1ab2173af922fa4b5fad58d25fa602c523b Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Remove Qt5 BIC test dataLars Knoll2020-03-31154-1336792/+0
| | | | | | | Qt6 is binary incompatible with Qt5, no need to keep the old data. Change-Id: I7fc4592a79ed0a8b79569926a31ef6deb5d3f983 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Move undo framework out of Qt WidgetsMitch Curtis2020-03-3014-36/+34
| | | | | | | | | | | | | | | - Moves QUndo* classes (except QUndoView) from src/widgets/utils to src/gui/utils - Moves related auto tests from widgets to gui - Replaces QUndoAction with lambdas that do text prefixing [ChangeLog][Undo Framework] QUndo* classes (except QUndoView) were moved from Qt Widgets to Qt GUI. Done-with: volker.hilsheimer@qt.io Fixes: QTBUG-40040 Change-Id: I3bd8d4d32c64f8dee548f62159a1df2126da89d8 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Make MatchRegExp an alias to MatchRegularExpressionLars Knoll2020-03-301-2/+2
| | | | | | | All matching happens using QRegularExpression now. Change-Id: I10bfcefbf4d9c79d235242e3e05116cdf7af02d1 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* QtConcurrent: add fluent interface to configure a task before runVitaly Fanaskov2020-03-295-1/+173
| | | | | | | | Task-number: QTBUG-82950 Change-Id: I449da938b6b501a7646b3425edde5c880d6ca87e Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Mikhail Svetkin <mikhail.svetkin@gmail.com>
* Merge QGuiShortcut and QShortcut again in QtGuiVolker Hilsheimer2020-03-295-12/+24
| | | | | | | | | | | | | | | | QShortcut has only one widget specific feature, which is whatsThis; that is just a QString, so the setters and getters can just as well be in QtGui. The widgets specific implementation of shortcut matching and of showing the whatsThis balloon stays in QtWidgets, in the private implementation. Using virtual functions in the private we can override the empty default in QtGui, and by adding a virtual factory function in QGuiApplication, the correct private is instantiated depending on the kind of application running. Change-Id: I09ae4a5482f9fb70940c5e2bfe76d3d7fd710afc Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Remove QGuiAction again and split QAction implementation up insteadVolker Hilsheimer2020-03-2922-100/+126
| | | | | | | | | | | | | | | | | | | | | | Duplicating the number of classes is a high price to pay to be able to have some QAction functionality behave differently, or be only available in widgets applications. Instead, declare the entire API in QtGui in QAction* classes, and delegate the implementation of QtWidgets specific functionality to the private. The creation of the private is then delegated to the Q(Gui)ApplicationPrivate instance through a virtual factory function. Change some public APIs that are primarily useful for specialized tools such as Designer to operate on QObject* rather than QWidget*. APIs that depend on QtWidgets types have been turned into inline template functions, so that they are instantiated only at the caller side, where we can expect the respective types to be fully defined. This way, we only need to forward declare a few classes in the header, and don't need to generate any additional code for e.g. language bindings. Change-Id: Id0b27f9187652ec531a2e8b1b9837e82dc81625c Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QAbstractItemView::dataChanged(): optimize call to QWidget::update()Christian Ehrlicher2020-03-285-2/+343
| | | | | | | | | | | | | When topLeft and bottomRight are different in QAIV::dataChanged(), the current implementation simply calls QWidget::update() without checking if the affected cells are visible. This results in a big performance hit when cells are updated frequently. Now try to compute the exact update rect by iterating through the modified indexes. Fixes: QTBUG-58580 Change-Id: I97de567d494e40ed8cdb1ea1f5b3cf3a2f60455e Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
* Make QPropertyBindingPrivate accessible to QtQmlSimon Hausmann2020-03-271-5/+3
| | | | | | | | | | | | | | | | | | QtQml needs the private just for one detail which nobody else should need it for: Tracking additional dependencies and marking the binding as dirty. Exporting the private requires hiding some variables and providing accessors, to compile with MSVC - including the removal of QVarLengthArray usage. Upside: The binding structure shrinks by 8 bytes and the encapsulation makes it a little easier to change things without breaking declarative, ... in the unlikely event ;-) Also remove setDirty() from the public API as it's not needed by QtQml and using it is dangerous, because it means that there's a risk of somebody keeping a reference (count) to the untyped binding from within the binding closure, which introduces a memory leak. Change-Id: I43bd56f4bdf218efb54fa23e2d627ad3acfafeb5 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Add QProperty tests to the cmake buildSimon Hausmann2020-03-272-0/+15
| | | | | Change-Id: I043ea1db316618871b387213ee379075d756d0b5 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Speed up QSortFilterProxyModel filteringChristian Ehrlicher2020-03-272-0/+102
| | | | | | | | | | Speed up the QSortFilterProxyModel filtering by only updating the source_to_proxy entries which are really changed - When proxy intervals are added or removed, it is not needed to update the proxy_to_source indexes which were not touched. Change-Id: I35459ff1b04f4610ec74f4b01d58a71832a9ae22 Reviewed-by: David Faure <david.faure@kdab.com>
* QMetaType::fromType: support classes with inaccessible dtorsFabian Kosmale2020-03-251-0/+16
| | | | | Change-Id: I60a1b2496d48651a8166173b420da37f59d7a395 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Get rid of QRegExp usage in rccLars Knoll2020-03-252-1/+67
| | | | | | | | As a drive-by, enable testing of rcc in the cmake build. Change-Id: I4150ff3ffe7404bab0cbc72f80b23b47a60cf33d Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
* Remove qt6_use_modulesKai Koehne2020-03-254-107/+0
| | | | | | | | | | | qt5_use_modules has been deprecated in 2013 (commit d9ea4bb144153) and removed for the first time in 2018, but then brought back - see discussion in https://lists.qt-project.org/pipermail/development/2018-June/032837.html . Anyhow, I think we can finally put it to a rest in Qt 6. Change-Id: I770f7e93406ad68535d1d90e4a3bacfb920e2d5a Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Restructure testlib selftest projectTor Arne Vestbø2020-03-247-143/+84
| | | | | | | | | The use of a single subdirectory only for the test binary, but not the actual source file, just made things harder to discover when looking for the test code. Now all subdirectories are actual sub-tests. Change-Id: Ia3e308ba8d231cc8ead1491b10a34801f76669b0 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Q{File,FileInfo,Dir}: add std::filesystem::path overloadsMårten Nordheim2020-03-247-0/+193
| | | | | | | | | | | | | | | | | | | | Add some overloads where (I thought) it makes sense for QDir and QFile to accept std::filesystem::path objects. Currently my thinking is to not add overloads for static functions where std::filesystem can already do the same job, e.g. create directory or file. Template and enable_if is needed due to both QString and std::filesystem::path being able to be constructed from string literals. The common shared code is currently in QFile because QDir had an implicit include of QFile, made explicit in this patch, and QFileInfo has an include to QFile as well. The QT_HAS_STD_FILESYSTEM macro is visible in user-code which I currently take advantage of in the tests, and users could too. Change-Id: I8d05d3c34c6c17e20972a6a2053862b8891d6c3c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Expect failure in QLabel test for certain conditionEskil Abrahamsen Blomfeldt2020-03-241-1/+11
| | | | | | | | | | | | | | | While investigating QTBUG-80554, it was discovered that a small mismatch in how heights are calculated in QTextDocument and QPainter will cause the tst_QLabel::sizeHint() autotest to fail if ceil(ascent+descent+leading) is higher than ceil(ascent+descent). This is currently blocking the fix for QTBUG-80554, because this exposes the bug by detecting the correct leading for a font where we previously ignored it. Task-number: QTBUG-82954 Change-Id: I99323c8e1a0fa281aa8d754ba71432468fcb2d4c Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* tst_sqlquery: Skip datetime test if no database drivers are availableLeander Beernaert2020-03-231-0/+3
| | | | | Change-Id: I4a4619f2edc3c82fc37605d54e9bedc36abd7388 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Change QTaggedPointer API to be more similar to other smart pointers in QtSimon Hausmann2020-03-191-8/+8
| | | | | | | * Rename pointer() to data() Change-Id: I8ef3e552d45c9990fee4b7efa98e2d878ed2cf98 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* CMake: Regenerate selftest with latest fixesLeander Beernaert2020-03-1912-9/+62
| | | | | Change-Id: I7453c2439a62331cdc2d7ffaeafb05cd831191c6 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Enable generic property bindings to QProperty<T>Simon Hausmann2020-03-191-0/+50
| | | | | | | | | | A generic binding allows implementing the binding function in a way that enables the QML engine to run binding scripts and convert the V4::Value into a QVariant and then assign the value to the property with the help of QMetaType::construct. Change-Id: Id4807be92eee7e3501908e6c5e4c861cfcb7772a Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* CMake: Regenerate and fix qtcpsocket testLeander Beernaert2020-03-182-1/+4
| | | | | Change-Id: I1293ee604bd0a61abd7f6a5fa305defc4d6c9ae9 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Enable testlib selftestsLeander Beernaert2020-03-1861-342/+322
| | | | | | | | | | | This patch adds the equivalent of testlib's selfcover.pri and is enabled for both testlib and the respective selftests test. This patch also fixes the selftests so that they can run without FEATURE_testlib_selfcover enabled. Change-Id: I15913de2d572ac79804ce3e652cee66de74318f8 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Disable two graphicsview testsLeander Beernaert2020-03-181-2/+11
| | | | | | | | Disable tst_qgraphicsproxywidget and tst_qgraphicswiddget as they are never run in coin with the current .pro file. Change-Id: I562fa70e03f7c5e547c52507e3e41f4762c0382a Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Merge "Merge remote-tracking branch 'origin/5.15' into dev"Qt Forward Merge Bot2020-03-183-1/+5
|\
| * Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-03-183-1/+5
| |\ | | | | | | | | | Change-Id: Ia79c2457f20f3428ef1b4358c1094e8dc1bbc33e
| | * QLocale: Fix test on MinGW 8.1.0 32 bitCristian Adam2020-03-171-0/+1
| | | | | | | | | | | | | | | | | | | | | The call of _control87 would crash because of the previous test. Change-Id: I254efe9c2e9892a473a02663e5ff7016791d5d6d Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
| | * Log the possible socket error code for the flaky testSona Kurazyan2020-03-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | tst_QSocks5SocketEngine::simpleConnectToIMAP() is flaky. It may be useful to log the socket error, to provide more info in case the test fails again. Change-Id: Ia5518dce13fd9da1fa5bfb3d5cf3a52a908b8698 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
| | * QNetworkReply: stabilize sslSessionSharing testMårten Nordheim2020-03-161-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sometimes this test would fail due to the session not actually being reused. The cause of this was that the requests were sometimes being completed 1-by-1, enabling the individual requests to re-use the already-connected socket completely because it stayed connected. Setting the Connection-header to close lets us be sure that the socket cannot be re-used when the request is finished. Fixes: QTBUG-82846 Change-Id: I5da8baa50a3a45fb60f1e1613e500e3e9c034fb0 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | | Add support for exposing public QProperty members in the meta-object systemSimon Hausmann2020-03-182-3/+120
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At the moment this makes the type as well as the setter/getter available through the meta-call as well as the ability to register observers and bindings. Only QProperty members that are annotated with Q_PROPERTY(type name) are made public through the meta-object. Change-Id: I16b98fd318122c722b85ce61e39975284e0c2404 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | | Add a way to filter only rows or columns in QSortFilterProxyModelGiulio Camuffo2020-03-182-0/+82
|/ / | | | | | | | | | | | | | | | | | | | | | | | | If we want to filter away a column without changing the filtering for the rows calling invalidateFilter() is wasteful because it will call filterAcceptsRow() for all rows even though that is not needed. This commit add two functions, invalidateRowsFilter() and invalidateColumnsFilter() that work the same way as invalidateFilter() except that they will invoke respectively only filterAcceptsRow() and filterAcceptsColumn(). Change-Id: Ib4351cf08c229bd97bbbfee6da92397dca579a84 Reviewed-by: David Faure <david.faure@kdab.com>
* | Make it possible to use QTaggedPointer within classesSimon Hausmann2020-03-171-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | A common pattern in declarative is to use the unused bits in linked list next pointers for additional information storage. The "next" pointer is typically then a tagged pointer of the containing class, which is not fully defined yet. Therefore alignof() can't be used at tagged pointer instantiation time. This patch delays the calls to alignment, etc. until the corresponding functions are used, as in principle the tagged pointer is just a quintptr and no additional information should be needed until operating on it. Change-Id: I87a3578ee921d471e1b60ed5903b549ef0610b97 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | Introduce helper class QTaggedPointerTor Arne Vestbø2020-03-177-0/+464
| | | | | | | | | | | | | | | | | | Useful for attaching small bits of information in the alignment bits of a naked pointer. For use in the new property system as well as in qtdeclarative (where currently a similar class exists as private API). Change-Id: Idf9b93e714e15129f302e16425dbeda94bcd207b Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Remove QRegExpValidatorLars Knoll2020-03-176-112/+0
| | | | | | | | | | | | | | As QRegExp will be moved to a compat library in Qt 6. Change-Id: I181aec45bd798f49d2c50a0e7fb64782e004b854 Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
* | Remove the old harfbuzz library and integration codeLars Knoll2020-03-171-2/+0
| | | | | | | | | | | | | | | | | | It's not used anymore. harfbuzz-ng is a requirement in Qt 6 if you want any open type shaping. Fixes: QTBUG-82881 Change-Id: If7100aebdcfa078a999608bb8f07a2ef3a79d282 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* | Merge "Merge remote-tracking branch 'origin/5.15' into dev"Simon Hausmann2020-03-1618-1703/+2950
|\ \
| * | Merge remote-tracking branch 'origin/5.15' into devSimon Hausmann2020-03-1618-1703/+2950
| |\| | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/kernel/qmetatype.cpp Change-Id: I88eb0d3e9c9a38abf7241a51e370c655ae74e38a
| | * QMySQL: return QVariant::ByteArray for POINT columnChristian Ehrlicher2020-03-151-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | qDecodeMYSQLType() did not handle FIELD_TYPE_GEOMETRY and therefore the type for a POINT column was incorrectly treated as QVariant::String. Even the type can not (yet) be properly decoded to a QPoint, treating it as QVariant::ByteArray is the better option here. Fixes: QTBUG-72140 Change-Id: I12e75b326ae3acb75cb36f2e650464528bd43c0e Reviewed-by: Andy Shaw <andy.shaw@qt.io>