QWindowsWindowFunctions Class

The QWindowsWindowFunctions class is an inline class containing miscellaneous functionality for Windows window specific functionality. More...

Header: #include <QtPlatformHeaders/QWindowsWindowFunctions>
Since: Qt 5.5

This class was introduced in Qt 5.5.

Public Types

typedef IsTabletModeType
typedef SetHasBorderInFullScreen
typedef SetHasBorderInFullScreenDefault
typedef SetTouchWindowTouchType
typedef SetWindowActivationBehaviorType
enum TouchWindowTouchType { NormalTouch, FineTouch, WantPalmTouch }
flags TouchWindowTouchTypes
enum WindowActivationBehavior { DefaultActivateWindow, AlwaysActivateWindow }

Static Public Members

bool isTabletMode()
const QByteArray isTabletModeIdentifier()
void setHasBorderInFullScreen(QWindow *window, bool border)
void setHasBorderInFullScreenDefault(bool border)
const QByteArray setHasBorderInFullScreenDefaultIdentifier()
const QByteArray setHasBorderInFullScreenIdentifier()
void setTouchWindowTouchType(QWindow *window, QWindowsWindowFunctions::TouchWindowTouchTypes type)
const QByteArray setTouchWindowTouchTypeIdentifier()
void setWindowActivationBehavior(QWindowsWindowFunctions::WindowActivationBehavior behavior)
const QByteArray setWindowActivationBehaviorIdentifier()

Detailed Description

A common usage pattern is as follows:

 int main(int argc, char **argv)
 {
     QApplication app(argc, argv);

     QPushButton topLevelWidget("Hello World!");
     topLevelWidget.winId(); //have to create the QWindow

     QWindow *tlwWindow = topLevelWidget.windowHandle();

     QWindowsWindowFunctions::setTouchWindowTouchType(tlwWindow, QWindowsWindowFunctions::WantPalmTouch);

     topLevelWidget.show();

     return app.exec();
 }

Note: There is no binary compatibility guarantee for this class, meaning that an application using it is only guaranteed to work with the Qt version it was developed against.

Member Type Documentation

typedef QWindowsWindowFunctions::IsTabletModeType

This is the typedef for the function returned by QGuiApplication::platformFunction() when passed isTabletModeIdentifier().

This typedef was introduced in Qt 5.9.

typedef QWindowsWindowFunctions::SetHasBorderInFullScreen

This is the typedef for the function returned by QGuiApplication::platformFunction when passed setHasBorderInFullScreenIdentifier.

typedef QWindowsWindowFunctions::SetHasBorderInFullScreenDefault

This is the typedef for the function returned by QGuiApplication::platformFunction when passed setHasBorderInFullScreenDefaultIdentifier.

This typedef was introduced in Qt 5.13.

typedef QWindowsWindowFunctions::SetTouchWindowTouchType

This is the typedef for the function returned by QGuiApplication::platformFunction when passed setTouchWindowTouchTypeIdentifier.

typedef QWindowsWindowFunctions::SetWindowActivationBehaviorType

This is the typedef for the function returned by QGuiApplication::platformFunction() when passed setWindowActivationBehaviorIdentifier().

This typedef was introduced in Qt 5.7.

See also QWidget::activateWindow() and QWindow::requestActivate().

enum QWindowsWindowFunctions::TouchWindowTouchType
flags QWindowsWindowFunctions::TouchWindowTouchTypes

This enum represents the supported TouchWindow touch flags for RegisterTouchWindow().

ConstantValue
QWindowsWindowFunctions::NormalTouch0x00000000
QWindowsWindowFunctions::FineTouch0x00000001
QWindowsWindowFunctions::WantPalmTouch0x00000002

The TouchWindowTouchTypes type is a typedef for QFlags<TouchWindowTouchType>. It stores an OR combination of TouchWindowTouchType values.

enum QWindowsWindowFunctions::WindowActivationBehavior

This enum specifies the behavior of QWidget::activateWindow() and QWindow::requestActivate().

