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
QWindows11Style Class Reference

The QWindows11Style class provides a look and feel suitable for applications on Microsoft Windows 11. More...

#include <qwindows11style_p.h>

+ Inheritance diagram for QWindows11Style:
+ Collaboration diagram for QWindows11Style:

Public Member Functions

 QWindows11Style ()
 Constructs a QWindows11Style object.
 
 ~QWindows11Style () override
 Destructor.
 
void drawComplexControl (ComplexControl control, const QStyleOptionComplex *option, QPainter *painter, const QWidget *widget) const override
 
void drawPrimitive (PrimitiveElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget) const override
 
QRect subElementRect (QStyle::SubElement element, const QStyleOption *option, const QWidget *widget=nullptr) const override
 
QRect subControlRect (ComplexControl control, const QStyleOptionComplex *option, SubControl subControl, const QWidget *widget) const override
 
void drawControl (ControlElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget) const override
 
int styleHint (StyleHint hint, const QStyleOption *opt=nullptr, const QWidget *widget=nullptr, QStyleHintReturn *returnData=nullptr) const override
 
void polish (QWidget *widget) override
 
QSize sizeFromContents (ContentsType type, const QStyleOption *option, const QSize &size, const QWidget *widget) const override
 
int pixelMetric (PixelMetric metric, const QStyleOption *option=nullptr, const QWidget *widget=nullptr) const override
 
void polish (QPalette &pal) override
 
void unpolish (QWidget *widget) override
 
- Public Member Functions inherited from QWindowsVistaStyle
 QWindowsVistaStyle ()
 Constructs a QWindowsVistaStyle object.
 
 ~QWindowsVistaStyle () override
 Destructor.
 
void drawPrimitive (PrimitiveElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget=nullptr) const override
 
void drawControl (ControlElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget) const override
 
void drawComplexControl (ComplexControl control, const QStyleOptionComplex *option, QPainter *painter, const QWidget *widget) const override
 
QSize sizeFromContents (ContentsType type, const QStyleOption *option, const QSize &size, const QWidget *widget) const override
 
QRect subElementRect (SubElement element, const QStyleOption *option, const QWidget *widget) const override
 
QRect subControlRect (ComplexControl cc, const QStyleOptionComplex *opt, SubControl sc, const QWidget *widget) const override
 
SubControl hitTestComplexControl (ComplexControl control, const QStyleOptionComplex *option, const QPoint &pos, const QWidget *widget=nullptr) const override
 
QIcon standardIcon (StandardPixmap standardIcon, const QStyleOption *option=nullptr, const QWidget *widget=nullptr) const override
 \reimp
 
QPixmap standardPixmap (StandardPixmap standardPixmap, const QStyleOption *opt, const QWidget *widget=nullptr) const override
 
int pixelMetric (PixelMetric metric, const QStyleOption *option=nullptr, const QWidget *widget=nullptr) const override
 
int styleHint (StyleHint hint, const QStyleOption *opt=nullptr, const QWidget *widget=nullptr, QStyleHintReturn *returnData=nullptr) const override
 
void polish (QWidget *widget) override
 
void unpolish (QWidget *widget) override
 
void polish (QPalette &pal) override
 
void polish (QApplication *app) override
 

Protected Member Functions

 QWindows11Style (QWindows11StylePrivate &dd)
 
- Protected Member Functions inherited from QWindowsVistaStyle
 QWindowsVistaStyle (QWindowsVistaStylePrivate &dd)
 

Friends

class QStyleFactory
 

Detailed Description

The QWindows11Style class provides a look and feel suitable for applications on Microsoft Windows 11.

Since
6.6

\inmodule QtWidgets

Warning
This style is only available on the Windows 11 platform and above.
See also
QWindows11Style QWindowsVistaStyle, QMacStyle, QFusionStyle

Definition at line 26 of file qwindows11style_p.h.

Constructor & Destructor Documentation

◆ QWindows11Style() [1/2]

QWindows11Style::QWindows11Style ( )

Constructs a QWindows11Style object.

Definition at line 135 of file qwindows11style.cpp.

◆ ~QWindows11Style()

QWindows11Style::~QWindows11Style ( )
overridedefault

Destructor.

◆ QWindows11Style() [2/2]

QWindows11Style::QWindows11Style ( QWindows11StylePrivate & dd)
protected

