56
53
QSizePolicy::Minimum);
57
54
m_image = new QLabel(this);
58
55
QPushButton* closeButton = new QPushButton(i18n("&Close"), this);
59
if (hlayout && m_image && closeButton) {
60
m_image->setScaledContents(true);
61
QSize imageSize(img.size());
62
QSize desktopSize(QApplication::desktop()->availableGeometry().size());
63
desktopSize -= QSize(12, 12);
64
if (imageSize.width() > desktopSize.width() ||
65
imageSize.height() > desktopSize.height()) {
66
m_image->setPixmap(QPixmap::fromImage(img.scaled(desktopSize, Qt::KeepAspectRatio)));
68
m_image->setPixmap(QPixmap::fromImage(img));
70
vlayout->addWidget(m_image);
71
hlayout->addItem(hspacer);
72
hlayout->addWidget(closeButton);
73
connect(closeButton, SIGNAL(clicked()), this, SLOT(accept()));
74
vlayout->addLayout(hlayout);
56
m_image->setScaledContents(true);
57
QSize imageSize(img.size());
58
QSize desktopSize(QApplication::desktop()->availableGeometry().size());
59
desktopSize -= QSize(12, 12);
60
if (imageSize.width() > desktopSize.width() ||
61
imageSize.height() > desktopSize.height()) {
62
m_image->setPixmap(QPixmap::fromImage(img.scaled(desktopSize, Qt::KeepAspectRatio)));
64
m_image->setPixmap(QPixmap::fromImage(img));
66
vlayout->addWidget(m_image);
67
hlayout->addItem(hspacer);
68
hlayout->addWidget(closeButton);
69
connect(closeButton, SIGNAL(clicked()), this, SLOT(accept()));
70
vlayout->addLayout(hlayout);