mirror of
https://gitee.com/spark-store-project/spark-store
synced 2025-07-26 23:42:21 +08:00
fix: 先使图像居中再显示图像界面
This commit is contained in:
parent
28326b37c7
commit
b5ae73fbeb
@ -42,12 +42,13 @@ void image_show::setImage(QPixmap image)
|
|||||||
void image_show::mousePressEvent(QMouseEvent *)
|
void image_show::mousePressEvent(QMouseEvent *)
|
||||||
{
|
{
|
||||||
m_dialog->setimage(m_image);
|
m_dialog->setimage(m_image);
|
||||||
m_dialog->show();
|
|
||||||
|
|
||||||
// 识别主屏幕尺寸并设置 widget 大小
|
// 识别主屏幕尺寸并设置 widget 大小
|
||||||
m_dialog->setFixedSize(qMin(desktop_w, m_image.width() + int(desktop_h / 16 * m_image.width() / m_image.height())), qMin(desktop_h, m_image.height() + int(desktop_h / 16)));
|
m_dialog->setFixedSize(qMin(desktop_w, m_image.width() + int(desktop_h / 16 * m_image.width() / m_image.height())), qMin(desktop_h, m_image.height() + int(desktop_h / 16)));
|
||||||
|
|
||||||
m_dialog->move(QGuiApplication::screenAt(QCursor().pos())->geometry().center() - m_dialog->rect().center());
|
m_dialog->move(QGuiApplication::screenAt(QCursor().pos())->geometry().center() - m_dialog->rect().center());
|
||||||
|
|
||||||
|
m_dialog->show();
|
||||||
}
|
}
|
||||||
image_show::~image_show()
|
image_show::~image_show()
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user