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
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 ()
 
 QObjectPrivate (int version=QObjectPrivateVersion)
 
virtual ~QObjectPrivate ()
 
void deleteChildren ()
 
void clearBindingStorage ()
 
void checkForIncompatibleLibraryVersion (int version) const
 
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
 
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 157 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 161 of file qquickwindowsxpstyle_p_p.h.

Constructor & Destructor Documentation

◆ QWindowsXPStylePrivate()

QQC2::QWindowsXPStylePrivate::QWindowsXPStylePrivate ( )
inline

Definition at line 184 of file qquickwindowsxpstyle_p_p.h.

References init().

+ Here is the call graph for this function:

◆ ~QWindowsXPStylePrivate()

QQC2::QWindowsXPStylePrivate::~QWindowsXPStylePrivate ( )
inline

Definition at line 187 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 321 of file qquickwindowsxpstyle.cpp.

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

+ Here is the call graph for this function:

◆ bufferHDC()

HDC QQC2::QWindowsXPStylePrivate::bufferHDC ( )
inline

Definition at line 200 of file qquickwindowsxpstyle_p_p.h.

Referenced by drawBackgroundThruNativeBuffer(), and region().

+ Here is the caller graph for this function:

◆ cleanup()

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

Definition at line 146 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 225 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 236 of file qquickwindowsxpstyle.cpp.

References NThemes, Q_UNLIKELY, qErrnoWarning(), qPrintable, qWarning, themeName(), QQC2::themeNames, and VistaTreeViewTheme.

Referenced by QQC2::XPThemeData::handle().

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

◆ 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 568 of file qquickwindowsxpstyle.cpp.

References QPainter::device(), QPaintDevice::devType(), drawBackgroundThruNativeBuffer(), QPainter::isActive(), painter, Q_ASSERT, Q_ASSERT_X, QPainter::restore(), QPainter::save(), and QInternal::Widget.

+ 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 646 of file qquickwindowsxpstyle.cpp.

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

+ 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 698 of file qquickwindowsxpstyle.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, QQC2::MaskAlpha, QRectF::moveTo(), QQC2::NoAlpha, QString::number(), painter, pix, qFuzzyCompare(), qPrintable, QStringLiteral, QQC2::RealAlpha, rect, region(), QTransform::rotate(), QQC2::scaleRect(), QQC2::scaleRegion(), QPainter::setClipping(), QPainter::setClipRegion(), QRectF::size(), Qt::SmoothTransformation, swapAlphaChannel(), themeName(), QRectF::topLeft(), QRectF::toRect(), QQC2::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 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 475 of file qquickwindowsxpstyle.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()

static 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 446 of file qquickwindowsxpstyle.cpp.

References rect.

Referenced by drawBackgroundThruNativeBuffer().

+ Here is the caller graph for this function:

◆ hasTheme()

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

Definition at line 224 of file qquickwindowsxpstyle_p_p.h.

References NThemes.

◆ init()

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

Definition at line 132 of file qquickwindowsxpstyle.cpp.

References NThemes, and useXP().

Referenced by QWindowsXPStylePrivate().

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

◆ isItemViewDelegateLineEdit()

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

◆ isLineEditBaseColorSet()

static 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 385 of file qquickwindowsxpstyle.cpp.

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 3011 of file qquickwindowsxpstyle.cpp.

References ButtonTheme, Qt::Horizontal, QQC2::QWindowsStylePrivate::InvalidMetric, QQC2::QStyle::PM_DockWidgetFrameWidth, QQC2::QStyle::PM_ExclusiveIndicatorHeight, QQC2::QStyle::PM_ExclusiveIndicatorWidth, QQC2::QStyle::PM_IndicatorHeight, QQC2::QStyle::PM_IndicatorWidth, QQC2::QStyle::PM_MdiSubWindowFrameWidth, QQC2::QStyle::PM_ProgressBarChunkWidth, QQC2::QStyle::PM_SliderThickness, QQC2::QStyle::PM_TitleBarHeight, QQC2::progressBarOrientation(), ProgressTheme, QQC2::XPThemeData::themeSize(), Qt::Tool, TrackBarTheme, and WindowTheme.

Referenced by QQC2::QWindowsXPStyle::pixelMetric().

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

◆ region()

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

Returns a QRegion of the region of the part

Definition at line 395 of file qquickwindowsxpstyle.cpp.

References bufferHDC(), ERROR, i, QQC2::QWindowsStylePrivate::nativeMetricScaleFactor(), 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:

◆ scrollBarGripperBounds()

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

Definition at line 2256 of file qquickwindowsxpstyle.cpp.

References QRect::height(), QQC2::XPThemeData::margins(), QQC2::QWindowsStylePrivate::nativeMetricScaleFactor(), QQC2::XPThemeData::partId, QQC2::XPThemeData::rect, QQC2::XPThemeData::size(), QQC2::QStyle::State_Horizontal, TMT_SIZINGMARGINS, QRect::topLeft(), QRect::width(), and QQC2::XPThemeData::window.

Referenced by QQC2::QWindowsXPStyle::drawComplexControl().

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

◆ 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 506 of file qquickwindowsxpstyle.cpp.

References rect.

Referenced by drawBackgroundThruNativeBuffer().

+ Here is the caller graph for this function:

◆ themeName()

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

Definition at line 254 of file qquickwindowsxpstyle.cpp.

References QString::fromWCharArray(), NThemes, and QQC2::themeNames.

+ Here is the call graph for this function:

◆ useXP()

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

◆ 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 300 of file qquickwindowsxpstyle.cpp.

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

Referenced by QQC2::XPThemeData::handle().

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

Member Data Documentation

◆ dockClose

QIcon QQC2::QWindowsXPStylePrivate::dockClose

Definition at line 228 of file qquickwindowsxpstyle_p_p.h.

◆ dockFloat

QIcon QQC2::QWindowsXPStylePrivate::dockFloat

Definition at line 228 of file qquickwindowsxpstyle_p_p.h.

◆ groupBoxTextColor

QRgb QQC2::QWindowsXPStylePrivate::groupBoxTextColor = 0

Definition at line 217 of file qquickwindowsxpstyle_p_p.h.

Referenced by QQC2::QWindowsXPStyle::styleHint().

◆ groupBoxTextColorDisabled

QRgb QQC2::QWindowsXPStylePrivate::groupBoxTextColorDisabled = 0

Definition at line 218 of file qquickwindowsxpstyle_p_p.h.

◆ hasInitColors

bool QQC2::QWindowsXPStylePrivate::hasInitColors = false

Definition at line 220 of file qquickwindowsxpstyle_p_p.h.

◆ sliderTickColor

QRgb QQC2::QWindowsXPStylePrivate::sliderTickColor = 0

Definition at line 219 of file qquickwindowsxpstyle_p_p.h.


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