Files
o3de/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Editor/ImagePopup.cpp
T
Steve Pham 38261d0800 Shorten copyright headers by splitting into 2 lines (#2213)
* Updated all copyright headers to split the longer original copyright line into 2 shorter lines

Signed-off-by: Steve Pham <spham@amazon.com>
2021-07-16 15:25:48 -07:00

47 lines
1.3 KiB
C++

/*
* Copyright (c) Contributors to the Open 3D Engine Project.
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
#include <ImageProcessing_precompiled.h>
#include "ImagePopup.h"
AZ_PUSH_DISABLE_WARNING(4251 4800, "-Wunknown-warning-option") // disable warnings spawned by QT
#include <Source/Editor/ui_ImagePopup.h>
#include <QLabel>
#include <QPixmap>
AZ_POP_DISABLE_WARNING
namespace ImageProcessingAtomEditor
{
ImagePopup::ImagePopup(QImage previewImage, QWidget* parent /*= nullptr*/)
: QDialog(parent, Qt::Dialog | Qt::FramelessWindowHint | Qt::Popup)
, m_ui(new Ui::ImagePopup)
{
m_ui->setupUi(this);
m_previewImage = previewImage;
if (!m_previewImage.isNull())
{
int height = previewImage.height();
int width = previewImage.width();
this->resize(width, height);
m_ui->imageLabel->resize(width, height);
QPixmap pixmap = QPixmap::fromImage(previewImage);
m_ui->imageLabel->setPixmap(pixmap);
this->setFocusPolicy(Qt::FocusPolicy::NoFocus);
this->setModal(false);
}
}
ImagePopup::~ImagePopup()
{
}
}//namespace ImageProcessingAtomEditor
#include <Source/Editor/moc_ImagePopup.cpp>