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

The QWindowsVistaStyle class provides a look and feel suitable for applications on Microsoft Windows Vista. More...

#include <qwindowsvistastyle_p.h>

+ Inheritance diagram for QWindowsVistaStyle:
+ Collaboration diagram for QWindowsVistaStyle:

Public Member Functions

 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

 QWindowsVistaStyle (QWindowsVistaStylePrivate &dd)
 

Friends

class QStyleFactory
 

Detailed Description

The QWindowsVistaStyle class provides a look and feel suitable for applications on Microsoft Windows Vista.

Since
4.3

\inmodule QtWidgets

Warning
This style is only available on the Windows Vista platform because it makes use of Windows Vista's style engine.
See also
QMacStyle, QFusionStyle

Definition at line 24 of file qwindowsvistastyle_p.h.

Constructor & Destructor Documentation

◆ QWindowsVistaStyle() [1/2]

QWindowsVistaStyle::QWindowsVistaStyle ( )

Constructs a QWindowsVistaStyle object.

Definition at line 1272 of file qwindowsvistastyle.cpp.

◆ ~QWindowsVistaStyle()

QWindowsVistaStyle::~QWindowsVistaStyle ( )
overridedefault

Destructor.

◆ QWindowsVistaStyle() [2/2]

QWindowsVistaStyle::QWindowsVistaStyle ( QWindowsVistaStylePrivate & dd)
protected

Constructs a QWindowsStyle object.

Definition at line 1280 of file qwindowsvistastyle.cpp.

Member Function Documentation

◆ drawComplexControl()

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

see drawPrimitive for comments on the animation support

Definition at line 3247 of file qwindowsvistastyle.cpp.

References QStyleOptionComplex::activeSubControls, QRect::adjust(), QRect::adjusted(), Qt::AlignCenter, Qt::AlignLeft, Qt::AlignVCenter, button, canAnimate(), QRect::center(), clonedAnimationStyleOption(), QWindowsVistaStylePrivate::ComboboxTheme, createAnimationBuffer(), d, deleteClonedAnimationStyleOption(), QPainter::drawLine(), QPainter::drawLines(), QPainter::drawText(), QWindowsVistaStylePrivate::EditTheme, QWindowsThemeData::handle(), QStyleOptionToolButton::HasMenu, Qt::Horizontal, iconSize, isActive, QWidget::isActiveWindow, QSizeF::isEmpty(), QWidget::isEnabled(), QWindowsThemeData::isValid(), QStyleOptionToolButton::MenuButtonPopup, QWindowsThemeData::mirrorHorizontally, QWindowsVistaAnimation::paint(), painter, QWindowsThemeData::partId, pixelMetric(), QStyle::PM_MenuButtonIndicator, populateTitleBarButtonTheme(), pos, QObject::property(), proxy, Q_UNLIKELY, qMin(), qRgb(), QWindowsThemeData::rect, QStyleOption::rect, QPainter::restore(), Qt::RightToLeft, QPainter::save(), QStyle::SC_MdiMinButton, QWindowsVistaStylePrivate::ScrollBarTheme, QPainter::setClipRect(), QPainter::setPen(), QObject::setProperty(), QWindowsThemeData::size(), QStyle::sliderPositionFromValue(), QWindowsVistaStylePrivate::SpinTheme, state, QStyleOption::state, QStyle::State_Active, QWindowsThemeData::stateId, QAbstractSpinBox::StepDownEnabled, QAbstractSpinBox::StepUpEnabled, styleObject(), sub, subControlRect(), SubControls, subElementRect(), QWidget::testAttribute(), Qt::TextSingleLine, QSlider::TicksAbove, QSlider::TicksBelow, QSlider::TicksLeft, QSlider::TicksRight, TMT_TEXTSHADOWCOLOR, QVariant::toInt(), QWindowsVistaStylePrivate::ToolBarTheme, QVariant::toRect(), QWindowsVistaStylePrivate::TrackBarTheme, QPainter::translate(), TST_NONE, QRect::united(), QWindowsVistaStylePrivate::useVista(), Qt::WA_UnderMouse, widget, Qt::WindowContextHelpButtonHint, Qt::WindowMaximizeButtonHint, Qt::WindowMaximized, Qt::WindowMinimizeButtonHint, Qt::WindowMinimized, Qt::WindowShadeButtonHint, Qt::WindowSystemMenuHint, and QWindowsVistaStylePrivate::WindowTheme.

