blob: fd5ec5d426b1a8aecac070bd81b75db85c906a77 [file] [log] [blame]
Zack Rusin5cb6b872011-04-10 02:19:59 -04001#include "imageviewer.h"
2
3#include <QPainter>
4#include <QPixmap>
5
6ImageViewer::ImageViewer(QWidget *parent)
7 : QDialog(parent)
8{
9 setupUi(this);
10
11 QPixmap px(32, 32);
12 QPainter p(&px);
13 p.fillRect(0, 0, 32, 32, Qt::white);
14 p.fillRect(0, 0, 16, 16, QColor(193, 193, 193));
15 p.fillRect(16, 16, 16, 16, QColor(193, 193, 193));
16 p.end();
17 QPalette pal = scrollAreaWidgetContents->palette();
18 pal.setBrush(QPalette::Background,
19 QBrush(px));
20 pal.setBrush(QPalette::Base,
21 QBrush(px));
22 scrollAreaWidgetContents->setPalette(pal);
23}
24
25void ImageViewer::setImage(const QImage &image)
26{
27 QPixmap px = QPixmap::fromImage(image);
28 imageLabel->setPixmap(px);
29}
30
31#include "imageviewer.moc"