Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to use QWindowsWindowFunctions::setHasBorderInFullScreen in Qt6
Forum Updated to NodeBB v4.3 + New Features

How to use QWindowsWindowFunctions::setHasBorderInFullScreen in Qt6

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 823 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    nitingera
    wrote on last edited by
    #1

    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?

    1 Reply Last reply
    0
    • B Offline
      B Offline
      Bonnie
      wrote on last edited by
      #2

      After searching in the qt source codes, I think it can be done like this:

      First, add this in your .pro file

      QT += 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);
      }
      
      1 Reply Last reply
      0
      • N Offline
        N Offline
        nitingera
        wrote on last edited by nitingera
        #3

        Thanks @Bonnie
        I found out another way it works

        if (QWindowsWindow* windowsWindow = dynamic_cast<QWindowsWindow*>(windowHandle()))
        windowsWindow->setHasBorderInFullScreen(true);

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved