Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
QWindowsIntegration Class Reference

#include <qwindowsintegration.h>

Inheritance diagram for QWindowsIntegration:
Collaboration diagram for QWindowsIntegration:

Public Types

enum  Options {
  FontDatabaseFreeType = 0x1 , FontDatabaseNative = 0x2 , DisableArb = 0x4 , NoNativeDialogs = 0x8 ,
  XpNativeDialogs = 0x10 , DontPassOsMouseEventsSynthesizedFromTouch = 0x20 , DontUseDirectWriteFonts = QWindowsFontDatabase::DontUseDirectWriteFonts , DontUseColorFonts = QWindowsFontDatabase::DontUseColorFonts ,
  AlwaysUseNativeMenus = 0x100 , NoNativeMenus = 0x200 , DetectAltGrModifier = 0x400 , RtlEnabled = 0x0800 ,
  FontDatabaseGDI = 0x1000
}
Public Types inherited from QPlatformIntegration
enum  Capability {
  ThreadedPixmaps = 1 , OpenGL , ThreadedOpenGL , SharedGraphicsCache ,
  BufferQueueingOpenGL , WindowMasks , MultipleWindows , ApplicationState ,
  ForeignWindows , NonFullScreenWindows , NativeWidgets , WindowManagement ,
  WindowActivation , SyncState , AllGLFunctionsQueryable , ApplicationIcon ,
  SwitchableWidgetComposition , TopStackedNativeChildWindows , OpenGLOnRasterSurface , MaximizeUsingFullscreenGeometry ,
  PaintEvents , RhiBasedRendering , ScreenWindowGrabbing , BackingStoreStaticContents
}
 Capabilities are used to determine specific features of a platform integration. More...
enum  StyleHint {
  CursorFlashTime , KeyboardInputInterval , MouseDoubleClickInterval , StartDragDistance ,
  StartDragTime , KeyboardAutoRepeatRate , ShowIsFullScreen , PasswordMaskDelay ,
  FontSmoothingGamma , StartDragVelocity , UseRtlExtensions , PasswordMaskCharacter ,
  SetFocusOnTouchRelease , ShowIsMaximized , MousePressAndHoldInterval , TabFocusBehavior ,
  ReplayMousePressOutsidePopup , ItemViewActivateItemOnSingleClick , UiEffects , WheelScrollLines ,
  ShowShortcutsInContextMenus , MouseQuickSelectionThreshold , MouseDoubleClickDistance , FlickStartDistance ,
  FlickMaximumVelocity , FlickDeceleration , UnderlineShortcut
}

Public Member Functions

 QWindowsIntegration (const QStringList &paramList)
 ~QWindowsIntegration () override
bool hasCapability (QPlatformIntegration::Capability cap) const override
QPlatformWindowcreatePlatformWindow (QWindow *window) const override
 Factory function for QPlatformWindow.
QPlatformWindowcreateForeignWindow (QWindow *window, WId nativeHandle) const override
QPlatformOpenGLContextcreatePlatformOpenGLContext (QOpenGLContext *context) const override
 Factory function for QPlatformOpenGLContext.
QOpenGLContext::OpenGLModuleType openGLModuleType () override
 Platform integration function for querying the OpenGL implementation type.
HMODULE openGLModuleHandle () const override
QOpenGLContextcreateOpenGLContext (HGLRC context, HWND window, QOpenGLContext *shareContext) const override
QAbstractEventDispatchercreateEventDispatcher () const override
 Factory function for the GUI event dispatcher.
void initialize () override
 Performs initialization steps that depend on having an event dispatcher available.
QPlatformInputContextinputContext () const override
 Returns the platforms input context.
QPlatformFontDatabasefontDatabase () const override
 Accessor for the platform integration's fontdatabase.
QStringList themeNames () const override
QPlatformThemecreatePlatformTheme (const QString &name) const override
QPlatformServicesservices () const override
QVariant styleHint (StyleHint hint) const override
QPlatformKeyMapperkeyMapper () const override
 Accessor for the platform integration's key mapper.
unsigned options () const
void beep () const override
void setApplicationBadge (qint64 number) override
void setApplicationBadge (const QImage &image)
void updateApplicationBadge ()
Public Member Functions inherited from QPlatformIntegration
virtual ~QPlatformIntegration ()
virtual QPlatformPixmapcreatePlatformPixmap (QPlatformPixmap::PixelType type) const
 Factory function for QPlatformPixmap.
