summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qpen.cpp
Commit message (Collapse)AuthorAgeFilesLines
* QPen: port to QESDPGiuseppe D'Angelo2023-09-261-82/+50
| | | | | | | | | | | | | | Move from a manually managed d-pointer to QESDP. This is a long overdue change (QPen is one of the few classes still with manual management). At the same time: it's also one of the central classes, and in order to keep the impact minimal (and binary compatible), I'm not switching to something more sophisticated. As a drive-by: drop QPenData, a remnant only used by QPen itself, which nowadays is simply a typedef for QPenPrivate. Change-Id: I38834116d7d383f29bb69ff20b0a46dfe951bb53 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-161-38/+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>
* Avoid combining enum values from different enum typesEirik Aavitsland2021-04-211-2/+2
| | | | | | | | Fixes static analyzer warnings. Task-number: QTBUG-91911 Change-Id: I55599d53bb98ada74ceb73d5668fcc18813c3ec4 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Get rid of QPenPrivate::defaultWidthAllan Sandfeld Jensen2020-12-081-14/+7
| | | | | | | It is no longer used. Change-Id: I834e0cbd6ef4fefb52d0864053e95e7dea19b389 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Limit pen width to maximal 32767Allan Sandfeld Jensen2020-11-271-4/+7
| | | | | | | | Fixes oss-fuzz 25195 Pick-to: 5.12 5.15 6.0 Change-Id: I8c68cf71f6702d8b1b1a2ddda3284c14f02d7972 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Remove QVariant(int type, void *data, ...) constructorLars Knoll2020-08-151-1/+1
| | | | | | | | It was marked internal anyway. Use the constructor taking a QMetaType instead. Change-Id: I15b9cd0911aac063a0f0fe0352fa2c84b7f7c691 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Use QList instead of QVector in gui implementationJarek Kobus2020-07-071-6/+6
| | | | | | | Task-number: QTBUG-84469 Change-Id: I366e845249203d80d640355a7780ac2f91a762f1 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Replace most use of QVariant::type and occurrences of QVariant::TypeOlivier Goffart2020-01-231-1/+1
| | | | | | | | | | | | | | | | | | | | | I made a clazy automated check that replaced the use of QVariant::Type by the equivalent in QMetaType. This has been deprecated since Qt 5.0, but many uses were not yet removed. In addition, there was some manual changes to fix the compilation errors. Adapted the Private API of QDateTimeParser and QMimeDataPrivate and adjust QDateTimeEdit and QSpinBox. QVariant(QVariant::Invalid) in qstylesheet made no sense. But note that in QVariant::save, we actually wanted to use the non-user type. In the SQL module, many changes were actually reverted because the API still expects QVarient::Type. Change-Id: I98c368490e4ee465ed3a3b63bda8b8eaa50ea67e Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Tidy nullptr usageAllan Sandfeld Jensen2019-12-061-1/+1
| | | | | | | | | | | Move away from using 0 as pointer literal. Done using clang-tidy. This is not complete as run-clang-tidy can't handle all of qtbase in one go. Change-Id: I1076a21f32aac0dab078af6f175f7508145eece0 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Port from QAtomic::load() to loadRelaxed()Giuseppe D'Angelo2019-06-201-3/+3
| | | | | | | | | | | | | | | Semi-automated, just needed ~20 manual fixes: $ find \( -iname \*.cpp -or -iname \*.h \) -exec perl -pe 's/(\.|->)load\(\)/$1loadRelaxed\(\)/g' -i \{\} + $ find \( -iname \*.cpp -or -iname \*.h \) -exec perl -pe 's/(\.|->)store\(/$1storeRelaxed\(/g' -i \{\} + It can be easily improved (e.g. for store check that there are no commas after the opening parens). The most common offender is QLibrary::load, and some code using std::atomic directly. Change-Id: I07c38a3c8ed32c924ef4999e85c7e45cf48f0f6c Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Replace Q_DECL_NOEXCEPT with noexcept in QtGuiAllan Sandfeld Jensen2019-04-051-2/+2
| | | | | Change-Id: I43803b88fea8083782d73ce157c466b022208740 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Updated license headersJani Heikkinen2016-01-151-14/+20
| | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: I046ec3e47b1876cd7b4b0353a576b352e3a946d9 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* gui: Add several QList::reserve() calls.Sérgio Martins2015-06-221-0/+1
| | | | | | | Reduces reallocations. Change-Id: I0db16726f413a67b76a73fabd013f910ab5f5109 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Use QDebugStateSaver to restore space setting in stream operators.Friedemann Kleint2015-03-301-1/+2
| | | | | | | | Returning dbg.space() breaks formatting on streams that already have nospace() set. Change-Id: I55e38b018679a67eb40be6b4664505483a3a7d8e Reviewed-by: David Faure <david.faure@kdab.com>
* 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>
* QPen: mark copy/move/swap as nothrowMarc Mutz2015-01-101-2/+2
| | | | | Change-Id: Ib13d60256d96253934e0627d4c3015248e002e3f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Update license headers and add new license filesMatti Paaso2014-09-241-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* QPen: add move constructorMarc Mutz2014-02-281-3/+15
| | | | | | | | | | | | | | | | After this change, the relation between copy/move constructor calls in QtGui is something like 40/16. A moved-from QPen can only be copied, assigned-to or else destroyed. This required adding a nullptr check to the copy ctor and the dtor and rewriting copy assignment (which used non-nullptr-safe qAtomicAssign) in terms of copy construction and swapping. Extensive tests included. They are implemented such that they work in C++98 as well as C++11 mode, but they naturally test move semantics only in a C++11 build. Change-Id: If68f37c10b8eeefb2478cbae386cd2e38b4f6e19 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-10-111-4/+4
|\ | | | | | | Change-Id: Ib8cfeee7d9ca15e8ad520e428b72c200827a8628
| * Doc: Adding mark-up to boolean default values.Jerome Pasion2013-10-081-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Default values should have mark-up to denote that they are code. This commit changes: -"property is true" to "property is \c true". -"Returns true" to "Returns \c true". -"property is false" to "property is \c false". -"returns true" to "returns \c true". -"returns false" to "returns \c false". src/3rdparty and non-documentation instances were ignored. Task-number: QTBUG-33360 Change-Id: Ie87eaa57af947caa1230602b61c5c46292a4cf4e Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-10-041-0/+8
|\| | | | | | | | | | | | | | | Conflicts: src/plugins/platforms/minimal/qminimalintegration.cpp src/plugins/platforms/offscreen/qoffscreenintegration.cpp Change-Id: Ica85deeab5c5038ac004718e25194b1157343480
| * Doc: Add docs for rvalue references and move constructorsGeir Vattekar2013-09-271-0/+8
| | | | | | | | | | | | | | | | | | These members were introduced in 4.8, but left undocumented. Because we consider undocumented API to be internal, the members are \since 5.2. Change-Id: I52e2840a8cfaa7f59f410b3e2a06c0942ea06539 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* | QPen: optimize population of dd->dashPatternMarc Mutz2013-09-261-0/+4
|/ | | | | Change-Id: I02b3bb9b503303b931f075f899126a506f9e25d0 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-181-1/+1
| | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Make QPen default to 1-width non-cosmetic.Samuel Rødal2012-10-221-15/+29
| | | | | | | | | | | Use the Qt4CompatiblePainting render hint when painting with QPainter to treat default constructed QPens as cosmetic still. The NonCosmeticDefaultPen render hint gets documented as obsolete, since it was in any case not respected by the raster nor OpenGL paint engine. Change-Id: I04d910e9700baf7f13a8aac07a3633014bb9283e Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-221-24/+24
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Get started with patching up the Qt GUI docsGunnar Sletta2012-06-281-0/+1
| | | | | | | | Primary goal, make the front page of the Qt GUI module a bit more clarifying and avoid downstream references inside the Qt GUI docs. Change-Id: Icbcfbb64b93963add889bf83711daa9575885c02 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Doc: Fix \sa usageMarius Storm-Olsen2012-05-111-5/+5
| | | | | | | | | Ensure comma between elements (757 missing), single space and curly- braces around title elements, etc. Change-Id: Id16c3fda7fc47a12a0682f8720214f4990609a97 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* Doc: Modularize QtGui documentation.Casper van Donderen2012-05-091-4/+4
| | | | | | | | This change moves the snippets and images to the modularized directories. Change-Id: I5f86f598fbe7c47d632c613b85d94ced89ba2c29 Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
* Remove the usage of deprecated qdoc macros.Casper van Donderen2012-03-021-30/+30
| | | | | | | | | | | QDoc now has support for Doxygen style commands for italics, bold and list items. This change applies that change in QDoc to the actual documentation. Task-number: QTBUG-24578 Change-Id: I519bf9c29b14092e3ab6067612f42bf749eeedf5 Reviewed-by: Shane Kearns <shane.kearns@accenture.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Remove use of Q_BROKEN_DEBUG_STREAM.Stephen Kelly2012-02-221-6/+0
| | | | | | | | No supported compiler defines it, and it was not used consistently so it didn't work anyway. Change-Id: Icc9e911e22daaedaee3d9316c15d19be26cd2e72 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove "All rights reserved" line from license headers.Jason McDonald2012-01-301-1/+1
| | | | | | | | | | As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: I311e001373776812699d6efc045b5f742890c689 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update contact information in license headers.Jason McDonald2012-01-231-1/+1
| | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: I431bbbf76d7c27d8b502f87947675c116994c415 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update copyright year in license headers.Jason McDonald2012-01-051-1/+1
| | | | | Change-Id: I02f2c620296fcd91d4967d58767ea33fc4e1e7dc Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Fix most warnings about assignments of QAtomicInt.Friedemann Kleint2011-10-311-1/+1
| | | | | Change-Id: Ide409d72d2637b68ec2a85aaca4bc783a7e911e7 Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* Replace implicit QAtomic* casts with explicit load()/store()Bradley T. Hughes2011-10-271-4/+3
| | | | | Change-Id: Ia7ef1a8e01001f203e409c710c977d6f4686342e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Get rid of the evilness of Q_GLOBAL_STATIC_WITH_INITIALIZERThiago Macieira2011-07-211-18/+13
| | | | | | | | | | | | | | | | | | | That macro is a nightmare. It leads to writing code that is thread-unsafe or other problems. So rewrite the code that used this macro to use special-purpose classes with constructors. This commit does not introduce new errors. The FIXME in qicon.cpp (qtIconCache()) was a condition already present. It does fix the race conditions that were present in qbrush.cpp nullBrushInstance() and qfontengine.cpp qt_grayPalette(). Specialising QGlobalStatic is also evil. Change-Id: I039311f6a5ac9ea4ad7b310b870a2adf888da7e5 Merge-request: 10 Reviewed-by: Olivier Goffart <olivier.goffart@nokia.com> Reviewed-on: http://codereview.qt.nokia.com/1895 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
* Update the documentation after moving examples.Casper van Donderen2011-07-051-3/+3
| | | | | | | Change-Id: I7aa52785979df9eddd7b91e62abd0ef10adc74b7 Reviewed-on: http://codereview.qt.nokia.com/1031 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: David Boddie
* Update licenseheader text in source files for qtbase Qt moduleJyri Tahtela2011-05-241-17/+17
| | | | | | | Updated version of LGPL and FDL licenseheaders. Apply release phase licenseheaders for all source files. Reviewed-by: Trust Me
* Initial import from the monolithic Qt.Qt by Nokia2011-04-271-0/+1032
This is the beginning of revision history for this module. If you want to look at revision history older than this, please refer to the Qt Git wiki for how to use Git history grafting. At the time of writing, this wiki is located here: http://qt.gitorious.org/qt/pages/GitIntroductionWithQt If you have already performed the grafting and you don't see any history beyond this commit, try running "git log" with the "--follow" argument. Branched from the monolithic repo, Qt master branch, at commit 896db169ea224deb96c59ce8af800d019de63f12