Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
QWindowsVistaStylePrivate Class Reference

#include <qwindowsvistastyle_p_p.h>

Inheritance diagram for QWindowsVistaStylePrivate:
Collaboration diagram for QWindowsVistaStylePrivate:

Public Types

enum  Theme {
  ButtonTheme , ComboboxTheme , EditTheme , HeaderTheme ,
  ListViewTheme , MenuTheme , ProgressTheme , RebarTheme ,
  ScrollBarTheme , SpinTheme , TabTheme , TaskDialogTheme ,
  ToolBarTheme , ToolTipTheme , TrackBarTheme , WindowTheme ,
  StatusTheme , VistaTreeViewTheme , NThemes
}

Public Member Functions

 QWindowsVistaStylePrivate ()
 ~QWindowsVistaStylePrivate ()
void init (bool force=false)
void cleanup (bool force=false)
void cleanupHandleMap ()
HBITMAP buffer (int w=0, int h=0)
HDC bufferHDC ()
bool isTransparent (QWindowsThemeData &QWindowsThemeData)
QRegion region (QWindowsThemeData &QWindowsThemeData)
bool drawBackground (QWindowsThemeData &QWindowsThemeData, qreal correctionFactor=1)
bool drawBackgroundThruNativeBuffer (QWindowsThemeData &QWindowsThemeData, qreal aditionalDevicePixelRatio, qreal correctionFactor)
bool drawBackgroundDirectly (HDC dc, QWindowsThemeData &QWindowsThemeData, qreal aditionalDevicePixelRatio)
bool hasAlphaChannel (const QRect &rect)
bool fixAlphaChannel (const QRect &rect)
bool swapAlphaChannel (const QRect &rect, bool allPixels=false)
QTime animationTime () const
bool transitionsEnabled () const

Static Public Member Functions

static HTHEME createTheme (int theme, const QWidget *widget)
static QString themeName (int theme)
static bool isItemViewDelegateLineEdit (const QWidget *widget)
static int pixelMetricFromSystemDp (QStyle::PixelMetric pm, const QStyleOption *option=nullptr, const QWidget *widget=nullptr)
static int fixedPixelMetric (QStyle::PixelMetric pm)
static bool isLineEditBaseColorSet (const QStyleOption *option, const QWidget *widget)
static HWND winId (const QWidget *widget)
static bool useVista (bool update=false)
static QBackingStorebackingStoreForWidget (const QWidget *widget)
static HDC hdcForWidgetBackingStore (const QWidget *widget)

Public Attributes

QRgb groupBoxTextColor = 0
QRgb groupBoxTextColorDisabled = 0
QRgb sliderTickColor = 0
bool hasInitColors = false

Protected Attributes

QFont assetFont

Detailed Description

Definition at line 88 of file qwindowsvistastyle_p_p.h.

Member Enumeration Documentation

◆ Theme

Enumerator
ButtonTheme 
ComboboxTheme 
EditTheme 
HeaderTheme 
ListViewTheme 
MenuTheme 
ProgressTheme 
RebarTheme 
ScrollBarTheme 
SpinTheme 
TabTheme 
TaskDialogTheme 
ToolBarTheme 
ToolTipTheme 
TrackBarTheme 
WindowTheme 
StatusTheme 
VistaTreeViewTheme 
NThemes 

Definition at line 93 of file qwindowsvistastyle_p_p.h.

Constructor & Destructor Documentation

◆ QWindowsVistaStylePrivate()

QWindowsVistaStylePrivate::QWindowsVistaStylePrivate ( )
inline

Definition at line 115 of file qwindowsvistastyle_p_p.h.

References init().

Here is the call graph for this function:

◆ ~QWindowsVistaStylePrivate()

QWindowsVistaStylePrivate::~QWindowsVistaStylePrivate ( )
inline

Definition at line 118 of file qwindowsvistastyle_p_p.h.

References cleanup().

Here is the call graph for this function:

Member Function Documentation

◆ animationTime()

QTime QWindowsVistaStylePrivate::animationTime ( ) const

Animations are started at a frame that is based on the current time, which makes it impossible to run baseline tests with this style. Allow overriding through a dynamic property.

Definition at line 1038 of file qwindowsvistastyle.cpp.

◆ backingStoreForWidget()

