Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qwindowsthemedata.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
6
7/* \internal
8 Returns \c true if the QWindowsThemeData is valid for use.
9*/
11{
13}
14
15/* \internal
16 Returns the theme engine handle to the specific class.
17 If the handle hasn't been opened before, it opens the data, and
18 adds it to a static map, for caching.
19*/
21{
23 return nullptr;
24
25 if (!htheme)
27 return htheme;
28}
29
30/* \internal
31 Converts a QRect to the native RECT structure.
32*/
34{
35 RECT r;
36 r.left = qr.x();
37 r.right = qr.x() + qr.width();
38 r.top = qr.y();
39 r.bottom = qr.y() + qr.height();
40 return r;
41}
42
43/* \internal
44 Returns the native region of a part, if the part is considered
45 transparent. The region is scaled to the parts size (rect).
46*/
48{
49 if (!IsThemeBackgroundPartiallyTransparent(handle(), partId, stateId))
50 return nullptr;
51
52 HRGN hrgn;
53 HDC dc = nullptr;
54 if (widget)
56 RECT nativeRect = toRECT(rect);
57 GetThemeBackgroundRegion(handle(), dc, partId, stateId, &nativeRect, &hrgn);
58 return hrgn;
59}
\inmodule QtCore\reentrant
Definition qrect.h:30
constexpr int height() const noexcept
Returns the height of the rectangle.
Definition qrect.h:238
constexpr int x() const noexcept
Returns the x-coordinate of the rectangle's left edge.
Definition qrect.h:184
constexpr int width() const noexcept
Returns the width of the rectangle.
Definition qrect.h:235
constexpr int y() const noexcept
Returns the y-coordinate of the rectangle's top edge.
Definition qrect.h:187
The QWidget class is the base class of all user interface objects.
Definition qwidget.h:99
HRGN mask(QWidget *widget)
const QWidget * widget
static RECT toRECT(const QRect &qr)
static HDC hdcForWidgetBackingStore(const QWidget *widget)
static HWND winId(const QWidget *widget)
static bool useVista(bool update=false)
static HTHEME createTheme(int theme, HWND hwnd)
QOpenGLWidget * widget
[1]
GLboolean r
[2]