--- a/qmlFrontend/previewimageprovider.cpp Sat Sep 27 12:49:08 2014 +0400
+++ b/qmlFrontend/previewimageprovider.cpp Sun Sep 28 00:18:01 2014 +0400
@@ -18,22 +18,19 @@
void PreviewImageProvider::setPixmap(const QByteArray &px)
{
- if(px.size() == 128 * 256)
- {
- QVector<QRgb> colorTable;
- colorTable.resize(256);
- for(int i = 0; i < 256; ++i)
- colorTable[i] = qRgba(255, 255, 0, i);
+ QVector<QRgb> colorTable;
+ colorTable.resize(256);
+ for(int i = 0; i < 256; ++i)
+ colorTable[i] = qRgba(255, 255, 0, i);
- const quint8 *buf = (const quint8*) px.constData();
- QImage im(buf, 256, 128, QImage::Format_Indexed8);
- im.setColorTable(colorTable);
+ const quint8 *buf = (const quint8*) px.constData();
+ QImage im(buf, 256, 128, QImage::Format_Indexed8);
+ im.setColorTable(colorTable);
- m_px = QPixmap::fromImage(im, Qt::ColorOnly);
- //QPixmap pxres(px.size());
- //QPainter p(&pxres);
+ m_px = QPixmap::fromImage(im, Qt::ColorOnly);
+ //QPixmap pxres(px.size());
+ //QPainter p(&pxres);
- //p.fillRect(pxres.rect(), linearGrad);
- //p.drawPixmap(0, 0, px);
- }
+ //p.fillRect(pxres.rect(), linearGrad);
+ //p.drawPixmap(0, 0, px);
}