Referenced by QWindows11Style::drawComplexControl().

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

◆ drawControl()

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

see drawPrimitive for comments on the animation support

Definition at line 2301 of file qwindowsvistastyle.cpp.

References QIcon::Active, QPalette::Active, QRect::adjust(), QRect::adjusted(), Qt::AlignBottom, Qt::AlignCenter, Qt::AlignLeft, alignment, Qt::AlignVCenter, QPalette::All, alphaGradient(), begin(), QColor::blue(), QMarginsF::bottom(), QRect::bottom(), Qt::BottomLeftCorner, Qt::BottomRightCorner, BP_COMMANDLINK, btn, button, QPalette::Button, buttonStateId(), QPalette::ButtonText, QWindowsVistaStylePrivate::ButtonTheme, QIcon::cacheKey(), canAnimate(), QRect::center(), clonedAnimationStyleOption(), QPalette::color(), QStyleOptionButton::CommandLinkButton, QPainter::CompositionMode_SourceIn, createAnimationBuffer(), d, QPalette::Dark, QColor::darker(), QStyleOptionButton::DefaultButton, QStyleOptionMenuItem::DefaultItem, deleteClonedAnimationStyleOption(), QPainter::device(), QPaintDevice::devicePixelRatio(), QIcon::Disabled, disabled, QStyleHelper::dpiScaled(), dpr(), QCommonStyle::drawControl(), QPainter::drawPixmap(), QPainter::drawRect(), QPainter::drawText(), QFontMetrics::elidedText(), Qt::ElideRight, QPainter::eraseRect(), QStyleOptionMenuItem::Exclusive, QStyleOptionButton::features, fill(), QPainter::fillRect(), QPixmapCache::find(), QStyleOptionButton::Flat, QPainter::font(), font, QPainter::fontMetrics(), QImage::Format_ARGB32, QPixmap::fromImage(), QString::fromLatin1(), QColor::green(), QWindowsThemeData::handle(), QStyleOptionButton::HasMenu, header(), QWindowsVistaStylePrivate::HeaderTheme, QRect::height(), QPalette::Highlight, QPalette::HighlightedText, Qt::Horizontal, QPixmapCache::insert(), isActive, QPixmap::isNull(), QWindowsThemeData::isValid(), QWidget::isWindow(), QMarginsF::left(), QRect::left(), Qt::LeftToRight, QWindowsThemeData::margins(), QWindowsVistaStylePrivate::MenuTheme, QWindowsThemeData::mirrorHorizontally, QWindowsThemeData::mirrorVertically, QRect::moveTop(), QTime::msecsTo(), QStyleOptionHeader::None, QIcon::Normal, QStyleOptionMenuItem::NotCheckable, QIcon::Off, QIcon::On, p1, p2, QWindowsVistaAnimation::paint(), QWindowsThemeData::painter, painter, palette, QWidget::palette, QWindowsThemeData::partId, QPainter::pen(), pix, pixmap, QStyle::PM_DockWidgetTitleMargin, QWindowsVistaStylePrivate::ProgressTheme, QObject::property(), proxy, qMax(), qMin(), qRgb(), qRound(), QWindowsThemeData::rect, rect, QStyleOption::rect, QColor::red(), QPainter::restore(), QSize::rheight(), QMarginsF::right(), Qt::RightToLeft, QPainter::rotate(), QWindowsThemeData::rotate, QTabBar::RoundedEast, QTabBar::RoundedNorth, QTabBar::RoundedSouth, QTabBar::RoundedWest, QPainter::save(), QStyleOptionMenuItem::Separator, QFont::setBold(), QPainter::setBrush(), QPainter::setClipRect(), QPalette::setColor(), QGradient::setColorAt(), QStyleAnimation::setDuration(), QBlendStyleAnimation::setEndImage(), QPainter::setFont(), QRect::setHeight(), QPainter::setPen(), QObject::setProperty(), QBlendStyleAnimation::setStartImage(), QStyleAnimation::setStartTime(), QRect::setWidth(), QAbstractItemView::SingleSelection, QWindowsThemeData::size(), QStyle::SP_TitleBarCloseButton, QStyle::SP_TitleBarMaxButton, state, QStyleOption::state, QStyle::State_Horizontal, QWindowsThemeData::stateId, QWindowsVistaStylePrivate::StatusTheme, styleHint(), styleObject(), subElementRect(), QStyleOptionMenuItem::SubMenu, QWindowsVistaStylePrivate::TabTheme, QPalette::Text, Qt::TextDontClip, Qt::TextHideMnemonic, textRect, Qt::TextShowMnemonic, Qt::TextSingleLine, TMT_TEXTSHADOWCOLOR, QVariant::toBool(), QVariant::toInt(), QWindowsVistaStylePrivate::ToolBarTheme, QMarginsF::top(), Qt::TopLeftCorner, QRect::topRight(), Qt::TopRightCorner, QVariant::toRect(), QPainter::translate(), Qt::transparent, TST_NONE, QWindowsVistaStylePrivate::useVista(), Qt::Vertical, view, QStyle::visualPos(), visualRect(), QStyle::visualRect(), widget, QRect::width(), QSize::width(), QPalette::Window, QGuiApplication::windowIcon, QWidget::windowIcon, windowsArrowHMargin, windowsItemFrame, windowsItemHMargin, windowsItemVMargin, windowsRightBorder, QPalette::WindowText, QWindowsVistaStylePrivate::WindowTheme, and QRect::x().

