我写了一些看起来或多或少像这样的代码:
QVector<QRgb> colorTable(256);
QImage *qi = new QImage(lutData, imwidth,imheight, QImage::Format_Indexed8);
while (index < 256)
{
colorTable.replace(index, qRgb(2552,255, 255));
index++;
}
qi->setColorTable(colorTable);
QPixmap p(QPixmap::fromImage(*qi,Qt::AutoColor));
所以 lutData (unsigned char) 是我在 colorTable 中的索引。这在代码段的最后一行崩溃,实际行在一个库中,我看不到名为 QX11PixmapData 的源。我做错了什么导致这次崩溃,还是 Qt 错误?
如果这很重要,我正在运行 CentOS 5.5。
谢谢!