summaryrefslogtreecommitdiffstats
path: root/tests/auto/gui/painting/qcolor
Commit message (Collapse)AuthorAgeFilesLines
* Remove extra semi-colonsTasuku Suzuki2024-02-061-1/+1
| | | | | Change-Id: I92fddb36cd136fd1bd627955f15d0559b9942d7e Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Change license for tests filesLucie Gérard2024-02-041-1/+1
| | | | | | | | | | | | According to QUIP-18 [1], all tests file should be LicenseRef-Qt-Commercial OR GPL-3.0-only [1]: https://contribute.qt-project.org/quips/18 Pick-to: 6.7 Task-number: QTBUG-121787 Change-Id: I9657df5d660820e56c96d511ea49d321c54682e8 Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
* CMake: Make gui tests standalone projectsAlexandru Croitor2023-07-051-0/+6
| | | | | | | | | | | | | | | | | Add the boilerplate standalone test prelude to each test, so that they can be opened with an IDE without the qt-cmake-standalone-test script, but directly with qt-cmake or cmake. Boilerplate was added using the following scripts: https://git.qt.io/alcroito/cmake_refactor Manual adjustments were made where the code was inserted in the wrong location. Task-number: QTBUG-93020 Change-Id: I2ef59684cf297a0222a136ce7b5630037294d000 Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* tests: Remove remains of qmake conversion from CMakeLists.txt filesFriedemann Kleint2023-02-171-2/+0
| | | | | | | Pick-to: 6.5 Change-Id: I8d106554bb86ac1ec9bb7a4083de4c376bcbab1d Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Change the license of all CMakeLists.txt and *.cmake files to BSDLucie Gérard2022-08-231-1/+1
| | | | | | | Task-number: QTBUG-105718 Change-Id: I5d3ef70a31235868b9be6cb479b7621bf2a8ba39 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Add license headers to cmake filesLucie Gérard2022-08-031-0/+3
| | | | | | | | | | | | CMakeLists.txt and .cmake files of significant size (more than 2 lines according to our check in tst_license.pl) now have the copyright and license header. Existing copyright statements remain intact Task-number: QTBUG-88621 Change-Id: I3b98cdc55ead806ec81ce09af9271f9b95af97fa Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* CMake: Don't use PUBLIC_LIBRARIES for tests and test helpersAlexandru Croitor2022-07-281-1/+1
| | | | | Change-Id: I9b7404e1d3a78fe0726ec0f5ce1461f6c209e90d Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-161-27/+2
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* QColor: deprecate isValidColor, setNamedColor, string-ish ctorsMarc Mutz2022-03-151-0/+23
| | | | | | | | | | | | [ChangeLog][QtGui][QColor] The constructors from string-ish type, as well as the setNamedColor() and isValidColor() functions, have been deprecated effective Qt 6.6 in favor of fromString() and isValidColorName(), resp. Fixes: QTBUG-101389 Change-Id: I002646bd48c1e4340dc6842fd136fc9f35bb9b61 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Long live QColor::fromString()!Marc Mutz2022-03-081-21/+31
| | | | | | | | | | | | | | | | | | | | | | | | | It is customary for Qt types that can be constructed from string-ish to provide a fromString() named constructor. QColor didn't, relying instead on a set of overloaded implicit and explicit constructors. Add the named constructor, with the intent to deprecate the string-ish QColor constructors after a grace period. To prevent new users from using known-to-become-deprecated API, mark the old functions as \obsolete. Also rename isValidColor() to isValidColorName(). The only reason why these are lumped together in single commit is so that their docs can refer to each other instead of having to temporarily refer to obsolete API. [ChangeLog][QtGui][QColor] Added fromString() and isValidColorName(), both taking QAnyStringView. Task-number: QTBUG-101389 Change-Id: I2857c728257ad2f14c7c968b45547bdf07c44b63 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* QColorTrcLut: hold in shared_ptrMarc Mutz2021-07-121-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | ... instead of raw pointers or QSharedPointer. Raw pointers are, of course, a no-no in modern code. In particular, when the result is then held in shared_ptr or QSharedPointer, make_shared or QSharedPointer::create() should be used to reduce number of memory allocations. Since this is private API, we're free to use std::shared_ptr, which does only half the atomic operations on copies, compared to QSharedPointer, so is more efficient. For either make_shared or QSharedPointer::create(), we need to work around the private ctor, which we do by inheriting a member-function local class from QColorTrcLut and make_shared'ing that. As a member-function-local class, it has access to the otherwise private parts of QColorTrcLut, including its default constructor. As a public subclass, shared_ptr has no problem performing the derived-to-base pointer adjustment in the return statement. This way, we can use make_shared even though our target's class' ctor is private. Change-Id: Icb11249b54cd5e544e692f6a0bf1f9dda1710454 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Fix warnings about lossy double/float conversion in testsVolker Hilsheimer2021-04-111-47/+47
| | | | | | | | | QVectorND, QQuaternion, and QColor all operate on floats rather than qreal or double, so explicit use float literals in the tests. Pick-to: 6.1 Change-Id: If12cc12ddd9cd8219f3d78bf24e1400921e26c2b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove the qmake project filesJoerg Bornemann2021-01-071-4/+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-221-1/+2
| | | | | | | | | | | 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>
* Get rid of Q_COMPILER_CONSTEXPR checksAllan Sandfeld Jensen2020-11-171-4/+0
| | | | | | | Is required now. Change-Id: I62e95929d1649ea1390392230b619bd56d2a0349 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* CMake: Regenerate projects to use new qt_internal_ APIAlexandru Croitor2020-09-231-1/+1
| | | | | | | | | | | 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>
* Replace qreal with float in QColorAllan Sandfeld Jensen2020-09-111-75/+75
| | | | | | | | There is no reason to use double precision for colors. We at most have 16 significant bits anyway. Change-Id: I8b402cd978675b8ba7248176976d934363212ff1 Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
* Check returns of hex2int in get_hex_rgbRobert Loehning2020-07-131-0/+3
| | | | | | | | | | Avoids undefined behavior when trying to shift negative values. Fixes: oss-fuzz-21860 Fixes: oss-fuzz-23968 Pick-to: 5.15 5.12 Change-Id: I879c97624e3f8ba9cf01e0a3a682379cd8c4a199 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Port Q_STATIC_ASSERT(_X) to static_assertGiuseppe D'Angelo2020-06-191-1/+1
| | | | | | | | | | | | | | | | | There is no reason for keep using our macro now that we have C++17. The macro itself is left in for the moment being, as well as its detection logic, because it's needed for C code (not everything supports C11 yet). A few more cleanups will arrive in the next few patches. Note that this is a mere search/replace; some places were using double braces to work around the presence of commas in a macro, no attempt has been done to fix those. tst_qglobal had just some minor changes to keep testing the macro. Change-Id: I1c1c397d9f3e63db3338842bf350c9069ea57639 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix ExtendedRgb and Rgb encoding comparisonsAllan Sandfeld Jensen2020-05-281-0/+20
| | | | | | | | ExtendedRgb should be treated as Rgb as it can be an automatic upgrade. Pick-to: 5.15 Change-Id: I2942a1067ed5cacb2f60f303f467887cb44c36dd Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Port qtbase/tests/auto/gui/painting to CMakeSona Kurazyan2020-04-271-0/+14
| | | | | | Task-number: QTBUG-78225 Change-Id: Idc1333b119939e65da8f47d8de5333a38701bcb4 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* QColor: unify behavior when passing invalid values to setFoo()Christian Ehrlicher2019-11-221-0/+37
| | | | | | | | | | | Calling QColor::setFoo() is currently inconsistent - some setter do invalidate the colors, some don't. Unify it by calling invalidate in every setter. Task-number: QTBUG-62452 Change-Id: Ia4f0bd16ea30e9659bc989ffc2b319892438b84b Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Merge remote-tracking branch 'origin/dev' into 5.14Liang Qi2019-08-271-0/+189
|\ | | | | | | | | | | | | | | | | | | | | Conflicts: src/widgets/kernel/qwidget.cpp src/widgets/kernel/qwidget_p.h src/widgets/kernel/qwidgetrepaintmanager.cpp src/widgets/kernel/qwidgetwindow.cpp tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp Change-Id: Ifae457d0427be8e2465e474b055722e11b3b1e5c
| * Long live QColorConstants!Marc Mutz2019-08-251-0/+189
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QColorConstant is a C++11 version of Qt::GlobalColor, except that instead of Qt::red being an enum, QColorConstants::red is an actual QColor instance, a bit like in the Qt 3 days. In addition, the SVG names that QColor understands are also available, with the same values. Technically, when building a QColor from a color name, QColor ignores casing and whitespaces; we stick to the SVG/CSS official color names (which are lowercase), and prefix them with Svg to clarify where they come from. For instance, note how SVG's gray is not Qt::gray. [ChangeLog][QtGui][[QColor] Added QColorConstants, a namespace containing constexpr QColor instances. Change-Id: Ic9fab26a9a537fcc43cc230da28f4c6314a32438 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | Remove dead code from Qt 4 timesTor Arne Vestbø2019-08-201-60/+0
|/ | | | | | | | | | The benefit of keeping this code around was to inspire or inform changes in the areas to take into account possibly missing features in Qt 5, but at this point that benefit is questionable. We can always use the history to learn about missing pieces if needed. Change-Id: I87a02dc451e9027be9b97554427bf8a1c6b2c025 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Tests: Fix some warnings about deprecated functions not under testFriedemann Kleint2019-05-271-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix warnings like: baselineserver/shared/baselineprotocol.cpp:295:72: warning: ‘int QImage::byteCount() const’ is deprecated: Use sizeInBytes [-Wdeprecated-declarations] tst_qnetworkreply.cpp:1560:17: warning: ‘static QList<QSslCertificate> QSslSocket::defaultCaCertificates()’ is deprecated [-Wdeprecated-declarations] tst_qnetworkreply.cpp:1560:39: warning: ‘static QList<QSslCertificate> QSslSocket::defaultCaCertificates()’ is deprecated [-Wdeprecated-declarations] tst_qnetworkreply.cpp:8153:60: warning: ‘T* QWeakPointer<T>::data() const [with T = const QNetworkSession]’ is deprecated: Use toStrongRef() instead, and data() on the returned QSharedPointer [-Wdeprecated-declarations]. ... st_qprinter.cpp:1318:74: warning: ‘QList<QPagedPaintDevice::PageSize> QPrinterInfo::supportedPaperSizes() const’ is deprecated [-Wdeprecated-declarations] tst_qprinter.cpp:1362:74: warning: ‘QList<QPagedPaintDevice::PageSize> QPrinterInfo::supportedPaperSizes() const’ is deprecated [-Wdeprecated-declarations] tst_largefile.cpp:492:85: warning: ‘bool qEqual(InputIterator1, InputIterator1, InputIterator2) [with InputIterator1 = char*; InputIterator2 = char*]’ is deprecated: Use std::equal [-Wdeprecated-declarations] tst_largefile.cpp:498:91: warning: ‘bool qEqual(InputIterator1, InputIterator1, InputIterator2) [with InputIterator1 = char*; InputIterator2 = char*]’ is deprecated: Use std::equal [-Wdeprecated-declarations] tst_qabstractitemmodel.cpp:312:25: warning: ‘void QAbstractItemModel::reset()’ is deprecated [-Wdeprecated-declarations] ... tst_qabstractitemmodel.cpp:1793:28: warning: ‘void QAbstractItemModel::setRoleNames(const QHash<int, QByteArray>&)’ is deprecated [-Wdeprecated-declarations] ... tst_qcolor.cpp:1425:33: warning: ‘QColor QColor::light(int) const’ is deprecated: Use QColor::lighter() instead [-Wdeprecated-declarations] tst_qcolor.cpp:1432:31: warning: ‘QColor QColor::dark(int) const’ is deprecated: Use QColor::darker() instead [-Wdeprecated-declarations] tst_qprinterinfo.cpp:303:61: warning: 'QList<QPagedPaintDevice::PageSize> QPrinterInfo::supportedPaperSizes() const' is deprecated [-Wdeprecated-declarations] tst_qprinterinfo.cpp:304:65: warning: 'QList<QPair<QString, QSizeF> > QPrinterInfo::supportedSizesWithNames() const' is deprecated [-Wdeprecated-declarations] tst_qtextdocumentfragment.cpp:947:52: warning: ‘QString QTextCharFormat::anchorName() const’ is deprecated: Use anchorNames() instead [-Wdeprecated-declarations] tst_qtextlayout.cpp:2261:61: warning: ‘void QTextLayout::setAdditionalFormats(const QList<QTextLayout::FormatRange>&)’ is deprecated: Use setFormats() [-Wdeprecated-declarations] tst_qtextlayout.cpp:2330:42: warning: ‘int QFontMetrics::width(const QString&, int) const’ is deprecated: Use QFontMetrics::horizontalAdvance [-Wdeprecated-declarations] tst_qitemselectionmodel.cpp:2214:37: warning: ‘QModelIndex QModelIndex::child(int, int) const’ is deprecated: Use QAbstractItemModel::index [-Wdeprecated-declarations] ... tst_qtextlist.cpp:317:68: warning: 'bool QTextList::isEmpty() const' is deprecated: Use count() instead [-Wdeprecated-declarations] tst_qpainter.cpp:373:32: warning: ‘void QPainter::setMatrixEnabled(bool)’ is deprecated: Use setWorldMatrixEnabled() instead [-Wdeprecated-declarations] tst_qpainter.cpp:374:40: warning: ‘bool QPainter::matrixEnabled() const’ is deprecated: Use worldMatrixEnabled() instead [-Wdeprecated-declarations] tst_qpainter.cpp:702:45: warning: ‘const QBrush& QPalette::background() const’ is deprecated: Use QPalette::window() instead [-Wdeprecated-declarations] tst_qpainter.cpp:1573:29: warning: ‘void QPainter::drawRoundRect(const QRect&, int, int)’ is deprecated: Use drawRoundedRect(..., Qt::RelativeSize) instead [-Wdeprecated-declarations] tst_qpdfwriter.cpp:76:38: warning: ‘virtual void QPdfWriter::setPageSize(QPagedPaintDevice::PageSize)’ is deprecated: Use setPageSize(QPageSize(id)) instead [-Wdeprecated-declarations] tst_qpdfwriter.cpp:81:41: warning: ‘virtual void QPdfWriter::setPageSizeMM(const QSizeF&)’ is deprecated: Use setPageSize(QPageSize(size, QPageSize::Millimeter)) instead [-Wdeprecated-declarations] tst_qpdfwriter.cpp:105:30: warning: ‘virtual void QPdfWriter::setMargins(const QPagedPaintDevice::Margins&)’ is deprecated: Use setPageMargins(QMarginsF(l, t, r, b), QPageLayout::Millimeter) instead [-Wdeprecated-declarations] tst_qpdfwriter.cpp:172:37: warning: ‘virtual void QPdfWriter::setPageSizeMM(const QSizeF&)’ is deprecated: Use setPageSize(QPageSize(size, QPageSize::Millimeter)) instead [-Wdeprecated-declarations] tst_qpdfwriter.cpp:258:38: warning: ‘virtual void QPdfWriter::setPageSize(QPagedPaintDevice::PageSize)’ is deprecated: Use setPageSize(QPageSize(id)) instead [-Wdeprecated-declarations] qsortfilterproxymodel_common/tst_qsortfilterproxymodel.cpp:3980:54: warning: ‘QModelIndex QModelIndex::child(int, int) const’ is deprecated: Use QAbstractItemModel::index [-Wdeprecated-declarations] tst_qlocale.cpp:434:26: warning: 'QString::null' is deprecated: use QString() [-Wdeprecated-declarations] ... Change-Id: I77c1a934b27119eedeb26a77c913686314a2a5c7 Reviewed-by: David Faure <david.faure@kdab.com>
* Add Extended RGB model to QColorAllan Sandfeld Jensen2019-04-121-83/+120
| | | | | | | Can be used to represent wide-gamut and HDR colors. Change-Id: I1cca442069ce2f2c070f723fe930fe1f2f5580ad Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-02-201-1/+1
|\ | | | | | | | | | | | | | | | | | | | | Conflicts: tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp Added tests/auto/testlib/selftests/expected_crashes_5.txt to work round the output of the crashes test (which exercises UB, see QTBUG-73903) being truncated on one test platform. Change-Id: I9cd3f2639b4e50c3c4513e14629a40bdca8f8273
| * Fix QColor::toCmyk() for rgb(0, 0, 0)Eirik Aavitsland2019-02-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | We translate all pure gray colors into cmyk having c,m,y=0 and only the k value expressing the darkness. But a fix introduced to avoid division by 0 caused rgb(0, 0, 0) to be an exception to this; it ended up being translated as c,m,y,k=1 instead. Fix by catching the potential div-by-0 situation earlier and directly set the orthodox cmyk translation: c,m,y=0,k=1. Fixes: QTBUG-73171 Change-Id: I3774eaf9d96e096ac5c47c55d28881bea2bd1309 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Long live QColorSpace and friendsAllan Sandfeld Jensen2019-02-081-3/+2
|/ | | | | | | | | | | | | | | | | | Adds QColorSpace and QColorTransform classes, and parsing of a common subset of ICC profiles found in images, and also parses the ICC profiles in PNG and JPEGs. For backwards compatibility no automatic color handling is done by this patch. [ChangeLog][QtGui] A QColorSpace class has been added, and color spaces are now parsed from PNG and JPEG images. No automatic color space conversion is done however, and applications must request it. Change-Id: Ic09935f84640a716467fa3a9ed1e73c02daf3675 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Fix precision in parsing hex format QColorsAllan Sandfeld Jensen2018-11-121-0/+3
| | | | | | | | | We document being able to parse more than 8-bit per color, but were ignoring everything after the first 8 bits. Change-Id: Ic85ab04b0836e6979a623e294eebd5084c1a9478 Fixes: QTBUG-71373 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Optimize unpremultiply using SSE rcpAllan Sandfeld Jensen2018-05-231-1/+19
| | | | | Change-Id: I255031d354b0fde7abe8366ea2c86a35f9f24afd Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove references to obsolete platformsJake Petroules2017-11-051-3/+0
| | | | | | | | | | | | | | ultrix and reliant have not seen a release since 1995. dgux not since 2001. bsdi not since 2003. irix not since 2006. osf not since 2010. dynix... unclear, but no later than 2002. symbian needs no mention. All considered obsolete, all gone. sco and unixware are effectively obsolete. Remove them until someone expresses a real need. Change-Id: Ia3d9d370016adce9213ae5ad0ef965ef8de2a3ff Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QColor: port to QStringViewMarc Mutz2017-03-291-7/+20
| | | | | | | | | | | | | | | | | | | ... leveraging the existing support for QLatin1String, which is the char equivalent of QStringView. The only noteworthy changes here are the port of the low-level functions to size_t and that the internal template function, setColorFromString(), can now take its argument by value, since only views are ever passed to it anymore. In the test, used new QTest::addRow() to format test names, and introduced temporaries to avoid re-calculating the same input values for every check. Change-Id: Ia3c59e5c435ff753f34993a8d85c0c0b4e8e2b22 Reviewed-by: Milian Wolff <milian.wolff@kdab.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Replace QDrawHelperGammaTables with QColorProfileAllan Sandfeld Jensen2016-11-241-0/+35
| | | | | | | | | | | | Turns the two set of tables in QDrawHelperGammaTables into two QColorProfile classes that use similar structures and can be reused for other gamma correction. At the same time clean-up and improve the comma-correct blending code to use the new profiles and QRgba64 precision. Change-Id: I302bd87a5c836e1010fff6d633eeb56fd4ae2ff0 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Change confusing Q_DEAD_CODE_FROM_QT4_FOO defineTor Arne Vestbø2016-10-141-2/+2
| | | | | | | | | | | | | | | | | | | Commit c5db8fc74 changed all instances of Q_WS_FOO to have the prefix Q_DEAD_CODE_FROM_QT4 instead, to make it clearer when reading the code that the code in question was a left-over from Qt4, when we used Q_WS_ defines instead of Q_OS_ defines. This worked well for cases of #ifdef Q_DEAD_CODE_FROM_QT4, but less so for cases of #ifndef Q_DEAD_CODE_FROM_QT4, where the code was actually unconditionally included. To make this even clearer, the defines have been replaced by checks for 1 or 0, with a comment describing how the code used to look in Qt4. The use of constants in the check also makes it easier for editors to parse the condition and show visually that the code is defined out. Change-Id: I152070d87334df7259b417cd5e17d7b7950379b7 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QColor: provide QLatin1String overloads of functions taking QStringMarc Mutz2016-09-231-14/+38
| | | | | | | | | | | | | | The inefficiency of QColor(const char*) came to light by a recent refactoring which showed that the existing char* overload of qt_get_hex_rgb() was never called. So, provide a QLatin1String interface for named colors that allows user code to reach that internal function without converting to QString first. Change-Id: I74df7b570ef28c00e35ca4adf46c4b7c7e9994b3 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Anton Kudryavtsev <a.kudryavtsev@netris.ru>
* Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-08-101-0/+2
|\ | | | | | | Change-Id: I1a63523de158757964b6fb5ea026cf69a6c5ddcf
| * Improve performance of QColor::name, now more than 4 times fasterDavid Faure2016-08-051-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Before: HexRgb: 0.00230 ms per iteration, HexArgb: 0.00290 ms per iteration After: HexRgb: 0.00051 ms per iteration, HexArgb: 0.00061 ms per iteration This showed up as a relevant optimization when profiling KIconLoader which uses QColor::name() as part of the key -- thanks to Mark Gaiser for the investigation and first suggestion of a solution. I have also seen customer code writing a replacement for QColor::name() because it was too slow to be used as a hash key. Change-Id: I009ccdd712ea0d869d466e2c9894e0cea58f0e68 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | Updated license headersJani Heikkinen2016-01-211-17/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | From Qt 5.7 -> tools & applications are lisenced under GPL v3 with some exceptions, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new GPL-EXCEPT header instead of LGPL21 one (in those files which will be under GPL 3 with exceptions) Change-Id: I42a473ddc97101492a60b9287d90979d9eb35ae1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Tests: Remove CONFIG += parallel_test.Friedemann Kleint2015-09-051-1/+0
|/ | | | | | | The keyword no longer has a meaning for the new CI. Change-Id: Ibcea4c7a82fb7f982cf4569fdff19f82066543d1 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Remove type punning from QRgba64.Erik Verbruggen2015-08-111-0/+19
| | | | | | | | | | | | In C++, type punning with a union is not allowed. It will result in compiler defined behavior at best, and undefined behavior at worst. Specifically, if QRgba64 is passed to a function by value, the different members of a struct might be passed in separate registers. This means that any write to the quint64 might not blank out the values of the struct whenever the compiler looses track with TBAA. Change-Id: I991b5492fe4bb13a14bb670fef5bf13dacbe6c0a Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
* tests/auto/gui: Replace Q[TRY]_VERIFY(a == b) by Q[TRY]_COMPARE(a, b).Friedemann Kleint2015-07-311-6/+6
| | | | | | | | | | | | - Replace Q[TRY]_VERIFY(pointer == 0) by Q[TRY]_VERIFY(!pointer). - Replace Q[TRY]_VERIFY(smartPointer == 0) by Q[TRY]_VERIFY(smartPointer.isNull()). - Replace Q[TRY]_VERIFY(a == b) by Q[TRY]_COMPARE(a, b) and add casts where necessary. The values will then be logged should a test fail. Change-Id: I624deb320c378c18a29b3707f48583d53bfd5186 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.5' into devLiang Qi2015-04-271-0/+19
|\ | | | | | | | | | | | | | | Conflicts: src/tools/qdoc/tree.cpp tests/auto/gui/painting/qcolor/tst_qcolor.cpp Change-Id: Iaa78f601a63191fa643aabf853520f913f2f0fdc
| * Revert "Remove separate SSE4 unpremultiply function"Allan Sandfeld Jensen2015-04-231-0/+19
| | | | | | | | | | | | | | | | | | | | | | Could causedSSE4 instructions to be used on non SSE4 machines in cases when qUnpremultiplywas not inlined. This reverts commit 964ccc58534aac436529007000d1c38d76c88834. Change-Id: Ic676ade8f75129e8d37c4d96cbfb2bdb5b794919 Task-number: QTBUG-45741 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/5.5' into devLiang Qi2015-04-221-19/+0
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/statemachine/qstatemachine.cpp src/corelib/statemachine/qstatemachine_p.h src/gui/painting/qdrawhelper.cpp src/plugins/platforms/xcb/qxcbnativeinterface.cpp src/plugins/platforms/xcb/qxcbwindow.cpp src/plugins/platforms/xcb/qxcbwindow.h src/testlib/qtestblacklist.cpp src/tools/qdoc/node.cpp src/tools/qdoc/node.h tests/auto/gui/painting/qcolor/tst_qcolor.cpp Change-Id: I6c78b7b162001712d5774293f501b06b4ff32684
| * Remove separate SSE4 unpremultiply functionAllan Sandfeld Jensen2015-04-161-19/+0
| | | | | | | | | | | | | | | | | | | | | | Merges the SSE4 specific unpremultiply with the normal version, and adds a SSE2 fallback. There was no reason to split the two since compile time options will ensure the right version is inlined. Also adds short-cut for 0 and 255 values. Change-Id: Ie5aa262f6964219fd3062d4a498f697cf79a4595 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Introduce QRgba64 structure for 64bit RGBA valuesAllan Sandfeld Jensen2015-03-101-1/+84
|/ | | | | | | | This structure is meant to replace QRgb where higher precision is needed. Change-Id: I49d441e2133371a8b91c2e6af0c137bcc5fcb9ed Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* Update copyright headersJani Heikkinen2015-02-111-7/+7
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* Optimize unpremultiply on SSE4.1Allan Sandfeld Jensen2015-02-092-1/+33
| | | | | | | | | Adds an SSE4.1 optimized version of qUnpremultiply and uses it in the most drawing conversions methods. This gives a speed-up of little over 2x. Change-Id: Ieb858a94ada1eb86d7af715ac1a100f1587f360d Reviewed-by: Gunnar Sletta <gunnar@sletta.org>