Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qwindowsscreen.cpp File Reference
#include "qwindowsscreen.h"
#include "qwindowscontext.h"
#include "qwindowswindow.h"
#include "qwindowsintegration.h"
#include "qwindowscursor.h"
#include "qwindowstheme.h"
#include <QtCore/qt_windows.h>
#include <QtCore/qsettings.h>
#include <QtGui/qpixmap.h>
#include <QtGui/qguiapplication.h>
#include <qpa/qwindowsysteminterface.h>
#include <QtCore/private/qsystemerror_p.h>
#include <QtGui/private/qedidparser_p.h>
#include <private/qhighdpiscaling_p.h>
#include <private/qwindowsfontdatabasebase_p.h>
#include <private/qpixmap_win_p.h>
#include <QtGui/qscreen.h>
#include <QtCore/qdebug.h>
#include <memory>
#include <type_traits>
#include <cfgmgr32.h>
#include <setupapi.h>
#include <shellscalingapi.h>
+ Include dependency graph for qwindowsscreen.cpp:

Go to the source code of this file.

Classes

struct  RegistryHandleDeleter
 

Typedefs

using WindowsScreenDataList = QList< QWindowsScreenData >
 
using RegistryHandlePtr = std::unique_ptr< std::remove_pointer_t< HKEY >, RegistryHandleDeleter >
 

Functions

static QDpi deviceDPI (HDC hdc)
 
static QDpi monitorDPI (HMONITOR hMonitor)
 
static std::vector< DISPLAYCONFIG_PATH_INFO > getPathInfo (const MONITORINFOEX &viewInfo)
 
static void setMonitorDataFromSetupApi (QWindowsScreenData &data, const std::vector< DISPLAYCONFIG_PATH_INFO > &pathGroup)
 
static bool monitorData (HMONITOR hMonitor, QWindowsScreenData *data)
 
BOOL QT_WIN_CALLBACK monitorEnumCallback (HMONITOR hMonitor, HDC, LPRECT, LPARAM p)
 
static WindowsScreenDataList monitorData ()
 
static QDebug operator<< (QDebug dbg, const QWindowsScreenData &d)
 
LRESULT QT_WIN_CALLBACK qDisplayChangeObserverWndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 
static int indexOfMonitor (const QWindowsScreenManager::WindowsScreenList &screens, const QString &serialNumberIn)
 
static int indexOfMonitor (const WindowsScreenDataList &screenData, const QString &serialNumberIn)
 
static void moveToVirtualScreen (QWindow *w, const QScreen *newScreen)
 

Typedef Documentation

◆ RegistryHandlePtr

using RegistryHandlePtr = std::unique_ptr<std::remove_pointer_t<HKEY>, RegistryHandleDeleter>

Definition at line 128 of file qwindowsscreen.cpp.

◆ WindowsScreenDataList

Function Documentation

◆ deviceDPI()

static QDpi deviceDPI ( HDC  hdc)
inlinestatic

Definition at line 38 of file qwindowsscreen.cpp.

Referenced by monitorData().

+ Here is the caller graph for this function:

◆ getPathInfo()

static std::vector< DISPLAYCONFIG_PATH_INFO > getPathInfo ( const MONITORINFOEX &  viewInfo)
static

Definition at line 52 of file qwindowsscreen.cpp.

Referenced by monitorData().

+ Here is the caller graph for this function:

◆ indexOfMonitor() [1/2]

static int indexOfMonitor ( const QWindowsScreenManager::WindowsScreenList screens,
const QString serialNumberIn 
)
inlinestatic

Definition at line 697 of file qwindowsscreen.cpp.

References QList< T >::at(), i, and QList< T >::size().

Referenced by QWindowsScreenManager::handleScreenChanges().

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

◆ indexOfMonitor() [2/2]

static int indexOfMonitor ( const WindowsScreenDataList screenData,
const QString serialNumberIn 
)
inlinestatic

Definition at line 706 of file qwindowsscreen.cpp.

References QList< T >::at(), i, and QList< T >::size().

+ Here is the call graph for this function:

◆ monitorData() [1/2]

static WindowsScreenDataList monitorData ( )
inlinestatic

Definition at line 361 of file qwindowsscreen.cpp.

References monitorEnumCallback().

Referenced by QWindowsScreenManager::handleScreenChanges(), and monitorEnumCallback().

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

◆ monitorData() [2/2]

static bool monitorData ( HMONITOR  hMonitor,
QWindowsScreenData data 
)
static

◆ monitorDPI()

static QDpi monitorDPI ( HMONITOR  hMonitor)
inlinestatic

Definition at line 43 of file qwindowsscreen.cpp.

Referenced by monitorData().

+ Here is the caller graph for this function:

◆ monitorEnumCallback()

BOOL QT_WIN_CALLBACK monitorEnumCallback ( HMONITOR  hMonitor,
HDC  ,
LPRECT  ,
LPARAM  p 
)

Definition at line 333 of file qwindowsscreen.cpp.

References i, it, monitorData(), and QWindowsScreenData::PrimaryScreen.

Referenced by monitorData().

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

◆ moveToVirtualScreen()

static void moveToVirtualScreen ( QWindow w,
const QScreen newScreen 
)
static

Definition at line 716 of file qwindowsscreen.cpp.

References QScreen::geometry, QRect::height(), QPoint::manhattanLength(), QRect::moveTopLeft(), QRect::size(), QRect::topLeft(), and QRect::width().

+ Here is the call graph for this function:

◆ operator<<()

static QDebug operator<< ( QDebug  dbg,
const QWindowsScreenData d 
)
static

◆ qDisplayChangeObserverWndProc()

LRESULT QT_WIN_CALLBACK qDisplayChangeObserverWndProc ( HWND  hwnd,
UINT  message,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 652 of file qwindowsscreen.cpp.

References QWindowsWindow::displayChanged(), QWindowsScreenManager::handleScreenChanges(), QWindowsContext::instance(), QWindowsTheme::instance(), qCDebug, and QWindowsContext::screenManager().

Referenced by QWindowsScreenManager::initialize().

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

◆ setMonitorDataFromSetupApi()

static void setMonitorDataFromSetupApi ( QWindowsScreenData data,
const std::vector< DISPLAYCONFIG_PATH_INFO > &  pathGroup 
)
static

Definition at line 130 of file qwindowsscreen.cpp.

References QByteArray::data(), QString::fromWCharArray(), QEdidParser::manufacturer, QEdidParser::model, QEdidParser::parse(), qCDebug, qCWarning, QByteArray::resize(), QEdidParser::serialNumber, QString::size(), and storage.

Referenced by monitorData().

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