summaryrefslogtreecommitdiffstats
path: root/src/gui/image/qpixmap.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-04-151-1/+7
|\ | | | | | | Change-Id: I8c353b4c53e90434453c76691eac39a894d23b49
| * Fix crash if QPixmap::defaultDepth() is called when no QGuiApplicationEirik Aavitsland2018-04-121-1/+7
| | | | | | | | | | | | | | | | | | | | This static method can be called before QGuiApplication is created. At that point there is yet no primary screen, so the implementation needs to guard against dereferencing a nullptr. Task-number: QTBUG-67309 Change-Id: I6b7b9e97b1c3c79bf2f9c6d6247c3b10f39f7a55 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | QPixmap: use rvalue overloads moreAnton Kudryavtsev2018-02-081-5/+5
|/ | | | | Change-Id: Icf19d20bf46f575ba020e308e0822164ed9924cf Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* QPixmap: move mask functions into QPlatformPixmapLouai Al-Khanji2017-03-171-69/+2
| | | | | | | | These used to be in QPixmapData in Qt4, allowing platforms to override mask handling. Useful when native 32-bit ARGB might not be available. Change-Id: I1fcb77222ee4bc4705a8b4c614c9d5c3938c47ba Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Merge remote-tracking branch 'origin/5.7' into 5.8Liang Qi2016-10-111-26/+24
|\ | | | | | | | | | | | | | | Conflicts: src/gui/image/qpixmap.cpp src/widgets/kernel/qformlayout.cpp Change-Id: I8a8391a202adf7f18464a22ddf0a6c4974eab692
| * Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-10-081-26/+24
| |\ | | | | | | | | | | | | | | | | | | | | | Conflicts: src/network/access/qhttpnetworkconnection.cpp src/network/access/qhttpnetworkconnection_p.h Change-Id: I11f8641ef482efa8cee1b79977d19cc3182814b4
| | * QPixmap::load: ensure QBitmap stays a QBitmap even on failureMarc Mutz2016-10-061-26/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... and avoid detach()ing potentially large data for just preserving the QPlatformPixmap::pixelType(). A QBitmap differs from a QPixmap (its base class, urgh) by always having a data != nullptr and a Bitmap pixel type, yet load() was unconditionally setting 'data' to nullptr on failure, turning a QBitmap into a non-QBitmap. Fix by move-assigning a null QBitmap instead of resetting 'data'. Add some tests. Change-Id: Ida58b3b24d96472a5f9d0f18f81cc763edcf3c16 Reviewed-by: Anton Kudryavtsev <a.kudryavtsev@netris.ru> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | | Merge remote-tracking branch 'origin/5.7' into devEdward Welbourne2016-08-011-4/+2
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure 5.7 now supports clang on android; but dev re-worked configure src/gui/kernel/qevent.h One side renamed a parameter of a constructor; the other added an alternate constructor on the next line. Applied the rename to both for consistency. tests/auto/tools/moc/tst_moc.cpp Each side added a new test at the end. .qmake.conf Ignored 5.7's change to MODULE_VERSION. configure.json No conflict noticed by git; but changes in 5.7 were needed for the re-worked configure to accommodate 5.7's stricter handling of C++11. Change-Id: I9cda53836a32d7bf83828212c7ea00b1de3e09d2
| * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-08-011-4/+2
| |\| | | | | | | | | | | | | | | | | | | | | | Conflicts: src/widgets/itemviews/qabstractitemview.cpp src/widgets/itemviews/qabstractitemview_p.h Change-Id: I54589b1365103cb1749186af92aab03a49c94b64
| | * Update documentation regarding QPixmap HICON conversionsSérgio Martins2016-07-271-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | The QPixmap methods are gone in Qt5. QtWinExtras should be used instead. Task-Id: QTBUG-54838 Change-Id: Ia52ab9786f57d92caf4c44142a3131dbf973a193 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | | Fix/adapt the uses of {to,set,from}Time_t in the qtbase source codeThiago Macieira2016-07-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Move those to the equivalent {to,set,from}SecsSinceEpoch(), except for the cases that did QDateTime::currentDateTime{,Utc}().toTime_t. Those are best implemented with QDateTime::currentSecsSinceEpoch(). Change-Id: Ib57b52598e2f452985e9fffd145a366c92cfda20 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | | QtGui: Introduce delegating constructors.Friedemann Kleint2016-05-091-10/+2
|/ / | | | | | | | | | | | | | | Reduce code duplication by chaining constructors. Change-Id: Ida25105e33cc3ef870f416931212e2216e9c6dfb Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-02-291-1/+1
|\| | | | | | | | | | | | | Conflicts: tests/auto/corelib/io/qprocess/tst_qprocess.cpp Change-Id: Ib6955eb874b516b185b45d6c38cec646fbaa95f4
| * QPixmap: check data ptr in isQBitmap()Anton Kudryavtsev2016-02-241-1/+1
| | | | | | | | | | | | | | Task-number: QTBUG-51271 Change-Id: I670e074ced1217d2614fa334eb365e40ef80b8b1 Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.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>
* | Merge remote-tracking branch 'origin/5.6' into devLiang Qi2015-12-021-3/+3
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/kernel/qcoreapplication.cpp src/corelib/kernel/qeventdispatcher_blackberry.cpp src/network/bearer/qnetworkconfiguration.cpp src/plugins/bearer/blackberry/qbbengine.cpp src/plugins/platforms/android/androidjnimain.cpp src/plugins/platforms/android/qandroidplatformtheme.cpp src/plugins/platforms/qnx/qqnxbpseventfilter.cpp src/plugins/platforms/qnx/qqnxfiledialoghelper_bb10.cpp src/plugins/platforms/qnx/qqnxinputcontext_imf.cpp src/plugins/platforms/qnx/qqnxintegration.cpp src/plugins/platforms/qnx/qqnxnavigatorbps.cpp src/plugins/platforms/qnx/qqnxvirtualkeyboardbps.cpp src/plugins/platforms/qnx/qqnxwindow.cpp src/widgets/kernel/qwidgetwindow.cpp src/widgets/styles/qwindowsvistastyle.cpp src/widgets/styles/qwindowsxpstyle.cpp src/widgets/widgets/qtoolbararealayout.cpp tests/auto/corelib/global/qflags/qflags.pro tests/auto/corelib/itemmodels/qitemmodel/modelstotest.cpp tests/auto/corelib/tools/qversionnumber/qversionnumber.pro tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp Change-Id: I37be88c6c185bb85404823353e027a0a6acdbce4
| * QtBase: remove explicit function info from qWarning() etcMarc Mutz2015-11-281-3/+3
| | | | | | | | | | | | | | | | | | | | | | This information is already registered by the QMessageLogger ctor. Where, by dropping the << Q_FUNC_INFO in ostream-style qDebug(), only a string literal remained, converted to printf-style qDebug() on the go. Change-Id: I3f261c98fd7bcfa1fead381a75a82713bb75e6f3 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Use Q_UNLIKELY for every qFatal()/qCritical()Marc Mutz2015-11-291-1/+1
|/ | | | | | | | | | | | | | | | | | | | | If, after checking a condition, we issue a qFatal() or a qCritical(), by definition that check is unlikely to be true. Tell the compiler so it can move the error handling code out of the normal code path to increase the effective icache size. Moved conditional code around where possible so that we could always use Q_UNLIKELY, instead of having to revert to Q_LIKELY here and there. In some cases, simplified the expressions newly wrapped in Q_UNLIKELY as a drive-by. Change-Id: I67537d62b04bc6977d69254690c5ebbdf98bfd6d Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Whitespace cleanupMorten Johan Sørvig2015-03-191-1/+1
| | | | | Change-Id: Iedb3a43d9208687ac43d0ecb532357257a3b72e2 Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
* Always overwrite QPixmap data on loadFromDataUlf Hermann2015-03-161-2/+1
| | | | | | | | | Reusing the previous QPlatformPixmap breaks implicit sharing. It changes the contents for all QPixmaps using the sample QPlatformPixmap. Task-number: QTBUG-43384 Change-Id: Ic0792088daa8c2dcb5d7d311a0fd7415d7b5e097 Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
* Avoid detaching pixmaps when it has not changedDavid Edmundson2015-03-091-0/+3
| | | | | | | | | | setDevicePixelRatio is often called unconditionally even when the devicePixelRatio matches the pixmap or image. This causes a lot of unncessary detaches wasting some memory. Change-Id: I27535b2b22312ec0edc9bdc00c99d322afb727c1 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>
* Update license headers and add new license filesMatti Paaso2014-09-241-18/+10
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* Document loading of high resolution versions of images.Friedemann Kleint2014-08-261-3/+4
| | | | | | Task-number: QTBUG-38858 Change-Id: I87ee18b66e137f5f5c01d77910f1a7f256b85e18 Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
* Keep global state of debug stream (QImage, QPixmap, and QIcon)Kai Koehne2014-07-231-7/+9
| | | | | | | Make sure that the stream's formatting settings are preserved. Change-Id: Ib13b5e0b36b2ef801da2d2d5c240d28dc1b04653 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Improve debug output of QImage, QPixmap and QIcon.Friedemann Kleint2014-07-211-1/+10
| | | | | | Task-number: QTBUG-38858 Change-Id: Ie45d595478f971c7ed973d911c65484d947d2a60 Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
* QImage support for RGB30 formatsAllan Sandfeld Jensen2014-07-041-1/+2
| | | | | | | | | | | | | | Adds basic support for 10-bit per color channel formats to QImage and the XCB plugin. This will make it possible to paint to and from these formats, but only at 8-bit per color channel accuracy. This also fixes Qt5 applications on X11 with native 30bit depth. [ChangeLog][QtGui][QImage] Added support for 10-bit per color channel image formats. Task-number: QTBUG-25998 Change-Id: I93ccd3c74bfbb0bd94b352476e5fe58a94119e1f Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* Add missing detach() in QPixmap::convertFromImage()David Faure2014-06-111-0/+1
| | | | | | | Task-number: QTBUG-18519 Change-Id: I5d929cf6eda3f34130314edac95487fb00a95db5 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Merge remote-tracking branch 'origin/stable' into devSimon Hausmann2014-01-031-1/+1
|\ | | | | | | Change-Id: Id13badc270db98806048753fd7fb658aa17f1ede
| * Fix some typos in documentation.Jeff Tranter2014-01-021-1/+1
| | | | | | | | | | | | | | | | Fix some spelling and grammatical errors in comments that show up in Qt documentation. No changes to code. Change-Id: I2e946fda0bd9a2117f8e9b2fb300df9bf0a98a6c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* | RValue ref version of QPixmap::fromImage()Allan Sandfeld Jensen2014-01-021-0/+22
|/ | | | | | | | | | | | When converting from a temporary image we can use inplace conversion since we don't have to worry about changes made to the original. This should give a speedup in several places where QPixmaps are made from the return values of methods returning QImages. Change-Id: I1835bcf3fc061c4dbbb3d0507ec84178dc49b29b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Make error messages a bit better.Stephen Kelly2013-11-051-1/+1
| | | | | | Change-Id: I83b5852abfbb3437c03516bc4b36eff385ddb983 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* Doc: Adding mark-up to boolean default values.Jerome Pasion2013-10-081-17/+17
| | | | | | | | | | | | | | | | | 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>
* 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>
* Fix some doc errors.Frederik Gladhorn2013-09-211-1/+1
| | | | | | | Change-Id: Ib874d7e9671d9cee75fe41f4dac5d0de7b09245e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Topi Reiniö <topi.reinio@digia.com> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Doc: remove references to toWinHBitmap and fromWinHBitmapNico Vertriest2013-05-131-11/+4
| | | | | | | | | Task-number: QTBUG-30738 Change-Id: I5a33493b37488b3ac4f5a499e5c5aa22e4e277f4 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com> Reviewed-by: Topi Reiniö <topi.reinio@digia.com> Reviewed-by: Martin Smith <martin.smith@digia.com>
* Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-02-141-0/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/concurrent/doc/qtconcurrent.qdocconf src/corelib/doc/qtcore.qdocconf src/corelib/global/qglobal.h src/dbus/doc/qtdbus.qdocconf src/dbus/qdbusmessage.h src/gui/doc/qtgui.qdocconf src/gui/image/qimagereader.cpp src/network/doc/qtnetwork.qdocconf src/opengl/doc/qtopengl.qdocconf src/opengl/qgl.h src/plugins/platforms/windows/qwindowswindow.cpp src/printsupport/doc/qtprintsupport.qdocconf src/sql/doc/qtsql.qdocconf src/testlib/doc/qttestlib.qdocconf src/tools/qdoc/doc/config/qt-cpp-ignore.qdocconf src/widgets/doc/qtwidgets.qdocconf src/xml/doc/qtxml.qdocconf Change-Id: Ie9a1fa2cc44bec22a0b942e817a1095ca3414629
| * Fixed QPixmapCache associating path with wrong QPixmap.Samuel Rødal2013-02-121-0/+2
| | | | | | | | | | | | | | | | | | QPixmap::load() would not detach, so multiple paths could get associated with the same QPixmap, causing the wrong pixmap to be shown. Task-number: QTBUG-29639 Change-Id: I064dd6a9611b5996853bec9fb20b6224a0adcf62 Reviewed-by: aavit <eirik.aavitsland@digia.com>
* | Fix segfault when setting a device-pixel-ratio on a null-QPixmapTor Arne Vestbø2013-02-091-0/+3
|/ | | | | Change-Id: If3680766a50d5cf78889822d740c9472123191a7 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.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>
* Basic high-dpi "retina" support for Qt 5.Morten Johan Sørvig2012-12-011-0/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | Bring Qt 5 on par with Qt 4, prepare for more comprehensive support later on. Introduce device independent pixels (dips), device pixels, and devicePixelRatio. Add high-dpi support to QPainter, QGLWidget, the cocoa platform plugin, mac and fusion styles. Dips are similar to CSS pixels, Apple points and Android density-independent pixels. Device pixels are pixels in the backing store/physical pixels on screen. devicePixelRatio is the ratio between them, which is 1.0 on standard displays and 2.0 on "retina" displays. New API: QImage::devicePixelRatio() and setDevicePixelRatio() QPixmap::devicePixelRatio() and setDevicePixelRatio() QWindow::devicePixelRatio() QScreen::devicePixelRatio() QGuiApplicaiton::devicePixelRatio() Change-Id: If98c3ca9bfdf0e1bdbcf7574cd5b912c9ff63856 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* Invalidate old QImage data if load()/loadFromData() has failedKonstantin Ritt2012-10-101-11/+23
| | | | | | | | | | This guarantees one will never get `!img.isNull()` after load()/loadFromData() has failed, even if the image was not null before. Apply the same fix to QPixmap and QPicture. Change-Id: Ida1ad6a6f0fc830df8e75ada0c163fc2d3360dea Reviewed-by: Samuel Rødal <samuel.rodal@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>
* Fix g++ compiler warnings.Friedemann Kleint2012-09-071-1/+3
| | | | | | | | Unused variables, unsigned comparison DWORD >= 0 is always true, format string. Change-Id: I9f0a20392e262b2542fb23ea4f513e4c4e354b68 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* Doc: fix yet more errors reported by qdocaavit2012-09-041-15/+25
| | | | | Change-Id: I67ac081ce95235912784bbbc347dd8f80fdebbde Reviewed-by: Kim M. Kalland <kim.kalland@nokia.com>
* Doc: Fixes for several doc errorsaavit2012-08-311-0/+12
| | | | | Change-Id: I5be9c8e9ff9c17fae0fbbe468f34439411aca06b Reviewed-by: Kim M. Kalland <kim.kalland@nokia.com>
* QtGui: replace some copies with swapsMarc Mutz2012-07-061-2/+2
| | | | | | | | | | | This provides move speed even for non-C++11 compilers and avoids having to call the copy assignment operator from within copy ctors. (which will result in infinite recursion when using the copy-swap idiom). Change-Id: I379bc8bf2c72d9f986c0f17f9eef56cd592e7a06 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com> Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.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>
* Merge branch 'docs-refactoring' into masterMarius Storm-Olsen2012-05-101-4/+4
|\ | | | | | | Change-Id: Iebd1966abace3cdf7f9428dcfc1ded5b124ab113
| * 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>