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>.
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, HWND hwnd)
 
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
 
QIcon dockFloat
 
QIcon dockClose
 

Detailed Description

Definition at line 84 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 89 of file qwindowsvistastyle_p_p.h.

Constructor & Destructor Documentation

◆ QWindowsVistaStylePrivate()

QWindowsVistaStylePrivate::QWindowsVistaStylePrivate ( )
inline

Definition at line 111 of file qwindowsvistastyle_p_p.h.

References init().

+ Here is the call graph for this function:

◆ ~QWindowsVistaStylePrivate()

QWindowsVistaStylePrivate::~QWindowsVistaStylePrivate ( )
inline

Definition at line 114 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 1022 of file qwindowsvistastyle.cpp.

References QTime::currentTime().

+ Here is the call graph for this function:

◆ backingStoreForWidget()

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

Definition at line 304 of file qwindowsvistastyle.cpp.

References QWidget::backingStore(), QWidget::nativeParentWidget(), and widget.

Referenced by drawBackground(), and hdcForWidgetBackingStore().

+ Here is the call graph for this function:
+ Here is the caller 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 386 of file qwindowsvistastyle.cpp.

References Q_UNLIKELY, qDebug, qErrnoWarning(), and qMax().

+ Here is the call graph for this function:

◆ bufferHDC()

HDC QWindowsVistaStylePrivate::bufferHDC ( )
inline

Definition at line 133 of file qwindowsvistastyle_p_p.h.

Referenced by drawBackgroundThruNativeBuffer(), and region().

+ Here is the caller graph for this function:

◆ cleanup()

void QWindowsVistaStylePrivate::cleanup ( bool force = false)

Definition at line 179 of file qwindowsvistastyle.cpp.

References cleanupHandleMap().

Referenced by ~QWindowsVistaStylePrivate().

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

◆ cleanupHandleMap()

void QWindowsVistaStylePrivate::cleanupHandleMap ( )

Definition at line 291 of file qwindowsvistastyle.cpp.

References QWindowsThemeCache::clearAllThemeCaches().

Referenced by cleanup().

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

◆ createTheme()

HTHEME QWindowsVistaStylePrivate::createTheme ( int theme,
HWND hwnd )
static

Definition at line 297 of file qwindowsvistastyle.cpp.

References QWindowsThemeCache::createTheme(), and VistaTreeViewTheme.

Referenced by QWindowsThemeData::handle().

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

◆ 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 611 of file qwindowsvistastyle.cpp.

References backingStoreForWidget(), ComplexTransform, QPainter::device(), QPaintDevice::devicePixelRatio(), QPainter::deviceTransform(), QPaintDevice::devType(), drawBackgroundDirectly(), drawBackgroundThruNativeBuffer(), hdcForWidgetBackingStore(), QInternal::Image, QPainter::isActive(), isFullyOpaque(), QPainter::opacity(), QPaintEngine::paintDevice(), QPainter::paintEngine(), painter, Q_ASSERT_X, qFuzzyCompare(), QPainter::restore(), QPainter::save(), Qt::WA_TranslucentBackground, QInternal::Widget, and window().

+ 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 670 of file qwindowsvistastyle.cpp.

References area(), QPainter::clipRegion(), QPainter::deviceTransform(), deviceTransform(), QPainter::hasClipping(), QPainter::paintEngine(), painter, qPrintable, qt_hrgn_from_qregion(), scaleRect(), scaleRegion(), and QPaintEngine::systemClip().

Referenced by drawBackground().

+ Here is the call graph for this function:
+ Here is the caller 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 722 of file qwindowsvistastyle.cpp.

References area(), bufferHDC(), QPainter::clipRegion(), QImage::copy(), ThemeMapData::dataValid, QPainter::drawImage(), QPainter::drawPixmap(), QPixmapCache::find(), fixAlphaChannel(), QImage::Format_ARGB32_Premultiplied, QImage::Format_RGB32, QPixmap::fromImage(), hasAlpha(), hasAlphaChannel(), QRect::height(), QRectF::height(), QHash< Key, T >::insert(), QPixmapCache::insert(), Qt::IntersectClip, isTransparent(), Qt::KeepAspectRatio, MaskAlpha, QRectF::moveTo(), NoAlpha, QString::number(), painter, pix, qFuzzyCompare(), qPrintable, QStringLiteral, RealAlpha, rect, region(), QTransform::rotate(), scaleRect(), scaleRegion(), QPainter::setClipping(), QPainter::setClipRegion(), QRectF::size(), Qt::SmoothTransformation, swapAlphaChannel(), themeName(), QRectF::topLeft(), QRectF::toRect(), UnknownAlpha, QHash< Key, T >::value(), QRect::width(), QRectF::width(), QRect::x(), and QRect::y().

Referenced by drawBackground().

+ Here is the call graph for this function:
+ Here is the caller 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 540 of file qwindowsvistastyle.cpp.

References qAlpha(), qBlue(), qGreen(), qRed(), and rect.

Referenced by drawBackgroundThruNativeBuffer().

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

◆ fixedPixelMetric()

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

Definition at line 241 of file qwindowsvistastyle.cpp.

References QStyle::PM_DockWidgetTitleBarButtonMargin, QStyle::PM_MenuHMargin, QStyle::PM_MenuPanelWidth, QStyle::PM_MenuVMargin, and QStyle::PM_ScrollBarSliderMin.

Referenced by QWindowsVistaStyle::pixelMetric().

+ Here is the caller graph for this function:

