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
QQC2::QWindowsXPStylePrivate Class Reference

#include <qquickwindowsxpstyle_p_p.h>

Inheritance diagram for QQC2::QWindowsXPStylePrivate:
Collaboration diagram for QQC2::QWindowsXPStylePrivate:

Public Types

enum  Theme {
  ButtonTheme , ComboboxTheme , EditTheme , HeaderTheme ,
  ListViewTheme , MenuTheme , ProgressTheme , RebarTheme ,
  ScrollBarTheme , SpinTheme , TabTheme , TaskDialogTheme ,
  ToolBarTheme , ToolTipTheme , TrackBarTheme , XpTreeViewTheme ,
  WindowTheme , StatusTheme , VistaTreeViewTheme , NThemes
}
Public Types inherited from QQC2::QWindowsStylePrivate
enum  { InvalidMetric = -23576 }
enum  {
  windowsItemFrame = 2 , windowsSepHeight = 9 , windowsItemHMargin = 3 , windowsItemVMargin = 2 ,
  windowsArrowHMargin = 6 , windowsRightBorder = 15 , windowsCheckMarkWidth = 12
}
Public Types inherited from QObjectPrivate
typedef void(* StaticMetaCallFunction) (QObject *, QMetaObject::Call, int, void **)
using ConnectionDataPointer = QExplicitlySharedDataPointer<ConnectionData>

Public Member Functions

 QWindowsXPStylePrivate ()
 ~QWindowsXPStylePrivate ()
void init (bool force=false)
void cleanup (bool force=false)
void cleanupHandleMap ()
HBITMAP buffer (int w=0, int h=0)
HDC bufferHDC ()
bool isTransparent (XPThemeData &themeData)
QRegion region (XPThemeData &themeData)
bool drawBackground (XPThemeData &themeData, qreal correctionFactor=1)
bool drawBackgroundThruNativeBuffer (XPThemeData &themeData, qreal aditionalDevicePixelRatio, qreal correctionFactor)
bool drawBackgroundDirectly (HDC dc, XPThemeData &themeData, qreal aditionalDevicePixelRatio)
bool hasAlphaChannel (const QRect &rect)
bool fixAlphaChannel (const QRect &rect)
bool swapAlphaChannel (const QRect &rect, bool allPixels=false)
Public Member Functions inherited from QQC2::QWindowsStylePrivate
 QWindowsStylePrivate ()
Public Member Functions inherited from QQC2::QCommonStylePrivate
QString calculateElidedText (const QString &text, const QTextOption &textOption, const QFont &font, const QRect &textRect, const Qt::Alignment valign, Qt::TextElideMode textElideMode, int flags, bool lastVisibleLineShouldBeElided, QPointF *paintStartPosition) const
QString toolButtonElideText (const QStyleOptionToolButton *toolbutton, const QRect &textRect, int flags) const
virtual void tabLayout (const QStyleOptionTab *opt, QRect *textRect, QRect *pixmapRect) const
Public Member Functions inherited from QObjectPrivate
void ensureExtraData ()
void setObjectNameWithoutBindings (const QString &name)
 QObjectPrivate (decltype(QObjectPrivateVersion) version=QObjectPrivateVersion)
virtual ~QObjectPrivate ()
void deleteChildren ()
void clearBindingStorage ()
void setParent_helper (QObject *)
void moveToThread_helper ()
void setThreadData_helper (QThreadData *currentData, QThreadData *targetData, QBindingStatus *status)
QObjectList receiverList (const char *signal) const
void ensureConnectionData ()
void addConnection (int signal, Connection *c)
int signalIndex (const char *signalName, const QMetaObject **meta=nullptr) const
bool isSignalConnected (uint signalIdx, bool checkDeclarative=true) const
bool maybeSignalConnected (uint signalIndex) const
bool isDeclarativeSignalConnected (uint signalIdx) const
void connectNotify (const QMetaMethod &signal)
void disconnectNotify (const QMetaMethod &signal)
void reinitBindingStorageAfterThreadMove ()
virtual std::string flagsForDumping () const
virtual void writeToDebugStream (QDebug &) const
QtPrivate::QPropertyAdaptorSlotObjectgetPropertyAdaptorSlotObject (const QMetaProperty &property)
Public Member Functions inherited from QObjectData
 QObjectData ()=default