Constructs a QWindows11Style object.

Definition at line 143 of file qwindows11style.cpp.

Member Function Documentation

◆ drawComplexControl()

void QWindows11Style::drawComplexControl ( ComplexControl control,
const QStyleOptionComplex * option,
QPainter * painter,
const QWidget * widget ) const
override

see drawPrimitive for comments on the animation support

Definition at line 157 of file qwindows11style.cpp.

References QRectF::adjust(), QRect::adjusted(), QRectF::adjusted(), Qt::AlignCenter, Qt::AlignHCenter, Qt::AlignVCenter, animation, QPainter::Antialiasing, QPalette::Base, QStyle::CC_ScrollBar, controlFillSolid, controlStrokeSecondary, controlStrongFill, QVariantAnimation::currentValue, d, QWindowsVistaStyle::drawComplexControl(), QPainter::drawEllipse(), QPainter::drawLine(), QPainter::drawLines(), QPainter::drawRect(), QPainter::drawRoundedRect(), QPainter::drawText(), QFontMetrics::elidedText(), Qt::ElideRight, QPainter::fillRect(), QPainter::fontMetrics(), frameColorLight, Qt::gray, Qt::Horizontal, QWidget::isActiveWindow, QRect::isValid(), QWidget::mapFromGlobal(), Qt::NoBrush, Qt::NoPen, painter, pos, QCursor::pos(), QObject::property(), proxy, qMin(), rect, QStyleOption::rect, QPainter::restore(), QPainter::save(), QPainter::scale(), secondLevelRoundingRadius, QPainter::setBrush(), QPainter::setClipRegion(), QPainter::setFont(), QPainter::setPen(), QObject::setProperty(), QPainter::setRenderHint(), shellCloseButtonColor, QStyle::sliderPositionFromValue(), state, styleObject(), sub, SubControls, subElementRect(), subtleHighlightColor, surfaceStroke, QWidget::testAttribute(), textRect, QSlider::TicksAbove, QSlider::TicksBelow, title, QVariant::toBool(), QVariant::toFloat(), QVariant::toInt(), topLevelRoundingRadius, QVariant::toRect(), QPainter::translate(), Qt::Vertical, Qt::WA_UnderMouse, widget, QRect::width(), Qt::WindowContextHelpButtonHint, Qt::WindowMaximizeButtonHint, Qt::WindowMaximized, Qt::WindowMinimizeButtonHint, Qt::WindowMinimized, Qt::WindowShadeButtonHint, Qt::WindowSystemMenuHint, and WINUI3Colors.

+ Here is the call graph for this function:

◆ drawControl()

void QWindows11Style::drawControl ( ControlElement element,
const QStyleOption * option,
QPainter * painter,
const QWidget * widget ) const
override

Definition at line 1074 of file qwindows11style.cpp.