◆ hasAlphaChannel()

bool QWindowsVistaStylePrivate::hasAlphaChannel ( const QRect & rect)

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

Definition at line 511 of file qwindowsvistastyle.cpp.

References rect.

Referenced by drawBackgroundThruNativeBuffer().

+ Here is the caller graph for this function:

◆ hdcForWidgetBackingStore()

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

Definition at line 314 of file qwindowsvistastyle.cpp.

References backingStoreForWidget(), QPlatformNativeInterface::nativeResourceForBackingStore(), QGuiApplication::platformNativeInterface(), QByteArrayLiteral, and widget.

Referenced by drawBackground(), and QWindowsThemeData::mask().

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

◆ init()

void QWindowsVistaStylePrivate::init ( bool force = false)

Definition at line 166 of file qwindowsvistastyle.cpp.

References useVista().

Referenced by QWindowsVistaStylePrivate().

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

◆ isItemViewDelegateLineEdit()

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

Definition at line 329 of file qwindowsvistastyle.cpp.

References QObject::inherits(), QWidget::parentWidget(), and widget.

Referenced by QWindowsVistaStyle::drawPrimitive().

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

◆ isLineEditBaseColorSet()

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

Definition at line 343 of file qwindowsvistastyle.cpp.

References QPalette::Base, QWidget::parentWidget(), and widget.

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

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

◆ 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 450 of file qwindowsvistastyle.cpp.

Referenced by drawBackgroundThruNativeBuffer().

+ Here is the caller graph for this function:

◆ pixelMetricFromSystemDp()

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

Definition at line 212 of file qwindowsvistastyle.cpp.

References ButtonTheme, Qt::Horizontal, QStyle::PM_DockWidgetFrameWidth, QStyle::PM_ExclusiveIndicatorHeight, QStyle::PM_ExclusiveIndicatorWidth, QStyle::PM_IndicatorHeight, QStyle::PM_IndicatorWidth, QStyle::PM_MdiSubWindowFrameWidth, QStyle::PM_ProgressBarChunkWidth, QStyle::PM_SliderThickness, QStyle::PM_TitleBarHeight, progressBarOrientation(), ProgressTheme, QWindowsThemeData::themeSize(), TrackBarTheme, widget, and WindowTheme.

Referenced by QWindowsVistaStyle::pixelMetric().

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

◆ region()

QRegion QWindowsVistaStylePrivate::region ( QWindowsThemeData & themeData)

Returns a QRegion of the region of the part

Definition at line 460 of file qwindowsvistastyle.cpp.

References bufferHDC(), ERROR, i, rd, rect, region(), and QRect::setCoords().

Referenced by drawBackgroundThruNativeBuffer(), and region().

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

◆ 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 571 of file qwindowsvistastyle.cpp.

References rect.

Referenced by drawBackgroundThruNativeBuffer().

+ Here is the caller graph for this function:

◆ themeName()

QString QWindowsVistaStylePrivate::themeName ( int theme)
static

Definition at line 324 of file qwindowsvistastyle.cpp.

References QWindowsThemeCache::themeName().

+ Here is the call graph for this function:

◆ transitionsEnabled()

bool QWindowsVistaStylePrivate::transitionsEnabled ( ) const

Definition at line 201 of file qwindowsvistastyle.cpp.

◆ useVista()

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

Definition at line 156 of file qwindowsvistastyle.cpp.

References QCoreApplication::instance().

Referenced by QWindowsVistaStyle::drawComplexControl(), QWindowsVistaStyle::drawControl(), QWindowsVistaStyle::drawPrimitive(), QWindowsThemeData::handle(), init(), QWindowsVistaAnimation::isUpdateNeeded(), QWindowsThemeData::isValid(), QWindowsVistaStyle::pixelMetric(), QWindowsVistaStyle::polish(), QWindowsVistaStyle::sizeFromContents(), QWindowsVistaStyle::standardIcon(), QWindowsVistaStyle::standardPixmap(), QWindowsVistaStyle::subControlRect(), QWindowsVistaStyle::subElementRect(), and QWindowsVistaStyle::unpolish().

+ Here is the call graph for this function:
+ 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 364 of file qwindowsvistastyle.cpp.

References QGuiApplication::allWindows(), Qt::Desktop, widget, and window().

Referenced by QWindowsThemeData::handle(), QWindowsVistaStyle::polish(), and QWindowsVistaStyle::subElementRect().

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

Member Data Documentation

◆ dockClose

QIcon QWindowsVistaStylePrivate::dockClose

Definition at line 151 of file qwindowsvistastyle_p_p.h.

◆ dockFloat

QIcon QWindowsVistaStylePrivate::dockFloat

Definition at line 151 of file qwindowsvistastyle_p_p.h.

◆ groupBoxTextColor

QRgb QWindowsVistaStylePrivate::groupBoxTextColor = 0

Definition at line 147 of file qwindowsvistastyle_p_p.h.

Referenced by QWindowsVistaStyle::styleHint().

◆ groupBoxTextColorDisabled

QRgb QWindowsVistaStylePrivate::groupBoxTextColorDisabled = 0

Definition at line 148 of file qwindowsvistastyle_p_p.h.

◆ hasInitColors

bool QWindowsVistaStylePrivate::hasInitColors = false

Definition at line 150 of file qwindowsvistastyle_p_p.h.

◆ sliderTickColor

QRgb QWindowsVistaStylePrivate::sliderTickColor = 0

Definition at line 149 of file qwindowsvistastyle_p_p.h.


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