virtual ~QObjectData ()=0
const QMetaObjectdynamicMetaObject () const

Static Public Member Functions

static int pixelMetricFromSystemDp (QStyle::PixelMetric pm, const QStyleOption *option=nullptr)
static int fixedPixelMetric (QStyle::PixelMetric pm, const QStyleOption *option=nullptr, const QWidget *widget=nullptr)
static HWND winId (const QWindow *window)
static bool useXP (bool update=false)
static QRect scrollBarGripperBounds (QStyle::State flags, XPThemeData *theme)
static HTHEME createTheme (int theme, HWND hwnd)
static QString themeName (int theme)
static bool hasTheme (int theme)
static bool isItemViewDelegateLineEdit (const QWidget *widget)
static bool isLineEditBaseColorSet (const QStyleOption *option, const QWidget *widget)
Static Public Member Functions inherited from QQC2::QWindowsStylePrivate
static int pixelMetricFromSystemDp (QStyle::PixelMetric pm, const QStyleOption *option=nullptr)
static int fixedPixelMetric (QStyle::PixelMetric pm)
static qreal devicePixelRatio (const QStyleOption *option=nullptr)
static qreal devicePixelRatio (const QWindow *win)
static qreal nativeMetricScaleFactor (const QStyleOption *option=nullptr)
static qreal nativeMetricScaleFactor (const QWindow *win)
static bool isDarkMode ()
Static Public Member Functions inherited from QQC2::QStylePrivate
static bool useFullScreenForPopup ()
Static Public Member Functions inherited from QObjectPrivate
static bool removeConnection (Connection *c)
static QObjectPrivateget (QObject *o)
static const QObjectPrivateget (const QObject *o)
template<typename Func1, typename Func2>
static QMetaObject::Connection connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiverPrivate, Func2 slot, Qt::ConnectionType type=Qt::AutoConnection)
template<typename Func1, typename Func2>
static bool disconnect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiverPrivate, Func2 slot)
static QMetaObject::Connection connectImpl (const QObject *sender, int signal_index, const QObject *receiver, void **slot, QtPrivate::QSlotObjectBase *slotObj, int type, const int *types, const QMetaObject *senderMetaObject)
static QMetaObject::Connection connect (const QObject *sender, int signal_index, QtPrivate::QSlotObjectBase *slotObj, Qt::ConnectionType type)
static QMetaObject::Connection connect (const QObject *sender, int signal_index, const QObject *receiver, QtPrivate::QSlotObjectBase *slotObj, Qt::ConnectionType type)
static bool disconnect (const QObject *sender, int signal_index, void **slot)
static bool disconnect (const QObject *sender, int signal_index, const QObject *receiver, void **slot)

Public Attributes

QRgb groupBoxTextColor = 0
QRgb groupBoxTextColorDisabled = 0
QRgb sliderTickColor = 0
bool hasInitColors = false
QIcon dockFloat
QIcon dockClose
Public Attributes inherited from QQC2::QWindowsStylePrivate
QList< const QWidget * > seenAlt
int menuBarTimer = 0
QColor inactiveCaptionText
QColor activeCaptionColor
QColor activeGradientCaptionColor
QColor inactiveCaptionColor
QColor inactiveGradientCaptionColor
Public Attributes inherited from QQC2::QCommonStylePrivate
QIcon tabBarcloseButtonIcon
Public Attributes inherited from QQC2::QStylePrivate
int layoutSpacingIndex = -1
QStyleproxyStyle
Public Attributes inherited from QObjectPrivate
ExtraDataextraData
QAtomicPointer< QThreadDatathreadData
QAtomicPointer< ConnectionDataconnections
union { 
   QObject *   currentChildBeingDeleted 
   QAbstractDeclarativeData *   declarativeData 
}; 
QAtomicPointer< QtSharedPointer::ExternalRefCountDatasharedRefcount
Public Attributes inherited from QObjectData
QObjectq_ptr
QObjectparent
QObjectList children
uint isWidget: 1
uint blockSig: 1
uint wasDeleted: 1
uint isDeletingChildren: 1
uint sendChildEvents: 1
uint receiveChildEvents: 1
uint isWindow: 1
uint deleteLaterCalled: 1
uint isQuickItem: 1
uint willBeWidget: 1
uint wasWidget: 1
uint receiveParentEvents: 1
uint unused: 20
QAtomicInt postedEvents
QDynamicMetaObjectDatametaObject
QBindingStorage bindingStorage

Detailed Description

Definition at line 158 of file qquickwindowsxpstyle_p_p.h.

Member Enumeration Documentation

◆ Theme

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

Definition at line 162 of file qquickwindowsxpstyle_p_p.h.

Constructor & Destructor Documentation

◆ QWindowsXPStylePrivate()

QQC2::QWindowsXPStylePrivate::QWindowsXPStylePrivate ( )
inline

Definition at line 185 of file qquickwindowsxpstyle_p_p.h.

References init().

Here is the call graph for this function:

◆ ~QWindowsXPStylePrivate()

QQC2::QWindowsXPStylePrivate::~QWindowsXPStylePrivate ( )
inline

Definition at line 188 of file qquickwindowsxpstyle_p_p.h.

References cleanup().

Here is the call graph for this function:

Member Function Documentation

◆ buffer()

HBITMAP QQC2::QWindowsXPStylePrivate::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 322 of file qquickwindowsxpstyle.cpp.

◆ bufferHDC()

HDC QQC2::QWindowsXPStylePrivate::bufferHDC ( )
inline

Definition at line 201 of file qquickwindowsxpstyle_p_p.h.

◆ cleanup()

void QQC2::QWindowsXPStylePrivate::cleanup ( bool force = false)

Definition at line 147 of file qquickwindowsxpstyle.cpp.

References cleanupHandleMap().

Referenced by ~QWindowsXPStylePrivate().

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

◆ cleanupHandleMap()

void QQC2::QWindowsXPStylePrivate::cleanupHandleMap ( )

Definition at line 226 of file qquickwindowsxpstyle.cpp.

Referenced by cleanup().

Here is the caller graph for this function:

◆ createTheme()

HTHEME QQC2::QWindowsXPStylePrivate::createTheme ( int theme,
HWND hwnd )
static

Definition at line 237 of file qquickwindowsxpstyle.cpp.

◆ drawBackground()

bool QQC2::QWindowsXPStylePrivate::drawBackground ( XPThemeData & themeData,
qreal correctionFactor = 1 )

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

Definition at line 569 of file qquickwindowsxpstyle.cpp.

References QQC2::XPThemeData::painter, and QPaintEngine::QPainter.

Here is the call graph for this function:

◆ drawBackgroundDirectly()

