--- /dev/null
+#include "imageviewer.h"
+
+#include <QPainter>
+#include <QPixmap>
+
+ImageViewer::ImageViewer(QWidget *parent)
+ : QDialog(parent)
+{
+ setupUi(this);
+
+ QPixmap px(32, 32);
+ QPainter p(&px);
+ p.fillRect(0, 0, 32, 32, Qt::white);
+ p.fillRect(0, 0, 16, 16, QColor(193, 193, 193));
+ p.fillRect(16, 16, 16, 16, QColor(193, 193, 193));
+ p.end();
+ QPalette pal = scrollAreaWidgetContents->palette();
+ pal.setBrush(QPalette::Background,
+ QBrush(px));
+ pal.setBrush(QPalette::Base,
+ QBrush(px));
+ scrollAreaWidgetContents->setPalette(pal);
+}
+
+void ImageViewer::setImage(const QImage &image)
+{
+ QPixmap px = QPixmap::fromImage(image);
+ imageLabel->setPixmap(px);
+}
+
+#include "imageviewer.moc"
--- /dev/null
+#ifndef IMAGEVIEWER_H
+#define IMAGEVIEWER_H
+
+#include "ui_imageviewer.h"
+#include <QDialog>
+
+class ImageViewer : public QDialog, public Ui_ImageViewer
+{
+ Q_OBJECT
+public:
+ ImageViewer(QWidget *parent = 0);
+
+ void setImage(const QImage &image);
+};
+
+
+#endif
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>ImageViewer</class>
+ <widget class="QDialog" name="ImageViewer">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>400</width>
+ <height>300</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>ApiTrace Surface Viewer</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <widget class="QScrollArea" name="scrollArea">
+ <property name="widgetResizable">
+ <bool>true</bool>
+ </property>
+ <widget class="QWidget" name="scrollAreaWidgetContents">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>386</width>
+ <height>286</height>
+ </rect>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout_2">
+ <item>
+ <widget class="QLabel" name="imageLabel">
+ <property name="text">
+ <string/>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignCenter</set>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>