Changeset 769 for trunk/src/gui/image/qpixmap.cpp
- Timestamp:
- Aug 2, 2010, 9:27:30 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.6.3 (added) merged: 768 /branches/vendor/nokia/qt/current merged: 767 /branches/vendor/nokia/qt/4.6.2 removed
- Property svn:mergeinfo changed
-
trunk/src/gui/image/qpixmap.cpp
r651 r769 832 832 return true; 833 833 834 bool ok; 835 836 if (data) { 837 ok = data->fromFile(fileName, format, flags); 838 } else { 839 QScopedPointer<QPixmapData> tmp(QPixmapData::create(0, 0, QPixmapData::PixmapType)); 840 ok = tmp->fromFile(fileName, format, flags); 841 if (ok) 842 data = tmp.take(); 843 } 844 845 if (ok) 834 QScopedPointer<QPixmapData> tmp(QPixmapData::create(0, 0, data ? data->type : QPixmapData::PixmapType)); 835 if (tmp->fromFile(fileName, format, flags)) { 836 data = tmp.take(); 846 837 QPixmapCache::insert(key, *this); 847 848 return ok; 838 return true; 839 } 840 841 return false; 849 842 } 850 843 … … 1671 1664 1672 1665 The hasAlphaChannel() returns true if the pixmap has a format that 1673 respects the alpha channel, otherwise returns false, while the 1674 hasAlpha() function returns true if the pixmap has an alpha 1675 channel \e or a mask (otherwise false). The mask() function returns 1676 the mask as a QBitmap object, which can be set using setMask(). 1666 respects the alpha channel, otherwise returns false. The hasAlpha(), 1667 setMask() and mask() functions are legacy and should not be used. 1668 They are potentially very slow. 1677 1669 1678 1670 The createHeuristicMask() function creates and returns a 1-bpp … … 1760 1752 Returns true if this pixmap has an alpha channel, \e or has a 1761 1753 mask, otherwise returns false. 1754 1755 \warning This is potentially an expensive operation. 1762 1756 1763 1757 \sa hasAlphaChannel(), mask() … … 2028 2022 too. The mouse cursor is generally not grabbed. 2029 2023 2030 Note on X11 that if the given \a window doesn't have the same depth2024 Note on X11 that if the given \a window doesn't have the same depth 2031 2025 as the root window, and another window partially or entirely 2032 2026 obscures the one you grab, you will \e not get pixels from the … … 2034 2028 pixmap will be undefined and uninitialized. 2035 2029 2030 On Windows Vista and above grabbing a layered window, which is 2031 created by setting the Qt::WA_TranslucentBackground attribute, will 2032 not work. Instead grabbing the desktop widget should work. 2033 2036 2034 \warning In general, grabbing an area outside the screen is not 2037 2035 safe. This depends on the underlying window system.
Note:
See TracChangeset
for help on using the changeset viewer.