mirror of
https://gitee.com/spark-store-project/spark-store
synced 2025-12-15 13:22:04 +08:00
Reorganize all parts of codes; Fix a bug that index page color is not correct when initialized.
41 lines
854 B
C++
41 lines
854 B
C++
#include "big_image.h"
|
|
|
|
#include <QHBoxLayout>
|
|
#include <QtConcurrent>
|
|
|
|
big_image::big_image(DBlurEffectWidget *parent) :
|
|
DBlurEffectWidget(parent),
|
|
m_image(new QLabel)
|
|
{
|
|
setWindowFlags(this->windowFlags() | Qt::WindowStaysOnTopHint); // 设置图片对话框总在最前
|
|
setRadius(0);
|
|
setMaskAlpha(60);
|
|
setMaskColor(QColor("#000000"));
|
|
|
|
QHBoxLayout *layout = new QHBoxLayout;
|
|
setLayout(layout);
|
|
layout->addWidget(m_image);
|
|
layout->setMargin(0);
|
|
|
|
// m_image->setParent(this);
|
|
// m_image->setMaximumSize(1360,768);
|
|
m_image->setAlignment(Qt::AlignCenter);
|
|
}
|
|
|
|
void big_image::setimage(QPixmap image)
|
|
{
|
|
m_image->setPixmap(image);
|
|
}
|
|
|
|
void big_image::mousePressEvent(QMouseEvent *)
|
|
{
|
|
hide();
|
|
m_image->clear();
|
|
}
|
|
|
|
void big_image::focusOutEvent(QFocusEvent *)
|
|
{
|
|
hide();
|
|
m_image->clear();
|
|
}
|