ConstantValueDescription
QWindowsWindowFunctions::DefaultActivateWindow0The window is activated according to the default behavior of the Windows operating system. This means the window will not be activated in some circumstances (most notably when the calling process is not the active process); only the taskbar entry will be flashed.
QWindowsWindowFunctions::AlwaysActivateWindow1The window is always activated, even when the calling process is not the active process.

This enum was introduced or modified in Qt 5.7.

See also QWidget::activateWindow() and QWindow::requestActivate().

Member Function Documentation

[static] bool QWindowsWindowFunctions::isTabletMode()

This is a convenience function that can be used directly instead of resolving the function pointer. Returns true if Windows 10 operates in Tablet Mode. In this mode, Windows forces all application main windows to open in maximized state. Applications should then avoid resizing windows or restoring geometries to non-maximized states.

This function was introduced in Qt 5.9.

See also QWidget::showMaximized(), QWidget::saveGeometry(), and QWidget::restoreGeometry().

[static] const QByteArray QWindowsWindowFunctions::isTabletModeIdentifier()

Returns a bytearray that can be used to query QGuiApplication::platformFunction() to retrieve the IsTabletModeType function.

This function was introduced in Qt 5.9.

[static] void QWindowsWindowFunctions::setHasBorderInFullScreen(QWindow *window, bool border)

This is a convenience function that can be used directly instead of resolving the function pointer. window and border will be relayed to the function retrieved by QGuiApplication. When border is true then it will enable the WS_BORDER flag in full screen mode to enable other top level windows inside the application to appear on top when required.

Note: The setting must be applied before showing the window or switching it to full screen. For QML, setHasBorderInFullScreenDefault() can be used to set a default value.

See also Fullscreen OpenGL Based Windows

This function was introduced in Qt 5.6.

[static] void QWindowsWindowFunctions::setHasBorderInFullScreenDefault(bool border)

This is a convenience function that can be used directly instead of resolving the function pointer. border will be relayed to the function retrieved by QGuiApplication. When border is true, the WS_BORDER flag will be set in full screen mode for all windows by default.

See also Fullscreen OpenGL Based Windows

This function was introduced in Qt 5.13.

See also setHasBorderInFullScreen().

[static] const QByteArray QWindowsWindowFunctions::setHasBorderInFullScreenDefaultIdentifier()

This function returns the bytearray that can be used to query QGuiApplication::platformFunction to retrieve the SetHasBorderInFullScreen function.

This function was introduced in Qt 5.13.

[static] const QByteArray QWindowsWindowFunctions::setHasBorderInFullScreenIdentifier()

This function returns the bytearray that can be used to query QGuiApplication::platformFunction to retrieve the SetHasBorderInFullScreen function.

This function was introduced in Qt 5.6.

[static] void QWindowsWindowFunctions::setTouchWindowTouchType(QWindow *window, QWindowsWindowFunctions::TouchWindowTouchTypes type)

This is a convenience function that can be used directly instead of resolving the function pointer. window and type will be relayed to the function retrieved by QGuiApplication

[static] const QByteArray QWindowsWindowFunctions::setTouchWindowTouchTypeIdentifier()

This function returns the bytearray that can be used to query QGuiApplication::platformFunction to retrieve the SetTouchWindowTouchType function.

[static] void QWindowsWindowFunctions::setWindowActivationBehavior(QWindowsWindowFunctions::WindowActivationBehavior behavior)

This is a convenience function that can be used directly instead of resolving the function pointer. behavior will be relayed to the function retrieved by QGuiApplication.

This function was introduced in Qt 5.7.

See also QWidget::activateWindow() and QWindow::requestActivate().

[static] const QByteArray QWindowsWindowFunctions::setWindowActivationBehaviorIdentifier()

This function returns a bytearray that can be used to query QGuiApplication::platformFunction() to retrieve the SetWindowActivationBehaviorType function.

This function was introduced in Qt 5.7.

See also QWidget::activateWindow() and QWindow::requestActivate().