src/gui/image/qpixmap_qws.cpp
changeset 3 41300fa6a67c
parent 0 1918ee327afb
child 4 3b1da2848fc7
equal deleted inserted replaced
2:56cd8111b7f7 3:41300fa6a67c
   112     return QPixmap::fromImage(img);
   112     return QPixmap::fromImage(img);
   113 }
   113 }
   114 
   114 
   115 QRgb* QPixmap::clut() const
   115 QRgb* QPixmap::clut() const
   116 {
   116 {
   117     if (data->classId() == QPixmapData::RasterClass) {
   117     if (data && data->classId() == QPixmapData::RasterClass) {
   118         const QRasterPixmapData *d = static_cast<const QRasterPixmapData*>(data.data());
   118         const QRasterPixmapData *d = static_cast<const QRasterPixmapData*>(data.data());
   119         return d->image.colorTable().data();
   119         return d->image.colorTable().data();
   120     }
   120     }
   121 
   121 
   122     return 0;
   122     return 0;
   123 }
   123 }
   124 
   124 
   125 int QPixmap::numCols() const
   125 int QPixmap::numCols() const
   126 {
   126 {
   127     if (data->classId() == QPixmapData::RasterClass) {
   127     return colorCount();
       
   128 }
       
   129 
       
   130 int QPixmap::colorCount() const
       
   131 {
       
   132     if (data && data->classId() == QPixmapData::RasterClass) {
   128         const QRasterPixmapData *d = static_cast<const QRasterPixmapData*>(data.data());
   133         const QRasterPixmapData *d = static_cast<const QRasterPixmapData*>(data.data());
   129         return d->image.numColors();
   134         return d->image.colorCount();
   130     }
   135     }
   131 
   136 
   132     return 0;
   137     return 0;
   133 }
   138 }
   134 
   139 
   135 const uchar* QPixmap::qwsBits() const
   140 const uchar* QPixmap::qwsBits() const
   136 {
   141 {
   137     if (data->classId() == QPixmapData::RasterClass) {
   142     if (data && data->classId() == QPixmapData::RasterClass) {
   138         const QRasterPixmapData *d = static_cast<const QRasterPixmapData*>(data.data());
   143         const QRasterPixmapData *d = static_cast<const QRasterPixmapData*>(data.data());
   139         return d->image.bits();
   144         return d->image.bits();
   140     }
   145     }
   141 
   146 
   142     return 0;
   147     return 0;
   143 }
   148 }
   144 
   149 
   145 int QPixmap::qwsBytesPerLine() const
   150 int QPixmap::qwsBytesPerLine() const
   146 {
   151 {
   147     if (data->classId() == QPixmapData::RasterClass) {
   152     if (data && data->classId() == QPixmapData::RasterClass) {
   148         const QRasterPixmapData *d = static_cast<const QRasterPixmapData*>(data.data());
   153         const QRasterPixmapData *d = static_cast<const QRasterPixmapData*>(data.data());
   149         return d->image.bytesPerLine();
   154         return d->image.bytesPerLine();
   150     }
   155     }
   151 
   156 
   152     return 0;
   157     return 0;