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
QWindowsContext Class Reference

Singleton container for all relevant information. More...

#include <qwindowscontext.h>

Collaboration diagram for QWindowsContext:

Public Types

enum  SystemInfoFlags { SI_RTL_Extensions = 0x1 , SI_SupportsTouch = 0x2 }
using HandleBaseWindowHash = QHash<HWND, QWindowsWindow *>

Public Member Functions

 QWindowsContext ()
 ~QWindowsContext ()
bool initTouch ()
bool initTouch (unsigned integrationOptions)
void registerTouchWindows ()
bool initTablet ()
bool disposeTablet ()
bool initPowerNotificationHandler ()
int defaultDPI () const
HWND createDummyWindow (const QString &classNameIn, const wchar_t *windowName, WNDPROC wndProc=nullptr, DWORD style=WS_OVERLAPPED)
 Convenience to create a non-visible, message-only dummy window for example used as clipboard watcher or for GL.
HDC displayContext () const
int screenDepth () const
void addWindow (HWND, QWindowsWindow *w)
void removeWindow (HWND)
QWindowsWindowfindClosestPlatformWindow (HWND) const
QWindowsWindowfindPlatformWindow (HWND) const
QWindowsWindowfindPlatformWindow (const QWindowsMenuBar *mb) const
QWindowfindWindow (HWND) const
QWindowsWindowfindPlatformWindowAt (HWND parent, const QPoint &screenPoint, unsigned cwex_flags) const
QWindowwindowUnderMouse () const
void clearWindowUnderMouse ()
bool windowsProc (HWND hwnd, UINT message, QtWindows::WindowsEventType et, WPARAM wParam, LPARAM lParam, LRESULT *result, QWindowsWindow **platformWindowPtr)
 Main windows procedure registered for windows.
QWindowkeyGrabber () const
void setKeyGrabber (QWindow *hwnd)
QSharedPointer< QWindowCreationContextsetWindowCreationContext (const QSharedPointer< QWindowCreationContext > &ctx)
QSharedPointer< QWindowCreationContextwindowCreationContext () const
void setDetectAltGrModifier (bool a)
unsigned systemInfo () const
bool useRTLExtensions () const
QPlatformKeyMapperkeyMapper () const
HandleBaseWindowHashwindows ()
QWindowsMimeRegistrymimeConverter () const
QWindowsScreenManagerscreenManager ()
QWindowsTabletSupporttabletSupport () const
bool asyncExpose () const
void setAsyncExpose (bool value)

Static Public Member Functions

static QWindowsContextinstance ()
static bool shouldHaveNonClientDpiScaling (const QWindow *window)
static void setTabletAbsoluteRange (int a)
static bool setProcessDpiAwareness (QtWindows::DpiAwareness dpiAwareness)
static QtWindows::DpiAwareness processDpiAwareness ()
static QtWindows::DpiAwareness windowDpiAwareness (HWND hwnd)
static bool isSessionLocked ()
static void forceNcCalcSize (HWND hwnd)
static bool systemParametersInfo (unsigned action, unsigned param, void *out, unsigned dpi=0)
static bool systemParametersInfoForScreen (unsigned action, unsigned param, void *out, const QPlatformScreen *screen=nullptr)
static bool systemParametersInfoForWindow (unsigned action, unsigned param, void *out, const QPlatformWindow *win=nullptr)
static bool nonClientMetrics (NONCLIENTMETRICS *ncm, unsigned dpi=0)
static bool nonClientMetricsForScreen (NONCLIENTMETRICS *ncm, const QPlatformScreen *screen=nullptr)
static bool nonClientMetricsForWindow (NONCLIENTMETRICS *ncm, const QPlatformWindow *win=nullptr)
static DWORD readAdvancedExplorerSettings (const wchar_t *subKey, DWORD defaultValue)
static bool filterNativeEvent (MSG *msg, LRESULT *result)
static bool filterNativeEvent (QWindow *window, MSG *msg, LRESULT *result)

Static Public Attributes

static int verbose = 0

Detailed Description

Singleton container for all relevant information.

Holds state information formerly stored in qapplication_win.cpp.

Definition at line 49 of file qwindowscontext.h.

Member Typedef Documentation

◆ HandleBaseWindowHash

Definition at line 53 of file qwindowscontext.h.

Member Enumeration Documentation

◆ SystemInfoFlags

Enumerator
SI_RTL_Extensions 
SI_SupportsTouch 

