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>.
|
#include <QtCore/qt_windows.h>
#include "qwindowswindow.h"
#include "qwindowscontext.h"
#include "qwindowstheme.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 <QtGui/private/qwindowsthemecache_p.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 | shouldOmitFrameAdjustment (const Qt::WindowFlags flags, DWORD style) |
static bool | shouldOmitFrameAdjustment (const Qt::WindowFlags flags, HWND hwnd) |
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) |
#define GWL_HWNDPARENT (-8) |
Definition at line 1815 of file qwindowswindow.cpp.
Definition at line 50 of file qwindowswindow.cpp.
anonymous enum |
Enumerator | |
---|---|
defaultWindowWidth | |
defaultWindowHeight |
Definition at line 52 of file qwindowswindow.cpp.
anonymous enum : WORD |
Enumerator | |
---|---|
DwmwaUseImmersiveDarkMode | |
DwmwaUseImmersiveDarkModeBefore20h1 |
Definition at line 3291 of file qwindowswindow.cpp.
Definition at line 2867 of file qwindowswindow.cpp.
References createRectRegion(), and rect.
Referenced by qRegionToWinRegion().
|
static |
Definition at line 442 of file qwindowswindow.cpp.
Referenced by QWindowsWindow::handleCompositionSettingsChanged(), and updateGLWindowSettings().
|
inlinestatic |
Definition at line 3136 of file qwindowswindow.cpp.
References QWindowsWindow::cursor(), QWindowsContext::instance(), CursorHandle::isNull(), and QWindowsWindow::windowsWindowOf().
Referenced by QWindowsWindow::setCursor().
|
static |
Definition at line 664 of file qwindowswindow.cpp.
References QPlatformScreen::availableGeometry(), QMargins::bottom(), context, QWindowsWindow::forcedScreenForGLWindow(), QScreen::handle(), QMargins::left(), qMax(), QMargins::right(), screen, QMargins::top(), Qt::Window, QPoint::x(), and QPoint::y().
Referenced by WindowCreationData::create().
|
static |
Definition at line 3257 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 2862 of file qwindowswindow.cpp.
Referenced by addRectToWinRegion(), and qRegionToWinRegion().
|
inlinestatic |
Definition at line 221 of file qwindowswindow.cpp.
References QByteArray::number().
Referenced by operator<<().
|
inlinestatic |
Definition at line 208 of file qwindowswindow.cpp.
References QByteArray::number().
Referenced by operator<<().
|
static |
Definition at line 114 of file qwindowswindow.cpp.
References QByteArray::number().
Referenced by WindowCreationData::applyWindowFlags(), operator<<(), and QWindowsWindow::setExStyle().
|
static |
Definition at line 59 of file qwindowswindow.cpp.
References QByteArray::number().
Referenced by WindowCreationData::applyWindowFlags(), operator<<(), QWindowsForeignWindow::setParent(), and QWindowsWindow::setStyle().
|
static |
Definition at line 171 of file qwindowswindow.cpp.
References QByteArray::number().
Referenced by operator<<().
|
inlinestatic |
Definition at line 3124 of file qwindowswindow.cpp.
References Qt::ArrowCursor, QWindowsCursor::createCursorFromShape(), cursor, QScreen::handle(), and screen.
Referenced by QWindowsWindow::applyCursor().
|
inlinestatic |
Definition at line 3027 of file qwindowswindow.cpp.
References Qt::BottomEdge, Qt::LeftEdge, Qt::RightEdge, and Qt::TopEdge.
Referenced by QWindowsWindow::startSystemResize().
Definition at line 2255 of file qwindowswindow.cpp.
References d1, d2, and qFuzzyCompare().
Referenced by QWindowsWindow::checkForScreenChanged().
|
inlinestatic |
Definition at line 626 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 360 of file qwindowswindow.cpp.
References d.
Referenced by msgUnableToSetGeometry().
Definition at line 355 of file qwindowswindow.cpp.
References d, Qt::forcesign(), and Qt::noforcesign().
Referenced by msgUnableToSetGeometry().
|
inlinestatic |
Definition at line 381 of file qwindowswindow.cpp.
References qrectFromRECT(), rect, screenToClient(), and windowPlacementOffset().
Referenced by WindowCreationData::create(), QWindowsBaseWindow::frameGeometry_sys(), operator<<(), QWindowsBaseWindow::setGeometry_sys(), and QPlatformWindow::windowFrameGeometry().
|
inlinestatic |
Definition at line 522 of file qwindowswindow.cpp.
Referenced by invisibleMargins(), and invisibleMargins().
|
inlinestatic |
Definition at line 550 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 536 of file qwindowswindow.cpp.
References getResizeBorderThickness().
Referenced by WindowCreationData::create(), QWindowsWindow::frameMargins(), QWindowsWindow::handleNonClientHitTest(), and QWindowsWindow::handleResized().
|
inlinestatic |
Definition at line 2387 of file qwindowswindow.cpp.
References QOpenGLContext::LibGL, QOpenGLStaticContext::opengl32, and QOpenGLContext::openGLModuleType().
Referenced by QWindowsWindow::handleWmPaint().
|
static |
Definition at line 2105 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 2082 of file qwindowswindow.cpp.
References qrectFromRECT(), and windowPlacementOffset().
Referenced by QWindowsWindow::normalGeometry(), and QWindowsWindow::updateRestoreGeometry().
Definition at line 337 of file qwindowswindow.cpp.
References d, Qt::hex(), i, qSetFieldWidth(), qSetPadChar(), and Qt::uppercasedigits().
Definition at line 314 of file qwindowswindow.cpp.
Definition at line 305 of file qwindowswindow.cpp.
References d.
Definition at line 286 of file qwindowswindow.cpp.
References d.
Definition at line 276 of file qwindowswindow.cpp.
References d.
Definition at line 325 of file qwindowswindow.cpp.
References d, debugShowWindowCmd(), and debugWindowPlacementFlags().
Definition at line 294 of file qwindowswindow.cpp.
References d, and debugWinSwpPos().
QDebug operator<< | ( | QDebug | debug, |
const WindowCreationData & | d ) |
Definition at line 608 of file qwindowswindow.cpp.
References d, debug, debugWinExStyle(), and debugWinStyle().
|
inlinestatic |
Definition at line 261 of file qwindowswindow.cpp.
References qSizeOfRect(), and rect.
Referenced by frameGeometry(), QWindowsWindow::handleWmPaint(), and normalFrameGeometry().
|
static |
Definition at line 2879 of file qwindowswindow.cpp.
References addRectToWinRegion(), QRegion::begin(), createRectRegion(), QRegion::end(), and it.
Referenced by QWindowsWindow::setMask().
|
inlinestatic |
Definition at line 256 of file qwindowswindow.cpp.
References rect.
Referenced by qrectFromRECT().
Q_GUI_EXPORT HICON qt_pixmapToWinHICON | ( | const QPixmap & | p | ) |
Definition at line 537 of file qpixmap_win.cpp.
References QImage::convertToFormat(), QImage::Format_Mono, QPixmap::mask(), and QPixmap::toImage().
Referenced by createHIcon(), and QWindowsSystemTrayIcon::showMessage().
|
inlinestatic |
Definition at line 266 of file qwindowswindow.cpp.
References rect.
Referenced by QWindowsBaseWindow::setGeometry_sys(), and setMinimizedGeometry().
Definition at line 646 of file qwindowswindow.cpp.
References QString::data(), QScreen::handle(), QGuiApplication::primaryScreen, and screen.
Referenced by QWindowsWindow::forcedScreenForGLWindow().
Definition at line 1846 of file qwindowswindow.cpp.
References RECTfromQRect().
|
static |
Definition at line 1857 of file qwindowswindow.cpp.
References set.
|
static |
Definition at line 495 of file qwindowswindow.cpp.
References hasAlpha(), QWindowsWindow::hasNoNativeFrame(), qRound(), and QWindowsWindow::setWindowLayered().
Referenced by QWindowsWindow::setOpacity(), and updateGLWindowSettings().
|
inlinestatic |
Definition at line 849 of file qwindowswindow.cpp.
References QPalette::color(), Qt::Dark, Qt::FramelessWindowHint, QWindowPrivate::get(), QWindowsIntegration::instance(), QWindowsTheme::instance(), QColor::lightness(), testFlag(), Qt::Unknown, QPalette::Window, and QPalette::WindowText.
Referenced by WindowCreationData::create(), and QWindowsWindow::setDarkBorder().
|
static |
Definition at line 1028 of file qwindowswindow.cpp.
References Qt::FramelessWindowHint.
Referenced by QWindowsGeometryHint::frame(), QWindowsGeometryHint::frame(), QWindowsGeometryHint::frame(), QWindowsGeometryHint::frameOnPrimaryScreen(), QWindowsWindow::fullFrameMargins(), QWindowsWindow::handleDpiChanged(), and QWindowsWindow::setFullFrameMargins().
|
static |
Definition at line 1035 of file qwindowswindow.cpp.
References Qt::FramelessWindowHint.
|
static |
Definition at line 459 of file qwindowswindow.cpp.
References Qt::CustomizeWindowHint, Qt::MSWindowsFixedSizeDialogHint, QWINDOWSIZE_MAX, and Qt::WindowMaximizeButtonHint.
Referenced by WindowCreationData::fromWindow().
|
inlinestatic |
Definition at line 1839 of file qwindowswindow.cpp.
References QVariant::isValid(), QVariant::toBool(), and window().
Definition at line 1012 of file qwindowswindow.cpp.
References QHighDpiScaling::factor(), QHighDpiScaling::isActive(), qFuzzyCompare(), qRound(), and QWINDOWSIZE_MAX.
Referenced by QWindowsGeometryHint::frameSizeConstraints().
|
inlinestatic |
Definition at line 511 of file qwindowswindow.cpp.
References applyBlurBehindWindow(), hasAlpha(), setWindowOpacity(), and windowIsAccelerated().
Referenced by WindowCreationData::initialize().
|
inlinestatic |
Definition at line 430 of file qwindowswindow.cpp.
References QSurface::Direct3DSurface, QSurface::OpenGLSurface, and QSurface::VulkanSurface.
Referenced by updateGLWindowSettings().
Definition at line 367 of file qwindowswindow.cpp.
References QScreen::availableGeometry, QList< T >::constFirst(), QScreen::geometry, QWindowsContext::instance(), screen, QWindowsScreenManager::screenAtDp(), QWindowsScreenManager::screens(), QList< T >::size(), and QRect::topLeft().
Referenced by frameGeometry(), normalFrameGeometry(), and QWindowsBaseWindow::setGeometry_sys().
|
static |
Definition at line 409 of file qwindowswindow.cpp.