Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
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 , DontUseWMPointer = 0x400 , DetectAltGrModifier = 0x800 ,
  RtlEnabled = 0x1000 , FontDatabaseGDI = 0x2000
}
 
- Public Types inherited from QPlatformIntegration
enum  Capability {
  ThreadedPixmaps = 1 , OpenGL , ThreadedOpenGL , SharedGraphicsCache ,
  BufferQueueingOpenGL , WindowMasks , MultipleWindows , ApplicationState ,
  ForeignWindows , NonFullScreenWindows , NativeWidgets , WindowManagement ,
  WindowActivation , SyncState , RasterGLSurface , 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 
DontUseWMPointer 
DetectAltGrModifier 
RtlEnabled 
FontDatabaseGDI 

Definition at line 33 of file qwindowsintegration.h.

Constructor & Destructor Documentation

◆ QWindowsIntegration()

QWindowsIntegration::QWindowsIntegration ( const QStringList & paramList)
explicit

Definition at line 240 of file qwindowsintegration.cpp.

References DetectAltGrModifier, QWindowsScreenManager::initialize(), QWindowsIntegrationPrivate::m_context, QWindowsIntegrationPrivate::m_options, QWindowsIntegrationPrivate::parseOptions(), QWindowsContext::screenManager(), and QWindowsContext::setDetectAltGrModifier().

+ Here is the call graph for this function:

◆ ~QWindowsIntegration()

QWindowsIntegration::~QWindowsIntegration ( )
override

Definition at line 252 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 609 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 587 of file qwindowsintegration.cpp.

◆ createForeignWindow()

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

Reimplemented from QPlatformIntegration.

Definition at line 344 of file qwindowsintegration.cpp.

References Qt::dec(), Qt::hex(), Qt::noshowbase(), qCDebug, qWarning, screen, Qt::showbase(), and window().

+ Here is the call graph for this function:

◆ createOpenGLContext()

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

Definition at line 452 of file qwindowsintegration.cpp.

References context, QOpenGLContextPrivate::get(), staticOpenGLContext(), and window().

+ 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 422 of file qwindowsintegration.cpp.

References context, qCDebug, and staticOpenGLContext().

+ Here is the call graph for this function:

◆ createPlatformTheme()

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

Reimplemented from QPlatformIntegration.

Definition at line 597 of file qwindowsintegration.cpp.

References QPlatformIntegration::createPlatformTheme(), and QWindowsTheme::name.

+ Here is the call graph for this function:

◆ 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 297 of file qwindowsintegration.cpp.

References QWindowsWindowData::create(), createPlatformWindowHelper(), QWindowsWindowData::customMargins, Qt::dec(), Qt::Desktop, QWindowsWindow::DisableNonClientScaling, QWindowsWindowData::flags, QWindowsWindow::formatWindowTitle(), Qt::FramelessWindowHint, QWindowsWindowData::geometry, Qt::hex(), QWindowsMenuBar::menuBarOf(), Qt::noshowbase(), QWindowsGeometryHint::positionIncludesFrame(), Q_ASSERT, Q_UNLIKELY, qCDebug, QWindowsContext::shouldHaveNonClientDpiScaling(), Qt::showbase(), QHighDpi::toNativeLocalPosition(), QHighDpi::toNativePixels(), and window().

+ 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 364 of file qwindowsintegration.cpp.

References window().

Referenced by createPlatformWindow().

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

◆ 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 484 of file qwindowsintegration.cpp.

References DontUseDirectWriteFonts, FontDatabaseFreeType, FontDatabaseGDI, QWindowsIntegrationPrivate::m_fontDatabase, and QWindowsIntegrationPrivate::m_options.

◆ hasCapability()

◆ 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 257 of file qwindowsintegration.cpp.

References QPlatformInputContextFactory::create(), QWindowsIntegrationPrivate::m_inputContext, QPlatformInputContextFactory::requested(), and QScopedPointer< T, Cleanup >::reset().

+ Here is the call graph for this function:

◆ 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 563 of file qwindowsintegration.cpp.

References QScopedPointer< T, Cleanup >::data(), and QWindowsIntegrationPrivate::m_inputContext.

+ Here is the call graph for this function:

◆ instance()

◆ 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 545 of file qwindowsintegration.cpp.

References QWindowsContext::keyMapper(), and QWindowsIntegrationPrivate::m_context.

+ Here is the call graph for this function:

◆ openGLModuleHandle()

HMODULE QWindowsIntegration::openGLModuleHandle ( ) const
override

Definition at line 444 of file qwindowsintegration.cpp.

References 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 433 of file qwindowsintegration.cpp.

References QOpenGLContext::LibGL, and staticOpenGLContext().

+ Here is the call graph for this function:

◆ options()

unsigned QWindowsIntegration::options ( ) const

Definition at line 575 of file qwindowsintegration.cpp.

References QWindowsIntegrationPrivate::m_options.

◆ services()

QPlatformServices * QWindowsIntegration::services ( ) const
overridevirtual

Reimplemented from QPlatformIntegration.

Definition at line 604 of file qwindowsintegration.cpp.

References QWindowsIntegrationPrivate::m_services.

◆ setApplicationBadge() [1/2]

void QWindowsIntegration::setApplicationBadge ( const QImage & image)

Definition at line 722 of file qwindowsintegration.cpp.

References QGuiApplication::topLevelWindows().

+ Here is the call graph for this function:

◆ 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 614 of file qwindowsintegration.cpp.

References Qt::AlignCenter, QPainter::Antialiasing, Qt::black, QOperatingSystemVersionBase::current(), Qt::Dark, QFont::DemiBold, QPainter::drawEllipse(), QPainter::drawText(), QPainter::end(), QPainter::font(), font, QImage::Format_ARGB32_Premultiplied, QWindowsTheme::instance(), isDarkMode(), QFont::Medium, Qt::NoPen, number, QString::number(), painter, qApp, qCeil(), qMax(), QT_CATCH, QT_TRY, qt_win_hasPackageIdentity(), QColor::setAlphaF(), setApplicationBadge(), QPainter::setBrush(), QPainter::setFont(), QPainter::setPen(), QFont::setPixelSize(), QPainter::setRenderHint(), settings, QFont::setWeight(), text, QPainter::TextAntialiasing, QPainter::translate(), Qt::transparent, Qt::white, and QOperatingSystemVersion::Windows11.

Referenced by setApplicationBadge(), and updateApplicationBadge().

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

◆ staticOpenGLContext()

QWindowsStaticOpenGLContext * QWindowsIntegration::staticOpenGLContext ( )
static

Definition at line 471 of file qwindowsintegration.cpp.

References QWindowsStaticOpenGLContext::create(), d, QScopedPointer< T, Cleanup >::data(), instance(), and lock.

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

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

◆ styleHint()

◆ themeNames()

QStringList QWindowsIntegration::themeNames ( ) const
overridevirtual

Reimplemented from QPlatformIntegration.

Definition at line 592 of file qwindowsintegration.cpp.

References QWindowsTheme::name.

◆ updateApplicationBadge()

void QWindowsIntegration::updateApplicationBadge ( )

Definition at line 759 of file qwindowsintegration.cpp.

References setApplicationBadge().

+ Here is the call graph for this function:

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