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 /tools | |
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 'tools')
-rw-r--r-- | tools/makeqpf/qpf2.cpp | 4 | ||||
-rw-r--r-- | tools/qvfb/qvfbview.cpp | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/tools/makeqpf/qpf2.cpp b/tools/makeqpf/qpf2.cpp index 23006f0..a0af1a0 100644 --- a/tools/makeqpf/qpf2.cpp +++ b/tools/makeqpf/qpf2.cpp @@ -519,7 +519,7 @@ void QPF::addGlyphs(QFontEngine *fe, const QList<CharacterRange> &ranges) glyph_metrics_t metrics = fe->boundingBox(glyphIndex); const quint32 oldSize = glyphs.size(); - glyphs.resize(glyphs.size() + sizeof(QFontEngineQPF::Glyph) + img.numBytes()); + glyphs.resize(glyphs.size() + sizeof(QFontEngineQPF::Glyph) + img.byteCount()); uchar *data = reinterpret_cast<uchar *>(glyphs.data() + oldSize); uchar *gmapPtr = reinterpret_cast<uchar *>(gmap.data() + glyphIndex * sizeof(quint32)); @@ -543,7 +543,7 @@ void QPF::addGlyphs(QFontEngine *fe, const QList<CharacterRange> &ranges) ; } - qMemCopy(data, img.bits(), img.numBytes()); + qMemCopy(data, img.bits(), img.byteCount()); } } } diff --git a/tools/qvfb/qvfbview.cpp b/tools/qvfb/qvfbview.cpp index 8cab641..69817bd 100644 --- a/tools/qvfb/qvfbview.cpp +++ b/tools/qvfb/qvfbview.cpp @@ -596,7 +596,7 @@ QImage QVFbView::getBuffer(const QRect &r, int &leading) const r.width(), r.height(), mView->linestep(), QImage::Format_Indexed8); img.setColorTable(mView->clut()); - if (img.numColors() <= 0) + if (img.colorCount() <= 0) img = QImage(); break; } @@ -613,10 +613,10 @@ QImage QVFbView::getBuffer(const QRect &r, int &leading) const if ( img.format() != QImage::Format_ARGB32_Premultiplied ) img = img.convertToFormat(QImage::Format_RGB32); - // NOTE: calling bits() may change numBytes(), so do not + // NOTE: calling bits() may change byteCount(), so do not // pass them as parameters (which are evaluated right-to-left). QRgb *b = (QRgb*)img.bits(); - int n = img.numBytes()/4; + int n = img.byteCount()/4; dim(b,n,brightness); } } |