![]() |
Qt 6.x
The Qt SDK
|
#include <QtCore/qt_windows.h>
#include "qwindowswindow.h"
#include "qwindowscontext.h"
#include "qwindowsscreen.h"
#include "qwindowsintegration.h"
#include "qwindowsmenu.h"
#include "qwindowsnativeinterface.h"
#include "qwindowsopenglcontext.h"
#include "qwindowsopengltester.h"
#include <QtGui/qguiapplication.h>
#include <QtGui/qscreen.h>
#include <QtGui/qwindow.h>
#include <QtGui/qregion.h>
#include <QtGui/qopenglcontext.h>
#include <private/qwindow_p.h>
#include <private/qguiapplication_p.h>
#include <private/qhighdpiscaling_p.h>
#include <qpa/qwindowsysteminterface.h>
#include <QtCore/qdebug.h>
#include <QtCore/qlibraryinfo.h>
#include <dwmapi.h>
#include <shellscalingapi.h>
Go to the source code of this file.
Classes | |
class | WindowCreationData |
Window creation code. More... | |
Macros | |
#define | GWL_HWNDPARENT (-8) |
Typedefs | |
using | QWindowCreationContextPtr = QSharedPointer< QWindowCreationContext > |
Enumerations | |
enum | { defaultWindowWidth = 160 , defaultWindowHeight = 160 } |
enum | : WORD { DwmwaUseImmersiveDarkMode = 20 , DwmwaUseImmersiveDarkModeBefore20h1 = 19 } |
Functions | |
Q_GUI_EXPORT HICON | qt_pixmapToWinHICON (const QPixmap &) |
static QByteArray | debugWinStyle (DWORD style) |
static QByteArray | debugWinExStyle (DWORD exStyle) |
static QByteArray | debugWinSwpPos (UINT flags) |
static QByteArray | debugWindowPlacementFlags (const UINT flags) |
static QByteArray | debugShowWindowCmd (const UINT cmd) |
static QSize | qSizeOfRect (const RECT &rect) |
static QRect | qrectFromRECT (const RECT &rect) |
static RECT | RECTfromQRect (const QRect &rect) |
QDebug | operator<< (QDebug d, const RECT &r) |
QDebug | operator<< (QDebug d, const POINT &p) |
QDebug | operator<< (QDebug d, const WINDOWPOS &wp) |
QDebug | operator<< (QDebug d, const NCCALCSIZE_PARAMS &p) |
QDebug | operator<< (QDebug d, const MINMAXINFO &i) |
QDebug | operator<< (QDebug d, const WINDOWPLACEMENT &wp) |
QDebug | operator<< (QDebug d, const GUID &guid) |
static void | formatBriefRectangle (QDebug &d, const QRect &r) |
static void | formatBriefMargins (QDebug &d, const QMargins &m) |
static QPoint | windowPlacementOffset (HWND hwnd, const QPoint &point) |
static QRect | frameGeometry (HWND hwnd, bool topLevel) |
static QWindow::Visibility | windowVisibility_sys (HWND hwnd) |
static bool | windowIsAccelerated (const QWindow *w) |
static bool | applyBlurBehindWindow (HWND hwnd) |
static bool | shouldShowMaximizeButton (const QWindow *w, Qt::WindowFlags flags) |
static void | setWindowOpacity (HWND hwnd, Qt::WindowFlags flags, bool hasAlpha, bool accelerated, qreal level) |
static void | updateGLWindowSettings (const QWindow *w, HWND hwnd, Qt::WindowFlags flags, qreal opacity) |
static int | getResizeBorderThickness (const UINT dpi) |
static QMargins | invisibleMargins (QPoint screenPoint) |
Calculates the dimensions of the invisible borders within the window frames which only exist on Windows 10 and onwards. | |
static QMargins | invisibleMargins (const HWND hwnd) |
QDebug | operator<< (QDebug debug, const WindowCreationData &d) |
static void | fixTopLevelWindowFlags (Qt::WindowFlags &flags) |
static QScreen * | screenForDeviceName (const QWindow *w, const QString &name) |
static QPoint | calcPosition (const QWindow *w, const QWindowCreationContextPtr &context, const QMargins &invMargins) |
static bool | shouldApplyDarkFrame (const QWindow *w) |
static QSize | toNativeSizeConstrained (QSize dip, const QScreen *s) |
static bool | testShowWithoutActivating (const QWindow *window) |
static void | setMinimizedGeometry (HWND hwnd, const QRect &r) |
static void | setRestoreMaximizedFlag (HWND hwnd, bool set=true) |
static QRect | normalFrameGeometry (HWND hwnd) |
static QString | msgUnableToSetGeometry (const QWindowsWindow *platformWindow, const QRect &requestedRect, const QRect &obtainedRect, const QMargins &fullMargins, const QMargins &customMargins) |
static bool | equalDpi (const QDpi &d1, const QDpi &d2) |
static bool | isSoftwareGl () |
static HRGN | createRectRegion (const QRect &r) |
static void | addRectToWinRegion (const QRect &rect, HRGN *winRegion) |
static HRGN | qRegionToWinRegion (const QRegion ®ion) |
static DWORD | edgesToWinOrientation (Qt::Edges edges) |
static CursorHandlePtr | defaultCursor (const QWindow *w) |
static bool | applyNewCursor (const QWindow *w) |
static HICON | createHIcon (const QIcon &icon, int xSize, int ySize) |
static bool | queryDarkBorder (HWND hwnd) |
#define GWL_HWNDPARENT (-8) |
Definition at line 1790 of file qwindowswindow.cpp.
Definition at line 48 of file qwindowswindow.cpp.
anonymous enum |
Enumerator | |
---|---|
defaultWindowWidth | |
defaultWindowHeight |
Definition at line 50 of file qwindowswindow.cpp.
anonymous enum : WORD |
Enumerator | |
---|---|
DwmwaUseImmersiveDarkMode | |
DwmwaUseImmersiveDarkModeBefore20h1 |
Definition at line 3271 of file qwindowswindow.cpp.
Definition at line 2847 of file qwindowswindow.cpp.
References createRectRegion(), and rect.
Referenced by qRegionToWinRegion().
|
static |
Definition at line 444 of file qwindowswindow.cpp.
Referenced by QWindowsWindow::handleCompositionSettingsChanged(), and updateGLWindowSettings().
|
inlinestatic |
Definition at line 3116 of file qwindowswindow.cpp.
References QWindowsWindow::cursor(), QWindowsContext::instance(), CursorHandle::isNull(), QWindowsWindow::windowsWindowOf(), and QWindowsContext::windowUnderMouse().
Referenced by QWindowsWindow::setCursor().
|
static |
Definition at line 659 of file qwindowswindow.cpp.
References QPlatformScreen::availableGeometry(), QMargins::bottom(), QRect::center(), QRect::contains(), context, QWindowsWindow::forcedScreenForGLWindow(), QScreen::handle(), QRect::height(), QMargins::left(), QRect::left(), qMax(), QMargins::right(), screen, QMargins::top(), QRect::top(), QScreen::virtualSiblings(), QRect::width(), Qt::Window, QPoint::x(), and QPoint::y().
Referenced by WindowCreationData::create().
|
static |
Definition at line 3237 of file qwindowswindow.cpp.
References QIcon::actualSize(), icon, QIcon::isNull(), QPixmap::isNull(), QIcon::pixmap(), and qt_pixmapToWinHICON().
Referenced by QWindowsWindow::setWindowIcon().
|
inlinestatic |
Definition at line 2842 of file qwindowswindow.cpp.
Referenced by addRectToWinRegion(), and qRegionToWinRegion().
|
inlinestatic |
Definition at line 219 of file qwindowswindow.cpp.
References QByteArray::number().
Referenced by operator<<().
|
inlinestatic |
Definition at line 206 of file qwindowswindow.cpp.
References QByteArray::number().
Referenced by operator<<().
|
static |
Definition at line 112 of file qwindowswindow.cpp.
References QByteArray::number().
Referenced by WindowCreationData::applyWindowFlags(), operator<<(), and QWindowsWindow::setExStyle().
|
static |
Definition at line 57 of file qwindowswindow.cpp.
References QByteArray::number().
Referenced by WindowCreationData::applyWindowFlags(), operator<<(), QWindowsForeignWindow::setParent(), and QWindowsWindow::setStyle().
|
static |
Definition at line 169 of file qwindowswindow.cpp.
References QByteArray::number().
Referenced by operator<<().
|
inlinestatic |
Definition at line 3104 of file qwindowswindow.cpp.
References Qt::ArrowCursor, QWindowsCursor::createCursorFromShape(), cursor, QScreen::handle(), and screen.
Referenced by QWindowsWindow::applyCursor().
|
inlinestatic |
Definition at line 3007 of file qwindowswindow.cpp.
References Qt::BottomEdge, Qt::LeftEdge, Qt::RightEdge, and Qt::TopEdge.
Referenced by QWindowsWindow::startSystemResize().
Definition at line 2272 of file qwindowswindow.cpp.
References d1, d2, and qFuzzyCompare().
Referenced by QWindowsWindow::checkForScreenChanged().
|
inlinestatic |
Definition at line 621 of file qwindowswindow.cpp.
References Qt::Dialog, Qt::FramelessWindowHint, Qt::SplashScreen, Qt::Tool, Qt::Window, Qt::WindowCloseButtonHint, Qt::WindowMaximizeButtonHint, Qt::WindowMinimizeButtonHint, Qt::WindowSystemMenuHint, Qt::WindowTitleHint, and Qt::WindowType_Mask.
Referenced by WindowCreationData::fromWindow().
Definition at line 358 of file qwindowswindow.cpp.
References d.
Referenced by msgUnableToSetGeometry().
Definition at line 353 of file qwindowswindow.cpp.
References d, Qt::forcesign(), and Qt::noforcesign().
Referenced by msgUnableToSetGeometry().
|
inlinestatic |
Definition at line 379 of file qwindowswindow.cpp.
References parent, qrectFromRECT(), rect, screenToClient(), and windowPlacementOffset().
Referenced by WindowCreationData::create(), QWindowsBaseWindow::frameGeometry_sys(), operator<<(), QWindowsBaseWindow::setGeometry_sys(), and QPlatformWindow::windowFrameGeometry().
|
inlinestatic |
Definition at line 517 of file qwindowswindow.cpp.
Referenced by invisibleMargins(), and invisibleMargins().
|
inlinestatic |
Definition at line 545 of file qwindowswindow.cpp.
References getResizeBorderThickness().
Calculates the dimensions of the invisible borders within the window frames which only exist on Windows 10 and onwards.
Definition at line 531 of file qwindowswindow.cpp.
References getResizeBorderThickness(), QPoint::x(), and QPoint::y().
Referenced by WindowCreationData::create(), QWindowsWindow::frameMargins(), QWindowsWindow::handleNonClientHitTest(), and QWindowsWindow::handleResized().
|
inlinestatic |
Definition at line 2403 of file qwindowswindow.cpp.
References QOpenGLContext::LibGL, QWindowsOpengl32DLL::moduleIsNotOpengl32(), QOpenGLStaticContext::opengl32, and QOpenGLContext::openGLModuleType().
Referenced by QWindowsWindow::handleWmPaint().
|
static |
Definition at line 2077 of file qwindowswindow.cpp.
References debug, formatBriefMargins(), formatBriefRectangle(), QWindowsWindow::getSizeHints(), QMargins::isNull(), QWINDOWSIZE_MAX, window(), and QPlatformWindow::window().
Referenced by QWindowsWindow::setGeometry().
|
static |
Definition at line 2054 of file qwindowswindow.cpp.
References qrectFromRECT(), and windowPlacementOffset().
Referenced by QWindowsWindow::normalGeometry(), and QWindowsWindow::updateRestoreGeometry().
Definition at line 335 of file qwindowswindow.cpp.
References d, Qt::hex(), i, qSetFieldWidth(), qSetPadChar(), and Qt::uppercasedigits().
Definition at line 312 of file qwindowswindow.cpp.
Definition at line 303 of file qwindowswindow.cpp.
References d.
Definition at line 284 of file qwindowswindow.cpp.
References d.
Definition at line 274 of file qwindowswindow.cpp.
References d.
Definition at line 323 of file qwindowswindow.cpp.
References d, debugShowWindowCmd(), and debugWindowPlacementFlags().
Definition at line 292 of file qwindowswindow.cpp.
References d, and debugWinSwpPos().
QDebug operator<< | ( | QDebug | debug, |
const WindowCreationData & | d | ||
) |
Definition at line 603 of file qwindowswindow.cpp.
References d, debug, debugWinExStyle(), and debugWinStyle().
|
inlinestatic |
Definition at line 259 of file qwindowswindow.cpp.
References qSizeOfRect(), and rect.
Referenced by frameGeometry(), QWindowsWindow::handleWmPaint(), and normalFrameGeometry().
|
static |
Definition at line 2859 of file qwindowswindow.cpp.
References addRectToWinRegion(), QRegion::begin(), createRectRegion(), QRegion::end(), and it.
Referenced by QWindowsWindow::setMask().
|
inlinestatic |
Definition at line 254 of file qwindowswindow.cpp.
References rect.
Referenced by qrectFromRECT().
Q_GUI_EXPORT HICON qt_pixmapToWinHICON | ( | const QPixmap & | p | ) |
Definition at line 536 of file qpixmap_win.cpp.
References QImage::convertToFormat(), QImage::Format_Mono, QPixmap::isNull(), QPixmap::mask(), and QPixmap::toImage().
Referenced by createHIcon(), and QWindowsSystemTrayIcon::showMessage().
|
static |
Definition at line 3276 of file qwindowswindow.cpp.
References DwmwaUseImmersiveDarkMode, DwmwaUseImmersiveDarkModeBefore20h1, ok, and qCWarning.
Referenced by QWindowsWindow::setDarkBorder().
|
inlinestatic |
Definition at line 264 of file qwindowswindow.cpp.
References rect.
Referenced by QWindowsWindow::moveTransientChildren(), QWindowsBaseWindow::setGeometry_sys(), and setMinimizedGeometry().
Definition at line 641 of file qwindowswindow.cpp.
References QString::data(), QScreen::handle(), QGuiApplication::primaryScreen, screen, and QScreen::virtualSiblings().
Referenced by QWindowsWindow::forcedScreenForGLWindow().
Definition at line 1821 of file qwindowswindow.cpp.
References RECTfromQRect().
|
static |
Definition at line 1832 of file qwindowswindow.cpp.
References set.
|
static |
Definition at line 490 of file qwindowswindow.cpp.
References Qt::FramelessWindowHint, hasAlpha(), qRound(), and QWindowsWindow::setWindowLayered().
Referenced by QWindowsWindow::setOpacity(), and updateGLWindowSettings().
|
inlinestatic |
Definition at line 844 of file qwindowswindow.cpp.
References QPalette::color(), Qt::FramelessWindowHint, QWindowPrivate::get(), QWindowsIntegration::instance(), QColor::lightness(), testFlag(), QPalette::Window, and QPalette::WindowText.
Referenced by WindowCreationData::create(), and QWindowsWindow::setDarkBorder().
|
static |
Definition at line 461 of file qwindowswindow.cpp.
References Qt::CustomizeWindowHint, Qt::MSWindowsFixedSizeDialogHint, QWINDOWSIZE_MAX, and Qt::WindowMaximizeButtonHint.
Referenced by WindowCreationData::fromWindow().
|
inlinestatic |
Definition at line 1814 of file qwindowswindow.cpp.
References QVariant::isValid(), QVariant::toBool(), and window().
Definition at line 1001 of file qwindowswindow.cpp.
References QHighDpiScaling::factor(), QSize::height(), QHighDpiScaling::isActive(), qFuzzyCompare(), qRound(), QWINDOWSIZE_MAX, QSize::setHeight(), QSize::setWidth(), and QSize::width().
Referenced by QWindowsGeometryHint::frameSizeConstraints().
|
inlinestatic |
Definition at line 506 of file qwindowswindow.cpp.
References applyBlurBehindWindow(), hasAlpha(), setWindowOpacity(), and windowIsAccelerated().
Referenced by QWindowsWindow::aboutToMakeCurrent(), and WindowCreationData::initialize().
|
inlinestatic |
Definition at line 428 of file qwindowswindow.cpp.
References QWindowPrivate::compositing, QSurface::Direct3DSurface, QSurface::OpenGLSurface, qt_window_private(), QSurface::RasterGLSurface, and QSurface::VulkanSurface.
Referenced by updateGLWindowSettings().
Definition at line 365 of file qwindowswindow.cpp.
References QScreen::availableGeometry, QList< T >::constFirst(), QScreen::geometry, QWindowsContext::instance(), screen, QWindowsScreenManager::screenAtDp(), QWindowsContext::screenManager(), QWindowsScreenManager::screens(), QList< T >::size(), and QRect::topLeft().
Referenced by frameGeometry(), normalFrameGeometry(), and QWindowsBaseWindow::setGeometry_sys().
|
static |
Definition at line 407 of file qwindowswindow.cpp.