Definition at line 55 of file qwindowscontext.h.

Constructor & Destructor Documentation

◆ QWindowsContext()

QWindowsContext::QWindowsContext ( )
explicit

Definition at line 179 of file qwindowscontext.cpp.

References QWindowsContext().

Referenced by QWindowsContext().

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

◆ ~QWindowsContext()

QWindowsContext::~QWindowsContext ( )

Definition at line 185 of file qwindowscontext.cpp.

References QWindowsTheme::instance().

Here is the call graph for this function:

Member Function Documentation

◆ addWindow()

void QWindowsContext::addWindow ( HWND hwnd,
QWindowsWindow * w )

Definition at line 512 of file qwindowscontext.cpp.

◆ asyncExpose()

bool QWindowsContext::asyncExpose ( ) const

Definition at line 1292 of file qwindowscontext.cpp.

Referenced by QWindowsApplication::asyncExpose().

Here is the caller graph for this function:

◆ clearWindowUnderMouse()

void QWindowsContext::clearWindowUnderMouse ( )

Definition at line 570 of file qwindowscontext.cpp.

◆ createDummyWindow()

HWND QWindowsContext::createDummyWindow ( const QString & classNameIn,
const wchar_t * windowName,
WNDPROC wndProc = nullptr,
DWORD style = WS_OVERLAPPED )

Convenience to create a non-visible, message-only dummy window for example used as clipboard watcher or for GL.

Definition at line 694 of file qwindowscontext.cpp.

◆ defaultDPI()

int QWindowsContext::defaultDPI ( ) const

Definition at line 487 of file qwindowscontext.cpp.

Referenced by QWindowsTheme::themeHint().

Here is the caller graph for this function:

◆ displayContext()

HDC QWindowsContext::displayContext ( ) const

Definition at line 492 of file qwindowscontext.cpp.

◆ disposeTablet()

bool QWindowsContext::disposeTablet ( )

Definition at line 260 of file qwindowscontext.cpp.

Referenced by QWindowsApplication::setWinTabEnabled().

Here is the caller graph for this function:

◆ filterNativeEvent() [1/2]

bool QWindowsContext::filterNativeEvent ( MSG * msg,
LRESULT * result )
static

Definition at line 1391 of file qwindowscontext.cpp.

◆ filterNativeEvent() [2/2]

bool QWindowsContext::filterNativeEvent ( QWindow * window,
MSG * msg,
LRESULT * result )
static

Definition at line 1403 of file qwindowscontext.cpp.

◆ findClosestPlatformWindow()

QWindowsWindow * QWindowsContext::findClosestPlatformWindow ( HWND hwnd) const

Definition at line 541 of file qwindowscontext.cpp.

◆ findPlatformWindow() [1/2]

QWindowsWindow * QWindowsContext::findPlatformWindow ( const QWindowsMenuBar * mb) const

Definition at line 527 of file qwindowscontext.cpp.

Referenced by findPlatformWindowAt(), findPlatformWindowHelper(), findWindow(), and windowsProc().

Here is the caller graph for this function:

◆ findPlatformWindow() [2/2]

QWindowsWindow * QWindowsContext::findPlatformWindow ( HWND hwnd) const

Definition at line 536 of file qwindowscontext.cpp.

◆ findPlatformWindowAt()

QWindowsWindow * QWindowsContext::findPlatformWindowAt ( HWND parent,
const QPoint & screenPoint,
unsigned cwex_flags ) const

Definition at line 623 of file qwindowscontext.cpp.

References findPlatformWindow().

Here is the call graph for this function:

◆ findWindow()

QWindow * QWindowsContext::findWindow ( HWND hwnd) const

Definition at line 558 of file qwindowscontext.cpp.

References findPlatformWindow().

Here is the call graph for this function:

◆ forceNcCalcSize()

void QWindowsContext::forceNcCalcSize ( HWND hwnd)
static

Definition at line 708 of file qwindowscontext.cpp.

◆ initPowerNotificationHandler()

bool QWindowsContext::initPowerNotificationHandler ( )

Definition at line 301 of file qwindowscontext.cpp.

◆ initTablet()

bool QWindowsContext::initTablet ( )

Definition at line 250 of file qwindowscontext.cpp.

Referenced by QWindowsApplication::setWinTabEnabled().

Here is the caller graph for this function:

◆ initTouch() [1/2]