virtual QPlatformBackingStorecreatePlatformBackingStore (QWindow *window) const =0
 Factory function for QPlatformBackingStore.
virtual QPlatformSharedGraphicsCachecreatePlatformSharedGraphicsCache (const char *cacheId) const
 Factory function for QPlatformSharedGraphicsCache.
virtual QPaintEnginecreateImagePaintEngine (QPaintDevice *paintDevice) const
 Factory function for QPaintEngine.
virtual void destroy ()
 Called before the platform integration is deleted.
virtual QPlatformClipboardclipboard () const
 Accessor for the platform integration's clipboard.
virtual QPlatformNativeInterfacenativeInterface () const
virtual Qt::WindowState defaultWindowState (Qt::WindowFlags) const
virtual QPlatformOffscreenSurfacecreatePlatformOffscreenSurface (QOffscreenSurface *surface) const
 Factory function for QOffscreenSurface.
virtual QPlatformSessionManagercreatePlatformSessionManager (const QString &id, const QString &key) const
virtual void sync ()
virtual void setApplicationIcon (const QIcon &icon) const
virtual void quit () const
template<auto func, typename... Args>
auto call (Args... args)
Public Member Functions inherited from QWindowsApplication
void setTouchWindowTouchType (TouchWindowTouchTypes type) override
TouchWindowTouchTypes touchWindowTouchType () const override
WindowActivationBehavior windowActivationBehavior () const override
void setWindowActivationBehavior (WindowActivationBehavior behavior) override
void setHasBorderInFullScreenDefault (bool border) override
bool isTabletMode () const override
bool isWinTabEnabled () const override
bool setWinTabEnabled (bool enabled) override
DarkModeHandling darkModeHandling () const override
void setDarkModeHandling (DarkModeHandling handling) override
void registerMime (QWindowsMimeConverter *mime) override
void unregisterMime (QWindowsMimeConverter *mime) override
int registerMimeType (const QString &mime) override
HWND createMessageWindow (const QString &classNameTemplate, const QString &windowName, QFunctionPointer eventProc=nullptr) const override
bool asyncExpose () const override
void setAsyncExpose (bool value) override
QVariant gpu () const override
QVariant gpuList () const override
void populateLightSystemPalette (QPalette &palette) const override

Static Public Member Functions

static QWindowsStaticOpenGLContextstaticOpenGLContext ()
static QWindowsIntegrationinstance ()

Protected Member Functions

virtual QWindowsWindowcreatePlatformWindowHelper (QWindow *window, const QWindowsWindowData &) const
Protected Member Functions inherited from QPlatformIntegration
virtual Qt::KeyboardModifiers queryKeyboardModifiers () const
virtual QList< int > possibleKeys (const QKeyEvent *) const
 Should be used to obtain a list of possible shortcuts for the given key event.
 QPlatformIntegration ()=default

Detailed Description

Definition at line 25 of file qwindowsintegration.h.

Member Enumeration Documentation

◆ Options

Enumerator
FontDatabaseFreeType 
FontDatabaseNative 
DisableArb 
NoNativeDialogs 
XpNativeDialogs 
DontPassOsMouseEventsSynthesizedFromTouch 
DontUseDirectWriteFonts 
DontUseColorFonts 
AlwaysUseNativeMenus 
NoNativeMenus 
DetectAltGrModifier 
RtlEnabled 
FontDatabaseGDI 

Definition at line 33 of file qwindowsintegration.h.

Constructor & Destructor Documentation

◆ QWindowsIntegration()

QWindowsIntegration::QWindowsIntegration ( const QStringList & paramList)
explicit

Definition at line 234 of file qwindowsintegration.cpp.

References QWindowsIntegration().

Referenced by QWindowsIntegration().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ~QWindowsIntegration()

QWindowsIntegration::~QWindowsIntegration ( )
override

Definition at line 246 of file qwindowsintegration.cpp.

Member Function Documentation

◆ beep()

void QWindowsIntegration::beep ( ) const
overridevirtual
Since
5.7

Should sound a bell, using the default volume and sound.

See also
QApplication::beep()

Reimplemented from QPlatformIntegration.

Definition at line 602 of file qwindowsintegration.cpp.

◆ createEventDispatcher()

QAbstractEventDispatcher * QWindowsIntegration::createEventDispatcher ( ) const
overridevirtual

Factory function for the GUI event dispatcher.