Referenced by QWindows11Style::drawControl().

+ Here is the caller graph for this function:

◆ drawPrimitive()

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

Animations are used for some state transitions on specific widgets.

Only one running animation can exist for a widget at any specific time. Animations can be added through QWindowsVistaStylePrivate::startAnimation(Animation *) and any existing animation on a widget can be retrieved with QWindowsVistaStylePrivate::widgetAnimation(Widget *).

Once an animation has been started, QWindowsVistaStylePrivate::timerEvent(QTimerEvent *) will continuously call update() on the widget until it is stopped, meaning that drawPrimitive will be called many times until the transition has completed. During this time, the result will be retrieved by the Animation::paint(...) function and not by the style itself.

To determine if a transition should occur, the style needs to know the previous state of the widget as well as the current one. This is solved by updating dynamic properties on the widget every time the function is called.

Transitions interrupting existing transitions should always be smooth, so whenever a hover-transition is started on a pulsating button, it uses the current frame of the pulse-animation as the starting image for the hover transition.

Definition at line 1320 of file qwindowsvistastyle.cpp.

References QRect::adjusted(), QPalette::Base, QPalette::brush(), QPainter::brushOrigin(), btn, button, QPalette::Button, buttonStateId(), QWindowsVistaStylePrivate::ButtonTheme, canAnimate(), clonedAnimationStyleOption(), createAnimationBuffer(), d, QStyleOptionButton::DefaultButton, deleteClonedAnimationStyleOption(), Qt::Dense4Pattern, QPalette::Disabled, QPainter::drawLine(), QPainter::drawPixmap(), QPainter::drawRect(), QWindowsVistaStylePrivate::EditTheme, QStyleOptionButton::features, fill(), QPainter::fillRect(), QPixmapCache::find(), QObject::findChild(), QStyleOptionFrame::Flat, frame, QString::fromLatin1(), QWidget::geometry, QWindowsThemeData::handle(), header(), QWindowsVistaStylePrivate::HeaderTheme, QSize::height(), QWidget::height, if(), QPalette::Inactive, QObject::inherits(), QPixmapCache::insert(), QWindowsVistaStylePrivate::isItemViewDelegateLineEdit(), QWindowsVistaStylePrivate::isLineEditBaseColorSet(), QWindowsThemeData::isValid(), LISS_HOT, LISS_HOTSELECTED, LISS_SELECTED, LISS_SELECTEDNOTFOCUS, QWindowsVistaStylePrivate::MenuTheme, QWindowsThemeData::mirrorHorizontally, QWindowsThemeData::mirrorVertically, Qt::NoBrush, QWindowsThemeData::noContent, QPalette::Normal, QAbstractItemView::NoSelection, p1, p2, QWindowsVistaAnimation::paint(), painter, QWidget::palette, panel, QWidget::parentWidget(), QWindowsThemeData::partId, QPainter::pen(), pixmap, QObject::property(), proxy, qDrawWinButton(), qMax(), qRgb(), qRound(), QWindowsVistaStylePrivate::RebarTheme, QWindowsThemeData::rect, rect, QWidget::rect, QPainter::restore(), Qt::RightToLeft, QTabBar::RoundedEast, QTabBar::RoundedNorth, QTabBar::RoundedSouth, QTabBar::RoundedWest, QPainter::save(), QStyle::SE_ItemViewItemFocusRect, QAbstractItemView::SelectRows, QRect::setBottom(), QPainter::setBrush(), QPainter::setBrushOrigin(), QPainter::setClipRect(), QPainter::setClipRegion(), QStyleAnimation::setDuration(), QBlendStyleAnimation::setEndImage(), QPainter::setPen(), QObject::setProperty(), QBlendStyleAnimation::setStartImage(), QStyleAnimation::setStartTime(), QRect::setTop(), QSize::setWidth(), QWindowsThemeData::size(), QRect::size(), QStyleOptionHeader::SortDown, state, QStyleOption::state, QStyle::State_Active, QStyle::State_Enabled, QStyle::State_MouseOver, QStyle::State_Open, QStyle::State_Selected, QWindowsThemeData::stateId, QWindowsVistaStylePrivate::StatusTheme, styleObject(), QStyleOption::styleObject, subElementRect(), supportsStateTransition(), QWindowsVistaStylePrivate::TabTheme, QWindowsVistaStylePrivate::TaskDialogTheme, QVariant::toInt(), QWindowsVistaStylePrivate::ToolBarTheme, QWindowsVistaStylePrivate::ToolTipTheme, QRect::top(), QRect::topLeft(), QVariant::toRect(), Qt::transparent, QTabBar::TriangularEast, QTabBar::TriangularNorth, QTabBar::TriangularSouth, QTabBar::TriangularWest, QWindowsVistaStylePrivate::useVista(), view, QWindowsVistaStylePrivate::VistaTreeViewTheme, widget, QSize::width(), and QWindowsVistaStylePrivate::WindowTheme.