bool QWindowsContext::initTouch ( )

Definition at line 213 of file qwindowscontext.cpp.

References initTouch(), QWindowsIntegration::instance(), and QWindowsIntegration::options().

Referenced by windowsProc().

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

◆ initTouch() [2/2]

bool QWindowsContext::initTouch ( unsigned integrationOptions)

Definition at line 218 of file qwindowscontext.cpp.

References registerTouchWindows().

Referenced by initTouch().

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

◆ instance()

QWindowsContext * QWindowsContext::instance ( )
static

Definition at line 450 of file qwindowscontext.cpp.

Referenced by QWindowsWindow::QWindowsWindow(), applyNewCursor(), QWindowsApplication::asyncExpose(), QWindowsWindow::checkForScreenChanged(), QWindowsCursor::clearOverrideCursor(), QWindowsTabletSupport::create(), WindowCreationData::create(), QWindowsOleDropSource::createCursors(), createDummyGLWindow(), QWindowsApplication::createMessageWindow(), QWindowsOleDataObject::EnumFormatEtc(), QWindowsInternalMimeData::formats_sys(), QWindowsGeometryHint::frame(), QWindowsGeometryHint::frame(), QWindowsOleDataObject::GetData(), QWindowsScreen::grabWindow(), QWindowsInternalMimeData::hasFormat_sys(), QWindowsWindow::initialize(), QWindowsScreenManager::isSingleScreen(), QWindowsApplication::isWinTabEnabled(), QWindowsOleDataObject::QueryGetData(), QWindowsApplication::registerMime(), QWindowsWindow::registerTouchWindow(), QWindowsInternalMimeData::retrieveData_sys(), QWindowsApplication::setAsyncExpose(), QWindowsWindow::setKeyboardGrabEnabled(), QWindowsApplication::setTouchWindowTouchType(), QWindowsApplication::setWinTabEnabled(), startDoDragDrop(), QWindowsTheme::themeHint(), QWindowsWindow::topLevelOf(), QWindowsPointerHandler::translateMouseEvent(), QWindowsTabletSupport::translateTabletPacketEvent(), QWindowsApplication::unregisterMime(), QWindowsScreen::virtualSiblings(), QWindowsScreen::windowAt(), windowPlacementOffset(), and QWindowsSystemTrayIcon::winEvent().

Here is the caller graph for this function:

◆ isSessionLocked()

bool QWindowsContext::isSessionLocked ( )
static

Definition at line 639 of file qwindowscontext.cpp.

◆ keyGrabber()

QWindow * QWindowsContext::keyGrabber ( ) const

Definition at line 497 of file qwindowscontext.cpp.

◆ keyMapper()

QPlatformKeyMapper * QWindowsContext::keyMapper ( ) const

Definition at line 465 of file qwindowscontext.cpp.

Referenced by QWindowsPointerHandler::translateMouseEvent(), and QWindowsTabletSupport::translateTabletPacketEvent().

Here is the caller graph for this function:

◆ mimeConverter()

QWindowsMimeRegistry & QWindowsContext::mimeConverter ( ) const

◆ nonClientMetrics()

bool QWindowsContext::nonClientMetrics ( NONCLIENTMETRICS * ncm,
unsigned dpi = 0 )
static

Definition at line 736 of file qwindowscontext.cpp.

References systemParametersInfo().

Here is the call graph for this function:

◆ nonClientMetricsForScreen()

bool QWindowsContext::nonClientMetricsForScreen ( NONCLIENTMETRICS * ncm,
const QPlatformScreen * screen = nullptr )
static

Definition at line 743 of file qwindowscontext.cpp.

◆ nonClientMetricsForWindow()

bool QWindowsContext::nonClientMetricsForWindow ( NONCLIENTMETRICS * ncm,
const QPlatformWindow * win = nullptr )
static

Definition at line 750 of file qwindowscontext.cpp.

◆ processDpiAwareness()

QtWindows::DpiAwareness QWindowsContext::processDpiAwareness ( )
static

Definition at line 360 of file qwindowscontext.cpp.

Referenced by QWindowsScreen::grabWindow(), and setProcessDpiAwareness().

Here is the caller graph for this function:

◆ readAdvancedExplorerSettings()

DWORD QWindowsContext::readAdvancedExplorerSettings ( const wchar_t * subKey,
DWORD defaultValue )
static

Definition at line 1302 of file qwindowscontext.cpp.

◆ registerTouchWindows()

