summaryrefslogtreecommitdiffstats
path: root/tests/auto/gui/image
Commit message (Collapse)AuthorAgeFilesLines
* Fix alpha handling of QImage::setPixelAllan Sandfeld Jensen2021-03-221-11/+61
| | | | | | | | | | | It was treated differently depending on format, made it consistently behave the same for all formats (following the behavior of the primary formats). Change-Id: Ie24e19957d076fdf3ebd333074e26ede187489eb Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> (cherry picked from commit c32cd44d34910cfd42e32537578e4a573138a282) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* And fix handling and test of QImage::fill(uint) as wellAllan Sandfeld Jensen2021-02-261-2/+8
| | | | | | | | | | Only RGB444 and RGB666 were treated slighlty different from the rest, but the test had a few additional mistakes. Change-Id: I4728b4036affedfffce8bca5c1e7be3869344fbe Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> (cherry picked from commit c2bec047e281d949015ecd27daf2ba2d51b21526) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix QImage::fill with semi-transparent QColorAllan Sandfeld Jensen2021-02-121-7/+31
| | | | | | | | | | A few formats were not treating the input QColor correctly. Fixed and added more exhaustive test. Change-Id: I872aeeb45e518f9a34b4ac35642264821f9927f2 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> (cherry picked from commit 95712c5e5438e4eb5cd205ab4659febf3192137a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Port QMovie to the new property systemSona Kurazyan2021-01-271-0/+33
| | | | | | | | Task-number: QTBUG-85520 Task-number: QTBUG-85521 Change-Id: Ib936020260cf01a5221b63fb1eb0ccb23f5553a3 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QIcon: Use the @nx pixmaps in the paint methodBastien Bouclet2021-01-261-0/+48
| | | | | | | | | | | Make use of the device pixel ratio in the QIcon paint method so the @nx hi-dpi pixmaps are selected when appropriate when painting to a QPainter. Pick-to: 6.0 Fixes: QTBUG-90042 Change-Id: I53995a2285ef879e3c4fddb9f8da702e256a260f Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Remove .prev_CMakeLists.txt filesJoerg Bornemann2021-01-121-19/+0
| | | | | | | | | | Those serve no purpose anymore, now that the .pro files are gone. Task-number: QTBUG-88742 Change-Id: I39943327b8c9871785b58e9973e4e7602371793e Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Remove the qmake project filesJoerg Bornemann2021-01-0712-126/+0
| | | | | | | | | | | | | | | | Remove the qmake project files for most of Qt. Leave the qmake project files for examples, because we still test those in the CI to ensure qmake does not regress. Also leave the qmake project files for utils and other minor parts that lack CMake project files. Task-number: QTBUG-88742 Change-Id: I6cdf059e6204816f617f9624f3ea9822703f73cc Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Replace QtTest headers with QTestDavid Skoland2020-12-2211-26/+29
| | | | | | | | | | | 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>
* tst_qimagereader.cpp: Fix MSVC int conversions warningsFriedemann Kleint2020-12-211-3/+3
| | | | | Change-Id: I1b002ffde60dea9c54a8c41985ed295c05c45858 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Tests: Fix building with qmake on WindowsFriedemann Kleint2020-12-172-2/+2
| | | | | | | | Apparently some library definitions went overboard, link them directly. Pick-to: 6.0 Change-Id: I009737f7e3edff5619241b700a627dc4e25e6018 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Regenerate projects using pro2cmake one last timeAlexandru Croitor2020-12-101-0/+19
| | | | | | | | | And fix up some wrong qmake project files Pick-to: 6.0 Change-Id: I66cb82aeb9c1419a74df1a650fa78a511ade7443 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Fix QImage::setPixelColor on RGBA64_PremultipliedAllan Sandfeld Jensen2020-12-041-0/+8
| | | | | | | | QColors were not premultiplied before being set. Pick-to: 6.0 5.15 5.12 Change-Id: Id3765b6932a72374ddfd788fae4bb628a4edf0b7 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix compiler warning about discarded return valueVolker Hilsheimer2020-11-231-1/+1
| | | | | | | | | Not testing the result of the copying, just verifying that it doesn't assert. Pick-to: 6.0 Change-Id: Ib51129134b74c17eada7e3819ccfff10bb9affbf Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Allow painting above INT16_MAX on 64-bit architecturesAllan Sandfeld Jensen2020-11-091-0/+64
| | | | | | | | | | | The logic in qgrayraster was ready for it except for an intermediate format. qrasterizer.cpp and qcosmeticstroker.cpp uses a dot-16 fixed point format, and had to be changed to handle higher coordinates on 64-bit architectures. Fixes: QTBUG-84428 Change-Id: I85ab7a04e38bd0dbcefa9f16c16ccc84785a33cf Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Teach QPixmapIconEngine how to handle @Nx pixmapsMorten Johan Sørvig2020-11-081-0/+45
| | | | | | | | | | | | | | | | | | | | Bring QPixmapIconEngine on par with QIconLoaderEngine when it comes to @Nx pixmap handling: Make the scale factor a test parameter during icon lookup. This allows storing e.g 16x16@1, 16x16@2, 16x16@3 versions of a pixmap in the icon, and then having QIcon select the correct one based on the target devicePixelRatio. Extend the qiconhighdpi test to also cover QPixmapIconEngine, via the addPixmap() API. The corner cases of pixmap lookup can be much complicated. QIconLoaderEngine and QPixmapIconEngine should ideally have identical behavior in order to avoid surprises. Change-Id: I17552cc61755bff9553c4a462e3983ac6759c13b Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Android: blacklist a list of failing tests for androidAssam Boudjelthia2020-11-042-2/+10
| | | | | | | | | | | | | | | | We want to re-enable Android tests in QTQAINFRA-3867. However, many tests are failing already preventing that from happening. QTBUG-87025 is currently keeping track (links) to all of those failing tests. The current proposal is to hide those failing tests, and enable Android test running in COIN for other tests. After, that try to fix them one by one, and at the same time we can make sure no more failing tests go unnoticed. Task-number: QTBUG-87025 Change-Id: Ic1fe9fdd167cbcfd99efce9a09c69c344a36bbe4 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Test QImage move semanticsAllan Sandfeld Jensen2020-10-161-2/+33
| | | | | | | Tests the move semantics of QImage in Qt6. Change-Id: Ia4d95f0b88ca7dde0daf85a0f53049b42b5be1a5 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Add logging categories to image handlersAllan Sandfeld Jensen2020-09-301-4/+4
| | | | | Change-Id: Ia0c47826d08b3f641c17d8a585f62d008a8b095b Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Preserve formats in QImage::scaled()Allan Sandfeld Jensen2020-09-261-0/+30
| | | | | | | | | Do not always use the smoothScaled routine, the normal routines are also optimized, and do not convert to alpha formats when not necessary. Task-number: QTBUG-49719 Change-Id: I6ee9b620cc259472c419e7363357f41ce29b594a Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Give QPixmap a move constructorVolker Hilsheimer2020-09-231-0/+15
| | | | | | | | | | | | It already has a move-assignment operator, and implements swapping. This requires a specialization of the QExplicitlySharedDataPointer destructor to be forward declared, and an implementation that is identical to the default version. Otherwise we would need QPlatformPixmap to be fully defined in the public QPixmap header. Change-Id: I2651bbc29a7083a93e3b3ad671d3aeea659b7d5a Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* CMake: Regenerate projects to use new qt_internal_ APIAlexandru Croitor2020-09-2311-29/+29
| | | | | | | | | | | Modify special case locations to use the new API as well. Clean up some stale .prev files that are not needed anymore. Clean up some project files that are not used anymore. Task-number: QTBUG-86815 Change-Id: I9947da921f98686023c6bb053dfcc101851276b5 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Fix deprecation warnings in testsVolker Hilsheimer2020-09-171-1/+1
| | | | | | | | Adjust to changes to QIcon::pixmap, QMetaType::type, and QAbstractItemView::itemDelegate. Change-Id: I9eb0331ef899131afc86c33f27feeee76331ffc8 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Remove most compiler warnings about missing overridesLars Knoll2020-09-114-10/+11
| | | | | | | | | | | | Remove around 1000 compiler warnings about missing overrides in our auto tests. This significantly reduce the compiler warning noise in our auto tests, so that one can actually better see the real problems inbetween. Change-Id: Id0c04dba43fcaf55d8cd2b5c6697358857c31bf9 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Create consistent sets of QImage methodsAllan Sandfeld Jensen2020-09-091-7/+7
| | | | | | | Adds consistently named inplace and imperative methods. Change-Id: I8739c1c4585d2ba4aa181bb9a681255d76c120d7 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Port tst_qiconhighdpi to the new QIcon::pixmap() APIMorten Johan Sørvig2020-08-291-31/+20
| | | | | | | | | | | | Port the high-dpi icon test to use the new pixmap() API which takes the target devicePixelRatio as an argument. This means we can run the fromTheme test at dpr = {1,2,3}, instead of at the current global devicePixelRatio only. Task-number: QTBUG-85885 Change-Id: Iec7b21e04ed760e48964307d2048eaec1976ffe2 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* QIcon: Add pixmap() overload which take devicePixelRatioMorten Johan Sørvig2020-08-271-0/+14
| | | | | | | | | | | | | Add new QIcon::pixmap() overload: QPixmap pixmap(const QSize &size, qreal devicePixelRatio, ...) This function replaces the existing pixmap() function which take a QWindow pointer, and should be more convenient in use. Task-number: QTBUG-85885 Change-Id: Ie4ca96a266d9278864678dc61bdfc2836cabdb93 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Replace Qt CONSTEXPR defines with constexprAllan Sandfeld Jensen2020-08-141-1/+1
| | | | | | | | Both normal and relaxed constexpr are required by our new minimum of C++17. Change-Id: Ic028b88a2e7a6cb7d5925f3133b9d54859a81744 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Establish baseline for QIcon test on dpr > 1Morten Johan Sørvig2020-08-056-26/+71
| | | | | | | | | | | | | | | | | | | | | | After enabling Qt::AA_UseHighDpiPixmaps, QIcon::pixmap() now returns pixmaps larger than the requested size on devicePixelRatio > 1 screens. Adapt tests to account for this changed behavior. Skip tests where it’s unclear what the the expected behavior is, or where the test logic does not apply to dpr > 1. This gives a clearer indication of where we are (39 passed, 0 failed, 9 skipped), and enables using the qicon test to catch regressions also when running at dpr > 1. Remove the "lowdpi" testcase flags from the qmake and cmake project files. Change-Id: Ia7ce722ae356fc496a91b54e9f5d590d13b9df62 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* tst_qicon: Enable lowdpi test using qt_add_test argumentTor Arne Vestbø2020-07-261-1/+1
| | | | | Change-Id: I98f850c668a45d127abb1c2af5915f2cbcbd1cdb Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QtGui: Add Windows conversion functions for to QImageFriedemann Kleint2020-07-241-7/+3
| | | | | | | | | Add conversions from/to HBITMAP, HICON to QImage. Split the pixmap conversion functions apart to use them. Task-number: QTBUG-81876 Change-Id: Ic0c41a402a1f6e9bec572fc4d691357bd48e6423 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Mark QIcon test as not supporting high-DPI pixmapsVolker Hilsheimer2020-07-242-1/+2
| | | | | | | | | As of 951d49075066cf8f66906c803c32cc2c52fd8e18, high-DPI support for pixmaps is enabled by default, which makes this test fail when running on a local system with a high-DPI display. Change-Id: I3fe4674d19a57bf82aa32b01d470c714092f7e62 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Fix buffer overflow in XBM parserAllan Sandfeld Jensen2020-07-241-0/+38
| | | | | | | | | | | | | Avoid parsing over the buffer limit, or interpreting non-hex as hex. This still leaves parsing of lines longer than 300 chars unreliable Change-Id: I1c57a7e530c4380f6f9040b2ec729ccd7dc7a5fb Pick-to: 5.15 5.12 Reviewed-by: Robert Loehning <robert.loehning@qt.io> Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Fix buffer overflowRobert Loehning2020-07-102-0/+9
| | | | | | | Fixes: oss-fuzz-23988 Pick-to: 5.15 5.12 Change-Id: I4efdbfc3c0a96917c0c8224642896088ade99f35 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* CMake: Regenerate tests with new qt_ prefixed APIsAlexandru Croitor2020-07-0911-29/+29
| | | | | | | | Use pro2cmake with '--api-version 2' to force regenerate projects to use the new prefixed qt_foo APIs. Change-Id: I055c4837860319e93aaa6b09d646dda4fc2a4069 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Use QList instead of QVector in gui testsJarek Kobus2020-06-252-9/+9
| | | | | | Task-number: QTBUG-84469 Change-Id: Ia86f39597de418dde6cd9ae3170ef919bd27416a Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Remove QByteArray's methods taking QString and their usesSona Kurazyan2020-06-252-3/+3
| | | | | | | | | | [ChangeLog][QtCore][QByteArray] Remove method overloads taking QString as argument, all of which were equivalent to passing the toUtf8() of the string instead. Change-Id: I9251733a9b3711153b2faddbbc907672a7cba190 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Phase 2 of removing QDesktopWidgetVolker Hilsheimer2020-06-081-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | Remove QDestopWidget public header, simplify the implementation that maintains a Qt::Desktop type QWidget for each QScreen, and turn QWidget's initial target screen into a QScreen pointer. QApplication::desktop() now takes an optional QScreen pointer, and returns a QWidget pointer, so that applications and widgets can get access to the root widget for a specific screen without having to resort to private APIs. QDesktopWidgetPrivate implementations to look up a screen for an index, widget, or point are now all inline functions that thinly wrap QGuiApplication::screens/screenAt calls. We should consider adding those as convenience APIs to QScreen instead. Note that QWidget::screen is assumed to return a valid pointer; there is code that handles the case that it returns nullptr (but also code that trusts that it never is nullptr), so this needs to be defined, verified with tests, and asserted. We can then simplify the code further. Change-Id: Ifc89be65a0dce265b6729feaf54121c35137cb94 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Remove winrtOliver Wolff2020-06-066-12/+12
| | | | | | | | | Macros and the await helper function from qfunctions_winrt(_p).h are needed in other Qt modules which use UWP APIs on desktop windows. Task-number: QTBUG-84434 Change-Id: Ice09c11436ad151c17bdccd2c7defadd08c13925 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Remove deprecated members from QtGui/image classesVolker Hilsheimer2020-04-293-65/+0
| | | | | | | | Cleaning up those that are trivial to remove because they have direct replacements. Change-Id: I4f5c25884a01474fa2db8b369f0d883bd21edd5b Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Merge remote-tracking branch 'origin/5.15' into devSimon Hausmann2020-03-161-5/+126
|\ | | | | | | | | | | | | Conflicts: src/corelib/kernel/qmetatype.cpp Change-Id: I88eb0d3e9c9a38abf7241a51e370c655ae74e38a
| * Add test for conversion of "large" imagesv5.15.0-beta2Allan Sandfeld Jensen2020-03-111-5/+126
| | | | | | | | | | | | | | | | | | | | | | | | This exercises the multi-threaded codepath and also tests precision a bit higher. To avoid quadratic blowup, only a short set of formats are tested in the larger conversion tests. Task-number: QTBUG-82818 Change-Id: I411deb97aea61a69fbdb24cbaf6559dd9436b703 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* | Merge remote-tracking branch 'origin/5.15' into devLars Knoll2020-02-281-1/+1
|\| | | | | | | Change-Id: I469b0501cc65fc5ce4d797a69ae89405cc69c7f8
| * QAbstractSocket: deprecate 'error' signal, use 'errorOccurred' insteadAlexander Akulich2020-02-271-1/+1
| | | | | | | | | | | | | | [ChangeLog][Deprecation Notice] QAbstractSocket::error() (the signal) is deprecated; superseded by errorOccurred() Change-Id: I11e9c774d7c6096d1e9b37c451cf0b99188b6aad Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-02-261-16/+22
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/network/bearermonitor/CMakeLists.txt examples/network/CMakeLists.txt src/corelib/tools/qlinkedlist.h src/sql/kernel/qsqldriver_p.h src/sql/kernel/qsqlresult_p.h src/widgets/kernel/qwidget.cpp src/widgets/kernel/qwidget_p.h tests/auto/network/socket/platformsocketengine/tst_platformsocketengine.cpp tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp tests/auto/tools/moc/allmocs_baseline_in.json Change-Id: I21a3c34570ae79ea9d30107fae71759d7eac17d9
| * Test QImageReader::setScaledClipRect() more realisticallyShawn Rutledge2020-02-191-16/+22
| | | | | | | | | | | | | | | | | | Ensure that each image plugin really clips within the scaled coordinate system, as documented. Always clipping from 0,0 wasn't interesting. Task-number: QTBUG-81044 Change-Id: Ic06fe52f92f719e1ff9c0348f667215e53b60fb0 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* | Make bytes-per-line safe for int overflowAllan Sandfeld Jensen2020-02-201-2/+2
| | | | | | | | | | | | | | | | Goes through the Qt code and make sure bytes-per-line calculations are safe when they are too big for 32bit integers. Change-Id: I88b2d74b3da82e91407d316aa932a4a37587c0cf Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Regenerate projects one last time before mergewip/cmakeAlexandru Croitor2020-02-124-13/+8
| | | | | | | | | | | | Change-Id: Ia24cf56b79ca6dacd370a7e397024e9b663e0167 Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Merge remote-tracking branch 'origin/dev' into wip/cmakeAlexandru Croitor2020-01-292-4/+3
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/Qt5CoreConfigExtras.cmake.in src/corelib/Qt5CoreMacros.cmake src/dbus/Qt5DBusConfigExtras.cmake.in src/widgets/Qt5WidgetsConfigExtras.cmake.in Change-Id: Ib782f3b177c38b2cce83beebe15be9c0baa578f7
| * | Merge remote-tracking branch 'origin/5.15' into devSimon Hausmann2020-01-282-4/+3
| |\| | | | | | | | | | Change-Id: Ia5727ce68001bcaab467f5fae3a4933d1217015f
| | * Deprecate all methods that use QMatrixJarek Kobus2020-01-282-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't use QMatrix in implementation classes anymore. Task-number: QTBUG-46653 Fixes: QTBUG-81627 Change-Id: I4806c1302e42645dc6a608062c8d9c336ae8629b Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>