The platform plugin should create and return a QAbstractEventDispatcher subclass when this function is called.

If the platform plugin for some reason creates the event dispatcher outside of this function (for example in the constructor), it needs to handle the case where this function is never called, ensuring that the event dispatcher is still deleted at some point (typically in the destructor).

Note that the platform plugin should never explicitly set the event dispatcher itself, using QCoreApplication::setEventDispatcher(), but let QCoreApplication decide when and which event dispatcher to create.

Since
5.2

Implements QPlatformIntegration.

Definition at line 577 of file qwindowsintegration.cpp.

◆ createForeignWindow()

QPlatformWindow * QWindowsIntegration::createForeignWindow ( QWindow * window,
WId nativeHandle ) const
overridevirtual

Reimplemented from QPlatformIntegration.

Definition at line 334 of file qwindowsintegration.cpp.

◆ createOpenGLContext()

QOpenGLContext * QWindowsIntegration::createOpenGLContext ( HGLRC context,
HWND window,
QOpenGLContext * shareContext ) const
override

Definition at line 442 of file qwindowsintegration.cpp.

References staticOpenGLContext().

Here is the call graph for this function:

◆ createPlatformOpenGLContext()

QPlatformOpenGLContext * QWindowsIntegration::createPlatformOpenGLContext ( QOpenGLContext * context) const
overridevirtual

Factory function for QPlatformOpenGLContext.

The context parameter is a pointer to the context for which a platform-specific context backend needs to be created. Configuration settings like the format, share context and screen have to be taken from this QOpenGLContext and the resulting platform context is expected to be backed by a native context that fulfills these criteria.

If the context has native handles set, no new native context is expected to be created. Instead, the provided handles have to be used. In this case the ownership of the handle must not be taken and the platform implementation is not allowed to destroy the native context. Configuration parameters like the format are also to be ignored. Instead, the platform implementation is responsible for querying the configuriation from the provided native context.

Returns a pointer to a QPlatformOpenGLContext instance or \nullptr if the context could not be created.

See also
QOpenGLContext

Reimplemented from QPlatformIntegration.

Definition at line 412 of file qwindowsintegration.cpp.

References staticOpenGLContext().

Here is the call graph for this function:

◆ createPlatformTheme()

QPlatformTheme * QWindowsIntegration::createPlatformTheme ( const QString & name) const
overridevirtual

Reimplemented from QPlatformIntegration.

Definition at line 587 of file qwindowsintegration.cpp.

References QWindowsTheme::name.

◆ createPlatformWindow()

QPlatformWindow * QWindowsIntegration::createPlatformWindow ( QWindow * window) const
overridevirtual

Factory function for QPlatformWindow.

The window parameter is a pointer to the window which the QPlatformWindow is supposed to be created for.

All windows have to have a QPlatformWindow, and it will be created on-demand when the QWindow is made visible for the first time, or explicitly through calling QWindow::create().

In the constructor, of the QPlatformWindow, the window flags, state, title and geometry of the window should be applied to the underlying window. If the resulting flags or state differs, the resulting values should be set on the window using QWindow::setWindowFlags() or QWindow::setWindowState(), respectively.

See also
QPlatformWindow, QPlatformWindowFormat
createPlatformBackingStore()

Implements QPlatformIntegration.

Definition at line 294 of file qwindowsintegration.cpp.

References QWindowsWindow::DisableNonClientScaling, QWindowsMenuBar::install(), and QWindowsWindow::setFlag().

Here is the call graph for this function:

◆ createPlatformWindowHelper()

QWindowsWindow * QWindowsIntegration::createPlatformWindowHelper ( QWindow * window,
const QWindowsWindowData & data ) const
protectedvirtual

Reimplemented in QWindowsDirect2DIntegration.

Definition at line 354 of file qwindowsintegration.cpp.

◆ fontDatabase()

QPlatformFontDatabase * QWindowsIntegration::fontDatabase ( ) const
overridevirtual

Accessor for the platform integration's fontdatabase.

Default implementation returns a default QPlatformFontDatabase.

See also
QPlatformFontDatabase

Reimplemented from QPlatformIntegration.

Definition at line 474 of file qwindowsintegration.cpp.

◆ hasCapability()

bool QWindowsIntegration::hasCapability ( QPlatformIntegration::Capability cap) const
overridevirtual

Reimplemented from QPlatformIntegration.

Definition at line 258 of file qwindowsintegration.cpp.