References Qt::AbsoluteSize, QIcon::Active, QRect::adjusted(), QRectF::adjusted(), Qt::AlignCenter, Qt::AlignHCenter, Qt::AlignLeft, alignment, Qt::AlignRight, Qt::AlignVCenter, QPainter::Antialiasing, QStyleOptionToolButton::Arrow, QWidget::backgroundRole(), QStyleOptionHeader::Beginning, QRect::bottom(), QFontMetrics::boundingRect(), QFrame::Box, QPainter::brush(), QPainter::brushOrigin(), btn, QPalette::Button, QPalette::ButtonText, QPalette::buttonText(), QStyle::CE_ItemViewItem, QStyle::CE_ProgressBarContents, QStyle::CE_ProgressBarGroove, QStyle::CE_ProgressBarLabel, QStyle::CE_ShapedFrame, QStyle::CE_TabBarTabShape, Qt::Checked, QBrush::color(), controlFillSecondary, controlFillTertiary, controlStrokeOnAccentSecondary, controlStrokePrimary, controlStrokeSecondary, controlTextSecondary, QPalette::Current, d, QStyleOptionButton::DefaultButton, QStyleOptionMenuItem::DefaultItem, Qt::Dense4Pattern, QPainter::device(), QPixmap::devicePixelRatio(), QPaintDevice::devicePixelRatio(), QStyleOption::direction, QIcon::Disabled, QPalette::Disabled, QCommonStyle::drawControl(), QWindowsVistaStyle::drawControl(), QPainter::drawLine(), QPainter::drawPixmap(), QPainter::drawRect(), QPainter::drawRoundedRect(), QPainter::drawText(), QStyleOptionHeader::End, QStyleOptionButton::features, fill(), QStyleOptionButton::Flat, font, QStyleOptionMenuItem::font, QStyleOption::fontMetrics, frameColorLight, frameColorStrong, Qt::gray, QStyleOptionButton::HasMenu, header(), QRect::height(), Qt::Horizontal, QStyleOptionButton::icon, QListView::IconMode, QStyleOptionButton::iconSize, QString::isEmpty(), QIcon::isNull(), QString::left(), Qt::LeftToRight, QRect::marginsRemoved(), QRectF::marginsRemoved(), QString::mid(), Qt::NoBrush, Qt::NoPen, QIcon::Normal, QStyleOptionMenuItem::NotCheckable, QIcon::Off, QIcon::On, QStyleOptionHeader::OnlyOneSection, painter, QStyleOption::palette, QFrame::Panel, Qt::PartiallyChecked, QStyle::PE_IndicatorItemViewItemCheck, pixelMetric(), QIcon::pixmap(), pixmap, QFrame::Plain, proxy, qDrawPlainRoundedRect(), qDrawShadePanel(), qDrawShadeRect(), qMax(), qMin(), QFrame::Raised, rect, QStyleOption::rect, QPainter::restore(), Qt::RightToLeft, QPainter::save(), secondLevelRoundingRadius, QIcon::Selected, QStyleOptionMenuItem::Separator, QColor::setAlpha(), QFont::setBold(), QPainter::setBrush(), QPainter::setBrushOrigin(), QPalette::setColor(), QPainter::setFont(), QRect::setLeft(), QPainter::setPen(), QFont::setPointSize(), QPainter::setRenderHint(), QRect::setRight(), QPixmap::size(), state, QStyleOption::state, QStyle::State_Enabled, QStyle::State_Horizontal, QStyle::State_NoChange, QStyle::State_Off, QStyle::State_On, QStyle::State_Open, QStyle::State_Raised, QStyle::State_Selected, QStyle::State_Sunken, styleHint(), subElementRect(), QStyleOptionMenuItem::SubMenu, subtleHighlightColor, subtlePressedColor, QFrame::Sunken, text, QPalette::Text, QStyleOptionButton::text, Qt::TextDontClip, Qt::TextHideMnemonic, textOnAccentPrimary, textOnAccentSecondary, textRect, Qt::TextShowMnemonic, Qt::TextSingleLine, Qt::ToolButtonIconOnly, Qt::ToolButtonTextOnly, Qt::ToolButtonTextUnderIcon, QRect::topRight(), tr, Qt::Unchecked, Qt::Vertical, view, QListView::viewMode, visualRect(), QStyle::visualRect(), widget, QPixmap::width(), QRect::width(), QPalette::WindowText, WINUI3Colors, QRect::x(), and QRect::y().

◆ drawPrimitive()

void QWindows11Style::drawPrimitive ( PrimitiveElement element,
const QStyleOption * option,
QPainter * painter,
const QWidget * widget ) const
override

Definition at line 684 of file qwindows11style.cpp.

References Qt::AbsoluteSize, QRectF::adjust(), QRectF::adjusted(), Qt::AlignHCenter, Qt::AlignLeft, Qt::AlignVCenter, animation, QPainter::Antialiasing, QPalette::Base, QPalette::base(), QPalette::buttonText(), QBrush::color(), Qt::color1, controlFillSecondary, controlFillTertiary, controlStrokePrimary, controlStrokeSecondary, QVariantAnimation::currentValue, d, QPainter::drawArc(), QPainter::drawEllipse(), QPainter::drawLine(), QPainter::drawPie(), QWindowsVistaStyle::drawPrimitive(), QPainter::drawRoundedRect(), QPainter::drawText(), QPainter::fillRect(), QObject::findChild(), QStyleOptionFrame::Flat, frame, frameColorLight, frameColorStrong, QFrame::frameShape, QWidget::height, QObject::inherits(), QRect::marginsRemoved(), QRectF::marginsRemoved(), menuPanelFill, QRectF::moveCenter(), Qt::NoBrush, QFrame::NoFrame, Qt::NoPen, QObject::objectName, p1, p2, painter, QWidget::palette, panel, QStyle::PE_FrameMenu, QStyle::PE_FrameWindow, QStyle::PE_PanelItemViewRow, QStyle::PE_PanelMenu, QStyle::PE_Widget, QObject::property(), proxy, rect, QWidget::rect, QPainter::restore(), QPainter::save(), secondLevelRoundingRadius, QPainter::setBrush(), QPainter::setClipRegion(), QBrush::setColor(), QPainter::setFont(), QRectF::setLeft(), QPainter::setPen(), QObject::setProperty(), QPainter::setRenderHint(), QRectF::setWidth(), state, styleObject(), subtleHighlightColor, surfaceStroke, QVariant::toFloat(), QVariant::toInt(), topLevelRoundingRadius, widget, QRectF::width(), QWidget::width, and WINUI3Colors.

+ Here is the call graph for this function:

◆ pixelMetric()

int QWindows11Style::pixelMetric ( PixelMetric metric,
const QStyleOption * option = nullptr,
const QWidget * widget = nullptr ) const
override

Definition at line 1981 of file qwindows11style.cpp.

References QStyleHelper::dpiScaled(), QWindowsVistaStyle::pixelMetric(), QStyle::PM_ExclusiveIndicatorHeight, QStyle::PM_ExclusiveIndicatorWidth, QStyle::PM_IndicatorHeight, QStyle::PM_IndicatorWidth, QStyle::PM_ScrollBarExtent, QStyle::PM_SliderLength, QStyle::PM_TitleBarButtonIconSize, QStyle::PM_TitleBarButtonSize, and widget.

Referenced by drawControl().

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

◆ polish() [1/2]

void QWindows11Style::polish ( QPalette & result)
override

Definition at line 2114 of file qwindows11style.cpp.

References QPalette::Accent, QPalette::Active, QPalette::Button, QPalette::Dark, QPalette::Highlight, QPalette::HighlightedText, QPalette::Inactive, Qt::Light, QPalette::Light, populateLightSystemBasePalette(), SET_IF_UNRESOLVED, QGuiApplication::styleHints(), QPalette::Text, Qt::Unknown, QPalette::Window, and QPalette::WindowText.

+ Here is the call graph for this function:

◆ polish() [2/2]

◆ sizeFromContents()

QSize QWindows11Style::sizeFromContents ( ContentsType type,
const QStyleOption * option,
const QSize & size,
const QWidget * widget ) const
override

Definition at line 1946 of file qwindows11style.cpp.

References hMargin, QSize::isEmpty(), QSize::setHeight(), QSize::setWidth(), QWindowsVistaStyle::sizeFromContents(), widget, and QSize::width().

+ Here is the call graph for this function:

◆ styleHint()

int QWindows11Style::styleHint ( StyleHint hint,
const QStyleOption * opt = nullptr,
const QWidget * widget = nullptr,
QStyleHintReturn * returnData = nullptr ) const
override

Definition at line 1732 of file qwindows11style.cpp.

References QBrush::color(), hint(), opt, QStyleOption::palette, QColor::rgba(), QStyle::SH_ItemView_ShowDecorationSelected, QWindowsVistaStyle::styleHint(), QPalette::text(), and widget.

Referenced by drawControl().

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

◆ subControlRect()

QRect QWindows11Style::subControlRect ( ComplexControl control,
const QStyleOptionComplex * option,
SubControl subControl,
const QWidget * widget ) const
override

◆ subElementRect()

QRect QWindows11Style::subElementRect ( QStyle::SubElement element,
const QStyleOption * option,
const QWidget * widget = nullptr ) const
override

Definition at line 1746 of file qwindows11style.cpp.

References QRect::adjusted(), QObject::inherits(), item, QWidget::parentWidget(), ret, QStyle::SE_ItemViewItemText, QStyle::SE_LineEditContents, QWindowsVistaStyle::subElementRect(), and widget.

Referenced by drawComplexControl(), and drawControl().

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

◆ unpolish()

void QWindows11Style::unpolish ( QWidget * widget)
override

Definition at line 2061 of file qwindows11style.cpp.

References QWindowsVistaStyle::unpolish(), and widget.

+ Here is the call graph for this function:

Friends And Related Symbol Documentation

◆ QStyleFactory

friend class QStyleFactory
friend

Definition at line 57 of file qwindows11style_p.h.


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