QImage及其const bits()const方法

时间:2010-03-06 06:24:24

标签: qt

Qt的QImage有两种方法:

uchar* QImage::bits();
const uchar* QImage::bits() const;

但如何拨打第二个?调用

const uchar* p = image.bits();

将调用非const版本O_O。

1 个答案:

答案 0 :(得分:3)

const QImage* im = ℑ
const uchar* p = im->bits();

将使用const版本。