void QWindowsContext::registerTouchWindows ( )

Definition at line 241 of file qwindowscontext.cpp.

Referenced by initTouch(), and QWindowsApplication::setTouchWindowTouchType().

Here is the caller graph for this function:

◆ removeWindow()

void QWindowsContext::removeWindow ( HWND hwnd)

Definition at line 517 of file qwindowscontext.cpp.

◆ screenDepth()

int QWindowsContext::screenDepth ( ) const

Definition at line 507 of file qwindowscontext.cpp.

◆ screenManager()

QWindowsScreenManager & QWindowsContext::screenManager ( )

Definition at line 675 of file qwindowscontext.cpp.

Referenced by QWindowsWindow::checkForScreenChanged(), QWindowsOleDropSource::createCursors(), QWindowsGeometryHint::frame(), QWindowsGeometryHint::frame(), QWindowsScreenManager::isSingleScreen(), QWindowsScreen::virtualSiblings(), windowPlacementOffset(), and QWindowsSystemTrayIcon::winEvent().

Here is the caller graph for this function:

◆ setAsyncExpose()

void QWindowsContext::setAsyncExpose ( bool value)

Definition at line 1297 of file qwindowscontext.cpp.

Referenced by QWindowsApplication::setAsyncExpose().

Here is the caller graph for this function:

◆ setDetectAltGrModifier()

void QWindowsContext::setDetectAltGrModifier ( bool a)

Definition at line 328 of file qwindowscontext.cpp.

◆ setKeyGrabber()

void QWindowsContext::setKeyGrabber ( QWindow * hwnd)

Definition at line 502 of file qwindowscontext.cpp.

◆ setProcessDpiAwareness()

bool QWindowsContext::setProcessDpiAwareness ( QtWindows::DpiAwareness dpiAwareness)
static

Definition at line 423 of file qwindowscontext.cpp.

References QWindowsContextPrivate::m_v2DpiAware, QtWindows::PerMonitorVersion2, and processDpiAwareness().

Here is the call graph for this function:

◆ setTabletAbsoluteRange()

void QWindowsContext::setTabletAbsoluteRange ( int a)
static

Definition at line 319 of file qwindowscontext.cpp.

Referenced by QWindowsIntegrationPrivate::parseOptions().

Here is the caller graph for this function:

◆ setWindowCreationContext()

QSharedPointer< QWindowCreationContext > QWindowsContext::setWindowCreationContext ( const QSharedPointer< QWindowCreationContext > & ctx)

Definition at line 475 of file qwindowscontext.cpp.

◆ shouldHaveNonClientDpiScaling()

bool QWindowsContext::shouldHaveNonClientDpiScaling ( const QWindow * window)
static

◆ systemInfo()

unsigned QWindowsContext::systemInfo ( ) const

Definition at line 455 of file qwindowscontext.cpp.

Referenced by QWindowsWindow::registerTouchWindow().

Here is the caller graph for this function:

◆ systemParametersInfo()

bool QWindowsContext::systemParametersInfo ( unsigned action,
unsigned param,
void * out,
unsigned dpi = 0 )
static

Definition at line 715 of file qwindowscontext.cpp.

Referenced by nonClientMetrics(), and systemParametersInfoForScreen().

Here is the caller graph for this function:

◆ systemParametersInfoForScreen()

bool QWindowsContext::systemParametersInfoForScreen ( unsigned action,
unsigned param,
void * out,
const QPlatformScreen * screen = nullptr )
static

Definition at line 724 of file qwindowscontext.cpp.

References systemParametersInfo().

Referenced by systemParametersInfoForWindow().

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

◆ systemParametersInfoForWindow()

bool QWindowsContext::systemParametersInfoForWindow ( unsigned action,
unsigned param,
void * out,
const QPlatformWindow * win = nullptr )
static

Definition at line 730 of file qwindowscontext.cpp.

References systemParametersInfoForScreen().

Here is the call graph for this function:

◆ tabletSupport()

QWindowsTabletSupport * QWindowsContext::tabletSupport ( ) const

Definition at line 680 of file qwindowscontext.cpp.

Referenced by QWindowsApplication::isWinTabEnabled().

Here is the caller graph for this function:

◆ useRTLExtensions()

bool QWindowsContext::useRTLExtensions ( ) const

Definition at line 460 of file qwindowscontext.cpp.

◆ windowCreationContext()

