Mercurial > hg > vamp-live-host
view host/ImageWindow.cpp @ 6:b046af03c719
* Added image window stuff
author | cannam |
---|---|
date | Fri, 10 Nov 2006 17:46:44 +0000 |
parents | |
children | b30fcffc5000 |
line wrap: on
line source
/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ #include "ImageWindow.h" #include <QVBoxLayout> #include <QLabel> #include <QPixmap> #include <iostream> ImageWindow::ImageWindow(QWidget *parent) : QDialog(parent), m_pixmap(0) { QVBoxLayout *layout = new QVBoxLayout; setLayout(layout); m_label = new QLabel; layout->addWidget(m_label); } ImageWindow::~ImageWindow() { delete m_pixmap; } void ImageWindow::showImage(QString image) { std::cerr << "ImageWindow::showImage(\"" << image.toStdString() << "\")" << std::endl; if (m_imageName == image) return; QPixmap *oldPixmap = m_pixmap; m_pixmap = new QPixmap(image); m_label->setPixmap(*m_pixmap); m_label->setFixedSize(m_pixmap->size()); m_label->show(); delete oldPixmap; m_imageName = image; }