QBackingStore * QWindowsVistaStylePrivate::backingStoreForWidget ( const QWidget * widget)
static

Definition at line 315 of file qwindowsvistastyle.cpp.

References QPainter::QWidget.

Here is the call graph for this function:

◆ buffer()

HBITMAP QWindowsVistaStylePrivate::buffer ( int w = 0,
int h = 0 )

Returns a native buffer (DIB section) of at least the size of ( x , y ). The buffer has a 32 bit depth, to not lose the alpha values on proper alpha-pixmaps.

Definition at line 397 of file qwindowsvistastyle.cpp.

◆ bufferHDC()

HDC QWindowsVistaStylePrivate::bufferHDC ( )
inline

Definition at line 137 of file qwindowsvistastyle_p_p.h.

◆ cleanup()

void QWindowsVistaStylePrivate::cleanup ( bool force = false)

Definition at line 188 of file qwindowsvistastyle.cpp.

Referenced by ~QWindowsVistaStylePrivate().

Here is the caller graph for this function:

◆ cleanupHandleMap()

void QWindowsVistaStylePrivate::cleanupHandleMap ( )

Definition at line 300 of file qwindowsvistastyle.cpp.

◆ createTheme()

HTHEME QWindowsVistaStylePrivate::createTheme ( int theme,
const QWidget * widget )
static

Definition at line 306 of file qwindowsvistastyle.cpp.

◆ drawBackground()

bool QWindowsVistaStylePrivate::drawBackground ( QWindowsThemeData & themeData,
qreal correctionFactor = 1 )

Main theme drawing function. Determines the correct lowlevel drawing method depending on several factors. Use drawBackgroundThruNativeBuffer() if:

Definition at line 622 of file qwindowsvistastyle.cpp.

References QPaintEngine::QPainter, and QPainter::QWidget.

Here is the call graph for this function:

◆ drawBackgroundDirectly()

bool QWindowsVistaStylePrivate::drawBackgroundDirectly ( HDC dc,
QWindowsThemeData & themeData,
qreal additionalDevicePixelRatio )

This function draws the theme parts directly to the paintengines HDC. Do not use this if you need to perform other transformations on the resulting data.

Definition at line 681 of file qwindowsvistastyle.cpp.

References QPaintEngine::QPainter.

Here is the call graph for this function:

◆ drawBackgroundThruNativeBuffer()

bool QWindowsVistaStylePrivate::drawBackgroundThruNativeBuffer ( QWindowsThemeData & themeData,
qreal additionalDevicePixelRatio,
qreal correctionFactor )

This function uses a secondary Native doublebuffer for painting parts. It should only be used when the painteengine doesn't provide a proper HDC for direct painting (e.g. when doing a grabWidget(), painting to other pixmaps etc), or when special transformations are needed (e.g. flips (horizontal mirroring only, vertical are handled by the theme engine).

correctionFactor is an additional factor used to scale up controls that are too small on High DPI screens, as has been observed for WP_MDICLOSEBUTTON, WP_MDIRESTOREBUTTON, WP_MDIMINBUTTON (QTBUG-75927).

Definition at line 733 of file qwindowsvistastyle.cpp.

References ThemeMapData::dataValid, QPaintEngine::QPainter, and UnknownAlpha.

Here is the call graph for this function:

◆ fixAlphaChannel()

bool QWindowsVistaStylePrivate::fixAlphaChannel ( const QRect & rect)

When the theme engine paints both a true alpha pixmap and a glyph into our buffer, the glyph might not contain a proper alpha value. The rule of thumb for premultiplied pixmaps is that the color values of a pixel can never be higher than the alpha values, so we use this to our advantage here, and fix all instances where this occurs.

Definition at line 551 of file qwindowsvistastyle.cpp.

◆ fixedPixelMetric()

int QWindowsVistaStylePrivate::fixedPixelMetric ( QStyle::PixelMetric pm)
static

Definition at line 254 of file qwindowsvistastyle.cpp.

◆ hasAlphaChannel()

bool QWindowsVistaStylePrivate::hasAlphaChannel ( const QRect & rect)

Returns true if the native doublebuffer contains pixels with varying alpha value.

Definition at line 522 of file qwindowsvistastyle.cpp.

◆ hdcForWidgetBackingStore()

HDC QWindowsVistaStylePrivate::hdcForWidgetBackingStore ( const QWidget * widget)
static