Referenced by QWindows11Style::drawPrimitive().

+ Here is the caller graph for this function:

◆ hitTestComplexControl()

QStyle::SubControl QWindowsVistaStyle::hitTestComplexControl ( ComplexControl control,
const QStyleOptionComplex * option,
const QPoint & pos,
const QWidget * widget = nullptr ) const
override

Definition at line 4474 of file qwindowsvistastyle.cpp.

References pos, and widget.

◆ pixelMetric()

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

Definition at line 4483 of file qwindowsvistastyle.cpp.

References QStyleHelper::dpiScaled(), QWindowsVistaStylePrivate::fixedPixelMetric(), QWindowsVistaStylePrivate::pixelMetricFromSystemDp(), qRound(), ret, QTabBar::RoundedEast, QTabBar::RoundedNorth, QTabBar::RoundedSouth, QTabBar::RoundedWest, QTabBar::TriangularEast, QTabBar::TriangularNorth, QTabBar::TriangularSouth, QTabBar::TriangularWest, QWindowsVistaStylePrivate::useVista(), and widget.

Referenced by drawComplexControl(), QWindows11Style::pixelMetric(), and sizeFromContents().

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

◆ polish() [1/3]

void QWindowsVistaStyle::polish ( QApplication * app)
override

Definition at line 4791 of file qwindowsvistastyle.cpp.

References app, Qt::Dark, QApplication::palette(), qApp, and QApplication::setPalette().

+ Here is the call graph for this function:

◆ polish() [2/3]

void QWindowsVistaStyle::polish ( QPalette & pal)
override

Definition at line 4754 of file qwindowsvistastyle.cpp.

References QPalette::AlternateBase, QPalette::base(), QWindowsVistaStylePrivate::ButtonTheme, QPixmapCache::clear(), QBrush::color(), d, Qt::Dark, QColor::darker(), QWindowsThemeData::handle(), QGuiApplicationPrivate::platformIntegration(), qRgb(), QPalette::setBrush(), and QGuiApplication::styleHints().

+ Here is the call graph for this function:

◆ polish() [3/3]

void QWindowsVistaStyle::polish ( QWidget * widget)
override

Definition at line 4573 of file qwindowsvistastyle.cpp.

References QPalette::Active, QPalette::All, QPalette::BrightText, QPalette::ButtonText, QObject::findChild(), QWidget::font, QColor::fromRgb(), QObject::inherits(), list, QWidget::palette, QT_CONFIG, QWidget::setAttribute(), QPalette::setColor(), QWidget::setContentsMargins(), QFont::setFamilies(), QWidget::setFont(), QWidget::setPalette(), QObject::setProperty(), QPalette::setResolveMask(), QWidget::setWindowOpacity(), QPalette::ToolTipText, QWindowsVistaStylePrivate::useVista(), Qt::WA_Hover, Qt::WA_StyledBackground, widget, and QWindowsVistaStylePrivate::winId().

Referenced by QWindows11Style::polish().

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

◆ sizeFromContents()

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

◆ standardIcon()

QIcon QWindowsVistaStyle::standardIcon ( StandardPixmap standardIcon,
const QStyleOption * option = nullptr,
const QWidget * widget = nullptr ) const
override

\reimp

Definition at line 4857 of file qwindowsvistastyle.cpp.

References QIcon::Active, BP_COMMANDLINKGLYPH, QWindowsVistaStylePrivate::ButtonTheme, CBS_INACTIVE, CMDLGS_DISABLED, CMDLGS_HOT, CMDLGS_NORMAL, CMDLGS_PRESSED, d, QIcon::Disabled, QPixmap::fill(), QWindowsThemeData::isValid(), QWidget::isWindow(), MAXBS_INACTIVE, QIcon::Normal, QIcon::Off, QIcon::On, QWindowsThemeData::painter, QWindowsThemeData::partId, RBS_INACTIVE, QWindowsThemeData::rect, QWindowsThemeData::size(), standardIcon(), QWindowsThemeData::stateId, QSizeF::toSize(), Qt::transparent, QWindowsVistaStylePrivate::useVista(), widget, and QWindowsVistaStylePrivate::WindowTheme.

Referenced by standardIcon().

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

◆ standardPixmap()

QPixmap QWindowsVistaStyle::standardPixmap ( StandardPixmap standardPixmap,
const QStyleOption * option,
const QWidget * widget = nullptr ) const
override

Definition at line 4826 of file qwindowsvistastyle.cpp.

References QWindowsThemeData::isValid(), QWidget::isWindow(), QIcon::pixmap(), QWindowsThemeData::size(), standardPixmap(), QWindowsVistaStylePrivate::useVista(), widget, and QWindowsVistaStylePrivate::WindowTheme.

Referenced by standardPixmap().

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

◆ styleHint()

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

Definition at line 2196 of file qwindowsvistastyle.cpp.

References Qt::AlignHCenter, Qt::AlignTop, QPalette::Base, d, QWindowsVistaStylePrivate::groupBoxTextColor, hint(), QWidget::isEnabled(), proxy, QWidget::rect, ret, QRect::setHeight(), QWindowsVistaStylePrivate::ToolTipTheme, widget, Qt::WindowMinimized, and QWindowsVistaStylePrivate::WindowTheme.

Referenced by drawControl(), and QWindows11Style::styleHint().

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

◆ subControlRect()

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

Definition at line 4261 of file qwindowsvistastyle.cpp.

References buttonVisible(), cb, QStyleHelper::dpiScaled(), iconSize, leftOffset, proxy, Q_FALLTHROUGH, qRound(), rect, QWindowsVistaStylePrivate::useVista(), visualRect(), widget, Qt::WindowContextHelpButtonHint, Qt::WindowMaximizeButtonHint, Qt::WindowMaximized, Qt::WindowMinimizeButtonHint, Qt::WindowMinimized, Qt::WindowShadeButtonHint, and Qt::WindowSystemMenuHint.

Referenced by drawComplexControl(), and QWindows11Style::subControlRect().

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

◆ subElementRect()

QRect QWindowsVistaStyle::subElementRect ( SubElement element,
const QStyleOption * option,
const QWidget * widget ) const
override

◆ unpolish()

void QWindowsVistaStyle::unpolish ( QWidget * widget)
override

Definition at line 4665 of file qwindowsvistastyle.cpp.

References d, QFont::families(), QObject::findChild(), font, QApplication::font(), QWidget::font, newState(), QT_CONFIG, QWidget::setAttribute(), QWidget::setContentsMargins(), QFont::setFamilies(), QWidget::setFont(), QWidget::setWindowOpacity(), QWindowsVistaStylePrivate::useVista(), Qt::WA_Hover, Qt::WA_StyledBackground, and widget.

Referenced by QWindows11Style::unpolish().

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

Friends And Related Symbol Documentation

◆ QStyleFactory

friend class QStyleFactory
friend

Definition at line 67 of file qwindowsvistastyle_p.h.


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