How to use QWindowsWindowFunctions::setHasBorderInFullScreen in Qt6
-
I am trying to use QWindowsWindowFunctions::setHasBorderInFullScreen method in Qt6 as mentioned in the documentation https://doc-snapshots.qt.io/qt6-dev/windows-issues.html
But this function is not available in Qt6..
Any ideas how to proceed with this? -
After searching in the qt source codes, I think it can be done like this:
First, add this in your
.pro
fileQT += gui-private
If you use CMake instead of
.pro
file, here is the CMake way in this post.Then in you source code
#include <qpa/qplatformwindow_p.h> ... if(auto inf = windowHandle()->nativeInterface<QNativeInterface::Private::QWindowsWindow>()) { inf->setHasBorderInFullScreen(true); }