diff options
author | Marius Storm-Olsen <marius.storm-olsen@nokia.com> | 2009-11-06 08:33:33 (GMT) |
---|---|---|
committer | Marius Storm-Olsen <marius.storm-olsen@nokia.com> | 2009-11-06 14:45:10 (GMT) |
commit | e53c26b52c890f242491e0dfed4201313d98f720 (patch) | |
tree | 7fac2b3f8972ea22c1136995864f6eacda87ccac /src/gui/image/qpixmap_mac.cpp | |
parent | 98e0b95581f46b94773a55195e0e67a466c333ed (diff) | |
download | Qt-e53c26b52c890f242491e0dfed4201313d98f720.zip Qt-e53c26b52c890f242491e0dfed4201313d98f720.tar.gz Qt-e53c26b52c890f242491e0dfed4201313d98f720.tar.bz2 |
API review: Rename functions numColors(), setNumColors() and numBytes()
QPaintDevice and QImage used the functions numColors(), setNumColors(),
and numBytes(). However, this is not consistent with the rest of the Qt
API which uses *Count() and set*Count().
Removed all usage of these functions inside Qt and test-cases.
Reviewed-by: Andreas Aardal Hanssen
Diffstat (limited to 'src/gui/image/qpixmap_mac.cpp')
-rw-r--r-- | src/gui/image/qpixmap_mac.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/gui/image/qpixmap_mac.cpp b/src/gui/image/qpixmap_mac.cpp index 9209d45..6175931 100644 --- a/src/gui/image/qpixmap_mac.cpp +++ b/src/gui/image/qpixmap_mac.cpp @@ -248,7 +248,7 @@ void QMacPixmapData::fromImage(const QImage &img, } else if ((flags & Qt::ColorMode_Mask) == Qt::ColorOnly) { conv8 = d == 1; // native depth wanted } else if (d == 1) { - if (image.numColors() == 2) { + if (image.colorCount() == 2) { QRgb c0 = image.color(0); // Auto: convert to best QRgb c1 = image.color(1); conv8 = qMin(c0,c1) != qRgb(0,0,0) || qMax(c0,c1) != qRgb(255,255,255); @@ -339,7 +339,7 @@ void QMacPixmapData::fromImage(const QImage &img, bool alphamap = image.depth() == 32; if (sfmt == QImage::Format_Indexed8) { const QVector<QRgb> rgb = image.colorTable(); - for (int i = 0, count = image.numColors(); i < count; ++i) { + for (int i = 0, count = image.colorCount(); i < count; ++i) { const int alpha = qAlpha(rgb[i]); if (alpha != 0xff) { alphamap = true; @@ -355,13 +355,13 @@ void QMacPixmapData::fromImage(const QImage &img, int get_index(QImage * qi,QRgb mycol) { int loopc; - for(loopc=0;loopc<qi->numColors();loopc++) { + for(loopc=0;loopc<qi->colorCount();loopc++) { if(qi->color(loopc)==mycol) return loopc; } - qi->setNumColors(qi->numColors()+1); - qi->setColor(qi->numColors(),mycol); - return qi->numColors(); + qi->setColorCount(qi->colorCount()+1); + qi->setColor(qi->colorCount(),mycol); + return qi->colorCount(); } QImage QMacPixmapData::toImage() const @@ -376,7 +376,7 @@ QImage QMacPixmapData::toImage() const const uint sbpr = bytesPerRow; if (format == QImage::Format_MonoLSB) { image.fill(0); - image.setNumColors(2); + image.setColorCount(2); image.setColor(0, QColor(Qt::color0).rgba()); image.setColor(1, QColor(Qt::color1).rgba()); for (int y = 0; y < h; ++y) { |