Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions qtwinmigrate/src/qwinhost.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include "qwinhost.h"

#include <QEvent>
#include <QScreen>
#include <qt_windows.h>

#if QT_VERSION >= 0x050000
Expand Down Expand Up @@ -270,7 +271,13 @@ void QWinHost::showEvent(QShowEvent *e)
QWidget::showEvent(e);

if (hwnd)
SetWindowPos(hwnd, HWND_TOP, 0, 0, width(), height(), SWP_SHOWWINDOW);
{
// High DPI Support
qreal dpr = this->screen()->devicePixelRatio();
qreal w = width() * dpr;
qreal h = height() * dpr;
SetWindowPos(hwnd, HWND_TOP, 0, 0, (int)w, (int)h, SWP_SHOWWINDOW);
}
}

/*!
Expand All @@ -292,7 +299,13 @@ void QWinHost::resizeEvent(QResizeEvent *e)
QWidget::resizeEvent(e);

if (hwnd)
SetWindowPos(hwnd, HWND_TOP, 0, 0, width(), height(), 0);
{
// High DPI Support
qreal dpr = this->screen()->devicePixelRatio();
qreal w = width() * dpr;
qreal h = height() * dpr;
SetWindowPos(hwnd, HWND_TOP, 0, 0, (int)w, (int)h, 0);
}
}

/*!
Expand Down