Signed-off-by: Yuhang Zhao <2546789017@qq.com>
This commit is contained in:
Yuhang Zhao 2022-03-13 15:48:07 +08:00
parent 3216defd59
commit efb56c712c
4 changed files with 6 additions and 1 deletions

View File

@ -23,6 +23,7 @@
*/
#include "framelesshelper_win32.h"
#include <QtCore/qdebug.h>
#include <QtCore/qmutex.h>
#include <QtCore/qvariant.h>
#include <QtCore/qcoreapplication.h>

View File

@ -169,7 +169,11 @@ void FramelessQuickUtils::showSystemMenu(QWindow *window, const QPointF &pos)
return;
}
#ifdef Q_OS_WINDOWS
# if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
const QPointF globalPos = window->mapToGlobal(pos) * window->devicePixelRatio();
# else
const QPointF globalPos = QPointF(window->mapToGlobal(pos.toPoint())) * window->devicePixelRatio();
# endif
Utilities::showSystemMenu(window->winId(), globalPos);
#endif
}

View File

@ -27,7 +27,6 @@
#include "framelesshelper_global.h"
#include <QtCore/qobject.h>
#include <QtGui/qwindow.h>
#include <QtQml/qqmlregistration.h>
QT_BEGIN_NAMESPACE
class QWindow;

View File

@ -23,6 +23,7 @@
*/
#include "utilities.h"
#include <QtCore/qdebug.h>
#include <QtCore/private/qsystemlibrary_p.h>
#if (QT_VERSION >= QT_VERSION_CHECK(5, 9, 0))
# include <QtCore/qoperatingsystemversion.h>