Definition at line 325 of file qwindowsvistastyle.cpp.

◆ init()

void QWindowsVistaStylePrivate::init ( bool force = false)

Definition at line 175 of file qwindowsvistastyle.cpp.

Referenced by QWindowsVistaStylePrivate().

Here is the caller graph for this function:

◆ isItemViewDelegateLineEdit()

bool QWindowsVistaStylePrivate::isItemViewDelegateLineEdit ( const QWidget * widget)
static

Definition at line 340 of file qwindowsvistastyle.cpp.

References QPainter::QWidget.

Here is the call graph for this function:

◆ isLineEditBaseColorSet()

bool QWindowsVistaStylePrivate::isLineEditBaseColorSet ( const QStyleOption * option,
const QWidget * widget )
static

Definition at line 354 of file qwindowsvistastyle.cpp.

◆ isTransparent()

bool QWindowsVistaStylePrivate::isTransparent ( QWindowsThemeData & themeData)

Returns true if the part contains any transparency at all. This does not indicate what kind of transparency we're dealing with. It can be

  • Alpha transparency
  • Masked transparency

Definition at line 461 of file qwindowsvistastyle.cpp.

◆ pixelMetricFromSystemDp()

int QWindowsVistaStylePrivate::pixelMetricFromSystemDp ( QStyle::PixelMetric pm,
const QStyleOption * option = nullptr,
const QWidget * widget = nullptr )
static

Definition at line 225 of file qwindowsvistastyle.cpp.

◆ region()

QRegion QWindowsVistaStylePrivate::region ( QWindowsThemeData & themeData)

Returns a QRegion of the region of the part

Definition at line 471 of file qwindowsvistastyle.cpp.

◆ swapAlphaChannel()

bool QWindowsVistaStylePrivate::swapAlphaChannel ( const QRect & rect,
bool allPixels = false )

Swaps the alpha values on certain pixels: 0xFF?????? -> 0x00?????? 0x00?????? -> 0xFF?????? Used to determine the mask of a non-alpha transparent pixmap in the native doublebuffer, and swap the alphas so we may paint the image as a Premultiplied QImage with drawImage(), and obtain the mask transparency.

Definition at line 582 of file qwindowsvistastyle.cpp.

◆ themeName()

QString QWindowsVistaStylePrivate::themeName ( int theme)
static

Definition at line 335 of file qwindowsvistastyle.cpp.

◆ transitionsEnabled()

bool QWindowsVistaStylePrivate::transitionsEnabled ( ) const

Definition at line 210 of file qwindowsvistastyle.cpp.

◆ useVista()

bool QWindowsVistaStylePrivate::useVista ( bool update = false)
static

Definition at line 165 of file qwindowsvistastyle.cpp.

Referenced by QWindowsThemeData::handle(), QWindowsVistaAnimation::isUpdateNeeded(), QWindowsVistaStyle::standardIcon(), QWindowsVistaStyle::standardPixmap(), and QWindowsVistaStyle::unpolish().

Here is the caller graph for this function:

◆ winId()

HWND QWindowsVistaStylePrivate::winId ( const QWidget * widget)
static

This function will always return a valid window handle, and might create a limbo widget to do so. We often need a window handle to for example open theme data, so this function ensures that we get one.

Definition at line 375 of file qwindowsvistastyle.cpp.

Member Data Documentation

◆ assetFont

QFont QWindowsVistaStylePrivate::assetFont
protected

Definition at line 160 of file qwindowsvistastyle_p_p.h.

◆ groupBoxTextColor

QRgb QWindowsVistaStylePrivate::groupBoxTextColor = 0

Definition at line 151 of file qwindowsvistastyle_p_p.h.

◆ groupBoxTextColorDisabled

QRgb QWindowsVistaStylePrivate::groupBoxTextColorDisabled = 0

Definition at line 152 of file qwindowsvistastyle_p_p.h.

◆ hasInitColors

bool QWindowsVistaStylePrivate::hasInitColors = false

Definition at line 154 of file qwindowsvistastyle_p_p.h.

◆ sliderTickColor

QRgb QWindowsVistaStylePrivate::sliderTickColor = 0

Definition at line 153 of file qwindowsvistastyle_p_p.h.


The documentation for this class was generated from the following files: