Call to QDesktopWidget breaks the systray icon (it will disappear on plasma-desktop...
[Sak.git] / pixmapviewer.h
blobf2e27129a87a9aa45c3144ee1b8d56ea42e6ac55
1 #ifndef PIXMAPVIEVWER_H_
2 #define PIXMAPVIEVWER_H_
4 #include <QtGui>
6 class PixmapViewer : public QWidget
8 Q_OBJECT;
9 QPixmap m_p;
10 public:
11 PixmapViewer(QWidget* parent = 0) : QWidget(parent) {
12 setMinimumWidth(150);
13 setMinimumHeight(150);
15 void setPixmap(const QPixmap& p) {
16 m_p = p.scaled(qMin(p.width(), 400),qMin(p.height(),400),Qt::KeepAspectRatio);
17 update();
19 QPixmap pixmap() const { return m_p; }
20 void paintEvent(QPaintEvent* );
21 signals:
22 void changed();
23 protected:
24 void mousePressEvent(QMouseEvent* e);
30 #endif