References staticOpenGLContext(), and QWindowsStaticOpenGLContext::supportsThreadedOpenGL().

Here is the call graph for this function:

◆ initialize()

void QWindowsIntegration::initialize ( )
overridevirtual

Performs initialization steps that depend on having an event dispatcher available.

Called after the event dispatcher has been created.

Tasks that require an event dispatcher, for example creating socket notifiers, cannot be performed in the constructor. Instead, they should be performed here. The default implementation does nothing.

Reimplemented from QPlatformIntegration.

Definition at line 251 of file qwindowsintegration.cpp.

◆ inputContext()

QPlatformInputContext * QWindowsIntegration::inputContext ( ) const
overridevirtual

Returns the platforms input context.

The default implementation returns \nullptr, implying no input method support.

Reimplemented from QPlatformIntegration.

Definition at line 553 of file qwindowsintegration.cpp.

◆ instance()

QWindowsIntegration * QWindowsIntegration::instance ( )
inlinestatic

◆ keyMapper()

QPlatformKeyMapper * QWindowsIntegration::keyMapper ( ) const
overridevirtual

Accessor for the platform integration's key mapper.

Default implementation returns a default QPlatformKeyMapper.

See also
QPlatformKeyMapper

Reimplemented from QPlatformIntegration.

Definition at line 535 of file qwindowsintegration.cpp.

◆ openGLModuleHandle()

HMODULE QWindowsIntegration::openGLModuleHandle ( ) const
override

Definition at line 434 of file qwindowsintegration.cpp.

References QWindowsStaticOpenGLContext::moduleHandle(), and staticOpenGLContext().

Here is the call graph for this function:

◆ openGLModuleType()

QOpenGLContext::OpenGLModuleType QWindowsIntegration::openGLModuleType ( )
overridevirtual

Platform integration function for querying the OpenGL implementation type.

Used only when dynamic OpenGL implementation loading is enabled.

Subclasses should reimplement this function and return a value based on the OpenGL implementation they have chosen to load.

Note
The return value does not indicate or limit the types of contexts that can be created by a given implementation. For example a desktop OpenGL implementation may be capable of creating OpenGL ES-compatible contexts too.
See also
QOpenGLContext::openGLModuleType(), QOpenGLContext::isOpenGLES()
Since
5.3

Reimplemented from QPlatformIntegration.

Definition at line 423 of file qwindowsintegration.cpp.

◆ options()

unsigned QWindowsIntegration::options ( ) const

◆ services()

QPlatformServices * QWindowsIntegration::services ( ) const
overridevirtual

Reimplemented from QPlatformIntegration.

Definition at line 594 of file qwindowsintegration.cpp.

◆ setApplicationBadge() [1/2]

void QWindowsIntegration::setApplicationBadge ( const QImage & image)

Definition at line 715 of file qwindowsintegration.cpp.

◆ setApplicationBadge() [2/2]

void QWindowsIntegration::setApplicationBadge ( qint64 number)
overridevirtual
Since
6.5

Should set the application's badge to number.

If the number is 0 the badge should be cleared.

See also
QGuiApplication::setBadge()

Reimplemented from QPlatformIntegration.

Definition at line 607 of file qwindowsintegration.cpp.

◆ staticOpenGLContext()

QWindowsStaticOpenGLContext * QWindowsIntegration::staticOpenGLContext ( )
static

Definition at line 461 of file qwindowsintegration.cpp.

References instance().

Referenced by createOpenGLContext(), createPlatformOpenGLContext(), hasCapability(), QWindowsWindow::invalidateSurface(), QWindowsNativeInterface::nativeResourceForIntegration(), and openGLModuleHandle().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ styleHint()

QVariant QWindowsIntegration::styleHint ( QPlatformIntegration::StyleHint hint) const
overridevirtual

Reimplemented from QPlatformIntegration.

Definition at line 502 of file qwindowsintegration.cpp.

◆ themeNames()

QStringList QWindowsIntegration::themeNames ( ) const
overridevirtual

Reimplemented from QPlatformIntegration.

Definition at line 582 of file qwindowsintegration.cpp.

References QWindowsTheme::name.

◆ updateApplicationBadge()

void QWindowsIntegration::updateApplicationBadge ( )

Definition at line 750 of file qwindowsintegration.cpp.

Referenced by QWindowsTheme::handleThemeChange(), and QWindowsContext::windowsProc().

Here is the caller graph for this function:

The documentation for this class was generated from the following files: