Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qwindowsvistastyle.cpp File Reference
#include "qwindowsvistastyle_p.h"
#include "qwindowsvistastyle_p_p.h"
#include "qwindowsvistaanimation_p.h"
#include <qoperatingsystemversion.h>
#include <qscreen.h>
#include <qstylehints.h>
#include <qwindow.h>
#include <private/qstyleanimation_p.h>
#include <private/qstylehelper_p.h>
#include <qpa/qplatformnativeinterface.h>
#include <private/qapplication_p.h>
#include <private/qsystemlibrary_p.h>
#include "qdrawutil.h"
#include <qbackingstore.h>
+ Include dependency graph for qwindowsvistastyle.cpp:

Go to the source code of this file.

Macros

#define TMT_CONTENTMARGINS   3602
 
#define TMT_SIZINGMARGINS   3601
 
#define LISS_NORMAL   1
 
#define LISS_HOT   2
 
#define LISS_SELECTED   3
 
#define LISS_DISABLED   4
 
#define LISS_SELECTEDNOTFOCUS   5
 
#define LISS_HOTSELECTED   6
 
#define BP_COMMANDLINK   6
 
#define BP_COMMANDLINKGLYPH   7
 
#define CMDLGS_NORMAL   1
 
#define CMDLGS_HOT   2
 
#define CMDLGS_PRESSED   3
 
#define CMDLGS_DISABLED   4
 

Enumerations

enum  TransformType { SimpleTransform , HighDpiScalingTransform , ComplexTransform }
 

Functions

static void qt_add_rect (HRGN &winRegion, QRect r)
 
static HRGN qt_hrgn_from_qregion (const QRegion &region)
 
static Qt::Orientation progressBarOrientation (const QStyleOption *option=nullptr)
 
static HWND createTreeViewHelperWindow ()
 
static TransformType transformType (const QTransform &transform, qreal devicePixelRatio)
 
static bool isFullyOpaque (const QWindowsThemeData &themeData)
 
static QRectF scaleRect (const QRectF &r, qreal factor)
 
static QRegion scaleRegion (const QRegion &region, qreal factor)
 
QObjectstyleObject (const QStyleOption *option)
 
bool canAnimate (const QStyleOption *option)
 
static QImage createAnimationBuffer (const QStyleOption *option, const QWidget *widget)
 
QStyleOptionclonedAnimationStyleOption (const QStyleOption *option)
 
void deleteClonedAnimationStyleOption (const QStyleOption *option)
 
static void populateTitleBarButtonTheme (const QStyle *proxy, const QWidget *widget, const QStyleOptionComplex *option, QStyle::SubControl subControl, bool isTitleBarActive, int part, QWindowsThemeData *theme)
 
static bool buttonVisible (const QStyle::SubControl sc, const QStyleOptionTitleBar *tb)
 
static int buttonStateId (int flags, int partId)
 
static bool supportsStateTransition (QStyle::PrimitiveElement element, const QStyleOption *option, const QWidget *widget)
 

Variables

static const int windowsItemFrame = 2
 
static const int windowsItemHMargin = 3
 
static const int windowsItemVMargin = 4
 
static const int windowsArrowHMargin = 6
 
static const int windowsRightBorder = 15
 
static const wchar_t * themeNames [QWindowsVistaStylePrivate::NThemes]
 

Macro Definition Documentation

◆ BP_COMMANDLINK

#define BP_COMMANDLINK   6

Definition at line 46 of file qwindowsvistastyle.cpp.

◆ BP_COMMANDLINKGLYPH

#define BP_COMMANDLINKGLYPH   7

Definition at line 47 of file qwindowsvistastyle.cpp.

◆ CMDLGS_DISABLED

#define CMDLGS_DISABLED   4

Definition at line 51 of file qwindowsvistastyle.cpp.

◆ CMDLGS_HOT

#define CMDLGS_HOT   2

Definition at line 49 of file qwindowsvistastyle.cpp.

◆ CMDLGS_NORMAL

#define CMDLGS_NORMAL   1

Definition at line 48 of file qwindowsvistastyle.cpp.

◆ CMDLGS_PRESSED

#define CMDLGS_PRESSED   3

Definition at line 50 of file qwindowsvistastyle.cpp.

◆ LISS_DISABLED

#define LISS_DISABLED   4

Definition at line 41 of file qwindowsvistastyle.cpp.

◆ LISS_HOT

#define LISS_HOT   2

Definition at line 39 of file qwindowsvistastyle.cpp.

◆ LISS_HOTSELECTED

#define LISS_HOTSELECTED   6

Definition at line 43 of file qwindowsvistastyle.cpp.

◆ LISS_NORMAL

#define LISS_NORMAL   1

Definition at line 38 of file qwindowsvistastyle.cpp.

◆ LISS_SELECTED

#define LISS_SELECTED   3

Definition at line 40 of file qwindowsvistastyle.cpp.

◆ LISS_SELECTEDNOTFOCUS

#define LISS_SELECTEDNOTFOCUS   5

Definition at line 42 of file qwindowsvistastyle.cpp.

◆ TMT_CONTENTMARGINS

#define TMT_CONTENTMARGINS   3602

Definition at line 32 of file qwindowsvistastyle.cpp.

◆ TMT_SIZINGMARGINS

#define TMT_SIZINGMARGINS   3601

Definition at line 35 of file qwindowsvistastyle.cpp.

Enumeration Type Documentation

◆ TransformType

Enumerator
SimpleTransform 
HighDpiScalingTransform 
ComplexTransform 

Definition at line 127 of file qwindowsvistastyle.cpp.

Function Documentation

◆ buttonStateId()

static int buttonStateId ( int  flags,
int  partId 
)
static

Definition at line 1258 of file qwindowsvistastyle.cpp.

References Q_ASSERT, QStyle::State_Enabled, QStyle::State_MouseOver, QStyle::State_On, and QStyle::State_Sunken.

Referenced by QWindowsVistaStyle::drawControl(), and QWindowsVistaStyle::drawPrimitive().

+ Here is the caller graph for this function:

◆ buttonVisible()

◆ canAnimate()

bool canAnimate ( const QStyleOption option)

Definition at line 1095 of file qwindowsvistastyle.cpp.

Referenced by QWindowsVistaStyle::drawComplexControl(), QWindowsVistaStyle::drawControl(), and QWindowsVistaStyle::drawPrimitive().

+ Here is the caller graph for this function:

◆ clonedAnimationStyleOption()

QStyleOption * clonedAnimationStyleOption ( const QStyleOption option)

Definition at line 1114 of file qwindowsvistastyle.cpp.

References button, groupBox, and QStyleOption::rect.

Referenced by QWindowsVistaStyle::drawComplexControl(), QWindowsVistaStyle::drawControl(), and QWindowsVistaStyle::drawPrimitive().

+ Here is the caller graph for this function:

◆ createAnimationBuffer()

static QImage createAnimationBuffer ( const QStyleOption option,
const QWidget widget 
)
inlinestatic

Definition at line 1101 of file qwindowsvistastyle.cpp.

References QPaintDevice::devicePixelRatioF(), QImage::Format_ARGB32_Premultiplied, qApp, and widget.

Referenced by QWindowsVistaStyle::drawComplexControl(), QWindowsVistaStyle::drawControl(), and QWindowsVistaStyle::drawPrimitive().

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

◆ createTreeViewHelperWindow()

static HWND createTreeViewHelperWindow ( )
inlinestatic

Definition at line 116 of file qwindowsvistastyle.cpp.

References QGuiApplicationPrivate::platformIntegration(), and QStringLiteral.

+ Here is the call graph for this function:

◆ deleteClonedAnimationStyleOption()

void deleteClonedAnimationStyleOption ( const QStyleOption option)

Definition at line 1135 of file qwindowsvistastyle.cpp.

References button, and groupBox.

Referenced by QWindowsVistaStyle::drawComplexControl(), QWindowsVistaStyle::drawControl(), and QWindowsVistaStyle::drawPrimitive().

+ Here is the caller graph for this function:

◆ isFullyOpaque()

static bool isFullyOpaque ( const QWindowsThemeData themeData)
inlinestatic

Definition at line 142 of file qwindowsvistastyle.cpp.

References QWindowsThemeData::partId, QWindowsVistaStylePrivate::TaskDialogTheme, and QWindowsThemeData::theme.

Referenced by QWindowsVistaStylePrivate::drawBackground().

+ Here is the caller graph for this function:

◆ populateTitleBarButtonTheme()

static void populateTitleBarButtonTheme ( const QStyle proxy,
const QWidget widget,
const QStyleOptionComplex option,
QStyle::SubControl  subControl,
bool  isTitleBarActive,
int  part,
QWindowsThemeData theme 
)
static

Definition at line 1151 of file qwindowsvistastyle.cpp.

References QStyle::CC_TitleBar, QWidget::isEnabled(), QWindowsThemeData::partId, proxy, RBS_INACTIVE, QWindowsThemeData::rect, QStyle::State_MouseOver, QStyle::State_Sunken, QWindowsThemeData::stateId, and widget.

Referenced by QWindowsVistaStyle::drawComplexControl().

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

◆ progressBarOrientation()

static Qt::Orientation progressBarOrientation ( const QStyleOption option = nullptr)
inlinestatic

Definition at line 100 of file qwindowsvistastyle.cpp.

References Qt::Horizontal, QStyle::State_Horizontal, and Qt::Vertical.

Referenced by QWindowsVistaStylePrivate::pixelMetricFromSystemDp().

+ Here is the caller graph for this function:

◆ qt_add_rect()

static void qt_add_rect ( HRGN &  winRegion,
QRect  r 
)
static

Definition at line 74 of file qwindowsvistastyle.cpp.

Referenced by qt_hrgn_from_qregion().

+ Here is the caller graph for this function:

◆ qt_hrgn_from_qregion()

static HRGN qt_hrgn_from_qregion ( const QRegion region)
static

Definition at line 88 of file qwindowsvistastyle.cpp.

References QRegion::boundingRect(), qt_add_rect(), rect, and QRegion::rectCount().

Referenced by QWindowsVistaStylePrivate::drawBackgroundDirectly().

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

◆ scaleRect()

static QRectF scaleRect ( const QRectF r,
qreal  factor 
)
inlinestatic

Definition at line 147 of file qwindowsvistastyle.cpp.

References QRectF::isValid().

+ Here is the call graph for this function:

◆ scaleRegion()

static QRegion scaleRegion ( const QRegion region,
qreal  factor 
)
static

Definition at line 153 of file qwindowsvistastyle.cpp.

References QRegion::isEmpty(), qFuzzyCompare(), and rect.

Referenced by QWindowsVistaStylePrivate::drawBackgroundDirectly(), and QWindowsVistaStylePrivate::drawBackgroundThruNativeBuffer().

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

◆ styleObject()

QObject * styleObject ( const QStyleOption option)
inline

Definition at line 1088 of file qwindowsvistastyle.cpp.

Referenced by QQC2_NAMESPACE::QMacStyle::drawComplexControl(), QMacStyle::drawComplexControl(), QWindowsVistaStyle::drawComplexControl(), QWindowsVistaStyle::drawControl(), and QWindowsVistaStyle::drawPrimitive().

+ Here is the caller graph for this function:

◆ supportsStateTransition()

static bool supportsStateTransition ( QStyle::PrimitiveElement  element,
const QStyleOption option,
const QWidget widget 
)
inlinestatic

Definition at line 1289 of file qwindowsvistastyle.cpp.

References QWindowsVistaStylePrivate::isLineEditBaseColorSet(), QStyle::PE_FrameLineEdit, QStyle::PE_IndicatorCheckBox, QStyle::PE_IndicatorRadioButton, and widget.

Referenced by QWindowsVistaStyle::drawPrimitive().

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

◆ transformType()

static TransformType transformType ( const QTransform transform,
qreal  devicePixelRatio 
)
inlinestatic

Definition at line 129 of file qwindowsvistastyle.cpp.

References ComplexTransform, HighDpiScalingTransform, qFuzzyCompare(), SimpleTransform, QTransform::TxScale, and QTransform::TxTranslate.

+ Here is the call graph for this function:

Variable Documentation

◆ themeNames

const wchar_t* themeNames[QWindowsVistaStylePrivate::NThemes]
static
Initial value:
=
{
L"BUTTON", L"COMBOBOX", L"EDIT", L"HEADER", L"LISTVIEW",
L"MENU", L"PROGRESS", L"REBAR", L"SCROLLBAR", L"SPIN",
L"TAB", L"TASKDIALOG", L"TOOLBAR", L"TOOLTIP", L"TRACKBAR",
L"WINDOW", L"STATUS", L"TREEVIEW"
}

Definition at line 59 of file qwindowsvistastyle.cpp.

Referenced by QXdgDesktopPortalTheme::QXdgDesktopPortalTheme(), QWindowsVistaStylePrivate::createTheme(), init_platform(), and QWindowsVistaStylePrivate::themeName().

◆ windowsArrowHMargin

const int windowsArrowHMargin = 6
static

Definition at line 28 of file qwindowsvistastyle.cpp.

Referenced by QWindowsVistaStyle::drawControl().

◆ windowsItemFrame

const int windowsItemFrame = 2
static

Definition at line 25 of file qwindowsvistastyle.cpp.

Referenced by QWindowsVistaStyle::drawControl().

◆ windowsItemHMargin

const int windowsItemHMargin = 3
static

◆ windowsItemVMargin

const int windowsItemVMargin = 4
static

Definition at line 27 of file qwindowsvistastyle.cpp.

Referenced by QWindowsVistaStyle::drawControl().

◆ windowsRightBorder

const int windowsRightBorder = 15
static

Definition at line 29 of file qwindowsvistastyle.cpp.

Referenced by QWindowsVistaStyle::drawControl().