QSharedPointer< QWindowCreationContext > QWindowsContext::windowCreationContext ( ) const

Definition at line 482 of file qwindowscontext.cpp.

◆ windowDpiAwareness()

QtWindows::DpiAwareness QWindowsContext::windowDpiAwareness ( HWND hwnd)
static

Definition at line 352 of file qwindowscontext.cpp.

References QtWindows::Invalid.

◆ windows()

QWindowsContext::HandleBaseWindowHash & QWindowsContext::windows ( )

Definition at line 470 of file qwindowscontext.cpp.

◆ windowsProc()

bool QWindowsContext::windowsProc ( HWND hwnd,
UINT message,
QtWindows::WindowsEventType et,
WPARAM wParam,
LPARAM lParam,
LRESULT * result,
QWindowsWindow ** platformWindowPtr )
inline

Main windows procedure registered for windows.

See also
QWindowsGuiEventDispatcher

Definition at line 823 of file qwindowscontext.cpp.

References QtWindows::AccessibleObjectFromWindowRequest, QtWindows::ActivateWindowEvent, QWindowsWindow::alertWindow(), QWindowsWindow::BlockedByModal, QtWindows::CalculateSize, QWindowsWindow::clearFlag(), QtWindows::ClipboardEvent, QtWindows::CompositionSettingsChanged, QtWindows::CursorEvent, QtWindows::DestroyEvent, QtWindows::DeviceChangeEvent, QtWindows::DpiChangedAfterParentEvent, QtWindows::DpiChangedEvent, QtWindows::DpiScaledSizeEvent, QWindowsCursor::enforceOverrideCursor(), QtWindows::EnterSizeMoveEvent, QtWindows::ExitSizeMoveEvent, QtWindows::ExposeEvent, findPlatformWindow(), QtWindows::FocusInEvent, QtWindows::FocusOutEvent, QWindowsWindow::frameStrutEventsEnabled(), QtWindows::GeometryChangingEvent, QtWindows::GestureEvent, QWindowsWindow::handleCompositionSettingsChanged(), QWindowsWindow::handleHidden(), QWindowsWindow::handleMoved(), QWindowsCursor::hasOverrideCursor(), QtWindows::HideEvent, initTouch(), QtWindows::InputLanguageChangeEvent, QtWindows::InputMethodCloseCandidateWindowEvent, QtWindows::InputMethodCompositionEvent, QtWindows::InputMethodEndCompositionEvent, QtWindows::InputMethodEventFlag, QtWindows::InputMethodOpenCandidateWindowEvent, QtWindows::InputMethodRequest, QtWindows::InputMethodStartCompositionEvent, QWindowsIntegration::instance(), QtWindows::LeaveEvent, QtWindows::MenuAboutToShowEvent, QWindowsWindow::menuBar(), QtWindows::MenuCommandEvent, QtWindows::MouseActivateWindowEvent, QtWindows::MouseEvent, QtWindows::MouseEventFlag, QtWindows::MouseWheelEvent, QtWindows::MoveEvent, QtWindows::NonClientActivate, QtWindows::NonClientCreate, QtWindows::NonClientEventFlag, QtWindows::NonClientHitTest, QtWindows::NonClientMouseEvent, QtWindows::NonClientPointerEvent, QtWindows::PointerActivateWindowEvent, QtWindows::QuerySizeHints, QtWindows::ResizeEvent, QWindowsWindow::ResizeMoveActive, QtWindows::ScrollEvent, sessionManagerInteractionBlocked(), QWindowsWindow::setFlag(), QtWindows::SettingChangedEvent, QWindowsWindow::settingsChanged(), QWindowsInputContext::setWindowsImeEnabled(), QtWindows::ShowEventOnParentRestoring, QtWindows::TaskbarButtonCreated, QWindowsWindow::testFlag(), QtWindows::ThemeChanged, QtWindows::TouchEvent, QtWindows::UnknownEvent, QWindowsIntegration::updateApplicationBadge(), QWindowsWindow::updateCustomTitlebar(), QWindowsWindow::updateRestoreGeometry(), verbose, QtWindows::WhatsThisEvent, windowsInputContext(), and QWindowsWindow::WithinDestroy.

Here is the call graph for this function:

◆ windowUnderMouse()

QWindow * QWindowsContext::windowUnderMouse ( ) const

Definition at line 565 of file qwindowscontext.cpp.

Member Data Documentation

◆ verbose


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