Edwin Leuven <[EMAIL PROTECTED]> writes: | Abdelrazak Younes wrote: | > There is a conversion method: | > std::vector<T> QVector::toStdVector () const | | i think this one is only available if qt is compiled with stl | compatibility.... | | the attached works for me | Index: src/frontends/qt4/QLImage.C | =================================================================== | --- src/frontends/qt4/QLImage.C (revision 14809) | +++ src/frontends/qt4/QLImage.C (working copy) | @@ -183,14 +183,8 @@ | int const pixels = img.depth() > 8 ? | img.width() * img.height() : img.numColors(); | | - // FIXME this code used to be like this: | - // | - //unsigned int * const data = img.depth() > 8 ? | - // (unsigned int *)img.bits() : | - // (unsigned int *)img.jumpTable(); | - // | - // But Qt doc just say use bits... | - unsigned int * const data = (unsigned int *)img.bits(); | + unsigned int *data = img.depth() > 8 ? (unsigned int *) img.bits() : | + (unsigned int *) &img.colorTable()[0];
Is the casts really needed? (and we do prefere C++ casts.) -- Lgb