bool QQC2::QWindowsXPStylePrivate::drawBackgroundDirectly ( HDC dc,
XPThemeData & 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 647 of file qquickwindowsxpstyle.cpp.

References QQC2::XPThemeData::painter, QQC2::XPThemeData::partId, QPaintEngine::QPainter, and QQC2::XPThemeData::stateId.

Here is the call graph for this function:

◆ drawBackgroundThruNativeBuffer()

bool QQC2::QWindowsXPStylePrivate::drawBackgroundThruNativeBuffer ( XPThemeData & 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 (horizonal 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 699 of file qquickwindowsxpstyle.cpp.

References QQC2::ThemeMapKey::ThemeMapKey(), QQC2::ThemeMapData::alphaType, QQC2::ThemeMapData::dataValid, QQC2::ThemeMapData::hadInvalidAlpha, QQC2::ThemeMapData::hasAlphaChannel, isTransparent(), QQC2::MaskAlpha, QQC2::NoAlpha, QQC2::XPThemeData::painter, QQC2::XPThemeData::partId, QQC2::ThemeMapData::partIsTransparent, QPaintEngine::QPainter, QQC2::RealAlpha, QQC2::XPThemeData::stateId, QQC2::UnknownAlpha, and QQC2::ThemeMapData::wasAlphaSwapped.

Here is the call graph for this function:

◆ fixAlphaChannel()

bool QQC2::QWindowsXPStylePrivate::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 occures.

Definition at line 476 of file qquickwindowsxpstyle.cpp.

◆ fixedPixelMetric()

int QQC2::QWindowsXPStylePrivate::fixedPixelMetric ( QStyle::PixelMetric pm,
const QStyleOption * option = nullptr,
const QWidget * widget = nullptr )
static

◆ hasAlphaChannel()

bool QQC2::QWindowsXPStylePrivate::hasAlphaChannel ( const QRect & rect)

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

Definition at line 447 of file qquickwindowsxpstyle.cpp.

◆ hasTheme()

bool QQC2::QWindowsXPStylePrivate::hasTheme ( int theme)
inlinestatic

Definition at line 225 of file qquickwindowsxpstyle_p_p.h.

◆ init()

void QQC2::QWindowsXPStylePrivate::init ( bool force = false)

Definition at line 133 of file qquickwindowsxpstyle.cpp.

References useXP().

Referenced by QWindowsXPStylePrivate().

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

◆ isItemViewDelegateLineEdit()

bool QQC2::QWindowsXPStylePrivate::isItemViewDelegateLineEdit ( const QWidget * widget)
static

◆ isLineEditBaseColorSet()

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

◆ isTransparent()

bool QQC2::QWindowsXPStylePrivate::isTransparent ( XPThemeData & 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 386 of file qquickwindowsxpstyle.cpp.

References QQC2::XPThemeData::partId, and QQC2::XPThemeData::stateId.

Referenced by drawBackgroundThruNativeBuffer().

Here is the caller graph for this function:

◆ pixelMetricFromSystemDp()

int QQC2::QWindowsXPStylePrivate::pixelMetricFromSystemDp ( QStyle::PixelMetric pm,
const QStyleOption * option = nullptr )
static

Definition at line 3037 of file qquickwindowsxpstyle.cpp.

◆ region()

QRegion QQC2::QWindowsXPStylePrivate::region ( XPThemeData & themeData)

Returns a QRegion of the region of the part

Definition at line 396 of file qquickwindowsxpstyle.cpp.

◆ scrollBarGripperBounds()

QRect QQC2::QWindowsXPStylePrivate::scrollBarGripperBounds ( QStyle::State flags,
XPThemeData * theme )
static

Definition at line 2258 of file qquickwindowsxpstyle.cpp.

◆ swapAlphaChannel()

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

Swaps the alpha values on certain pixels: 0xFF?????? -> 0x00?????? 0x00?????? -> 0xFF?????? Used to determin 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 507 of file qquickwindowsxpstyle.cpp.

◆ themeName()

QString QQC2::QWindowsXPStylePrivate::themeName ( int theme)
static

Definition at line 255 of file qquickwindowsxpstyle.cpp.

◆ useXP()

bool QQC2::QWindowsXPStylePrivate::useXP ( bool update = false)
static

Definition at line 121 of file qquickwindowsxpstyle.cpp.

Referenced by QQC2::QWindowsXPStyle::drawComplexControl(), QQC2::QWindowsXPStyle::drawControl(), QQC2::QWindowsXPStyle::drawPrimitive(), QQC2::XPThemeData::handle(), init(), QQC2::QWindowsXPStyle::standardIcon(), and QQC2::QWindowsXPStyle::subElementRect().

Here is the caller graph for this function:

◆ winId()

HWND QQC2::QWindowsXPStylePrivate::winId ( const QWindow * window)
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 301 of file qquickwindowsxpstyle.cpp.

Member Data Documentation

◆ dockClose

QIcon QQC2::QWindowsXPStylePrivate::dockClose

Definition at line 229 of file qquickwindowsxpstyle_p_p.h.

◆ dockFloat

QIcon QQC2::QWindowsXPStylePrivate::dockFloat

Definition at line 229 of file qquickwindowsxpstyle_p_p.h.

◆ groupBoxTextColor

QRgb QQC2::QWindowsXPStylePrivate::groupBoxTextColor = 0

Definition at line 218 of file qquickwindowsxpstyle_p_p.h.

◆ groupBoxTextColorDisabled

QRgb QQC2::QWindowsXPStylePrivate::groupBoxTextColorDisabled = 0

Definition at line 219 of file qquickwindowsxpstyle_p_p.h.

◆ hasInitColors

bool QQC2::QWindowsXPStylePrivate::hasInitColors = false

Definition at line 221 of file qquickwindowsxpstyle_p_p.h.

◆ sliderTickColor

QRgb QQC2::QWindowsXPStylePrivate::sliderTickColor = 0

Definition at line 220 of file qquickwindowsxpstyle_p_p.h.


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