showpixmapdialog.cpp 587 B

1234567891011121314151617181920212223
  1. #include "showpixmapdialog.h"
  2. #include "ui_showpixmapdialog.h"
  3. showPixmapDialog::showPixmapDialog(QWidget *parent) : QDialog(parent), ui(new Ui::showPixmapDialog)
  4. {
  5. ui->setupUi(this);
  6. setWindowFlags(Qt::CustomizeWindowHint | Qt::WindowCloseButtonHint);
  7. QHBoxLayout *lay = new QHBoxLayout();
  8. this->setLayout(lay);
  9. lay->setContentsMargins(0, 0, 0, 0);
  10. m_viewer = new PixmapViewer(this);
  11. lay->addWidget(m_viewer);
  12. }
  13. showPixmapDialog::~showPixmapDialog()
  14. {
  15. delete ui;
  16. }
  17. void showPixmapDialog::setImage(QPixmap &image)
  18. {
  19. m_viewer->setImage(image);
  20. }