Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
QStyleHelper Namespace Reference

Enumerations

enum  WidgetSizePolicy { SizeLarge = 0 , SizeSmall = 1 , SizeMini = 2 , SizeDefault = -1 }
 

Functions

QString uniqueName (const QString &key, const QStyleOption *option, const QSize &size)
 
Q_WIDGETS_EXPORT qreal dpi (const QStyleOption *option)
 
Q_WIDGETS_EXPORT qreal dpiScaled (qreal value, qreal dpi)
 
Q_WIDGETS_EXPORT qreal dpiScaled (qreal value, const QPaintDevice *device)
 
Q_WIDGETS_EXPORT qreal dpiScaled (qreal value, const QStyleOption *option)
 
void drawBorderPixmap (const QPixmap &pixmap, QPainter *painter, const QRect &rect, int left, int top, int right, int bottom)
 
QColor backgroundColor (const QPalette &pal, const QWidget *widget)
 
WidgetSizePolicy widgetSizePolicy (const QWidget *widget, const QStyleOption *opt)
 

Variables

static const qreal qstyleBaseDpi = 96
 

Enumeration Type Documentation

◆ WidgetSizePolicy

Enumerator
SizeLarge 
SizeSmall 
SizeMini 
SizeDefault 

Definition at line 65 of file qstylehelper_p.h.

Function Documentation

◆ backgroundColor()

Q_WIDGETS_EXPORT QColor QStyleHelper::backgroundColor ( const QPalette pal,
const QWidget widget 
)

Definition at line 400 of file qstylehelper.cpp.

References QPalette::Base, QPalette::color(), QWidget::palette, QObject::parent(), QWidget::parentWidget(), Q_UNUSED, and widget.

Referenced by QQC2_NAMESPACE::QMacStyle::drawComplexControl(), and QMacStyle::drawComplexControl().

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

◆ dpi()

Q_WIDGETS_EXPORT qreal QStyleHelper::dpi ( const QStyleOption option)

Definition at line 55 of file qstylehelper.cpp.

References Qt::AA_Use96Dpi, qstyleBaseDpi, qt_defaultDpiX(), and QCoreApplication::testAttribute().

Referenced by dpiScaled(), dpiScaled(), QCommonStyle::sizeFromContents(), and QCommonStyle::subControlRect().

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

◆ dpiScaled() [1/3]

Q_WIDGETS_EXPORT qreal QStyleHelper::dpiScaled ( qreal  value,
const QPaintDevice device 
)

Definition at line 82 of file qstylehelper.cpp.

References device, and dpiScaled().

+ Here is the call graph for this function:

◆ dpiScaled() [2/3]

Q_WIDGETS_EXPORT qreal QStyleHelper::dpiScaled ( qreal  value,
const QStyleOption option 
)

Definition at line 87 of file qstylehelper.cpp.

References dpi(), and dpiScaled().

+ Here is the call graph for this function:

◆ dpiScaled() [3/3]

Q_WIDGETS_EXPORT qreal QStyleHelper::dpiScaled ( qreal  value,
qreal  dpi 
)

Definition at line 77 of file qstylehelper.cpp.

References dpi(), and qstyleBaseDpi.

Referenced by dpiScaled(), dpiScaled(), QWindowsVistaStyle::drawControl(), QCommonStyle::pixelMetric(), QWindowsVistaStyle::pixelMetric(), QQC2_NAMESPACE::QMacStyle::pixelMetric(), QMacStyle::pixelMetric(), QCommonStyle::sizeFromContents(), QWindowsVistaStyle::sizeFromContents(), QCommonStyle::subControlRect(), and QWindowsVistaStyle::subControlRect().

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

◆ drawBorderPixmap()

Q_WIDGETS_EXPORT void QStyleHelper::drawBorderPixmap ( const QPixmap pixmap,
QPainter painter,
const QRect rect,
int  left,
int  top,
int  right,
int  bottom 
)

Definition at line 343 of file qstylehelper.cpp.

References QPainter::drawPixmap(), painter, pixmap, and rect.

+ Here is the call graph for this function:

◆ uniqueName()

QString QStyleHelper::uniqueName ( const QString key,
const QStyleOption option,
const QSize size 
)

Definition at line 28 of file qstylehelper.cpp.

References QStyleOptionComplex::activeSubControls, QAbstractSpinBox::buttonSymbols, QAbstractSpinBox::frame, spinBox, and QAbstractSpinBox::stepEnabled().

Referenced by QCommonStyle::drawPrimitive().

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

◆ widgetSizePolicy()

Q_WIDGETS_EXPORT WidgetSizePolicy QStyleHelper::widgetSizePolicy ( const QWidget widget,
const QStyleOption opt 
)

Definition at line 412 of file qstylehelper.cpp.

References opt, QWidget::parentWidget(), SizeDefault, SizeLarge, SizeMini, SizeSmall, QStyleOption::state, QStyle::State_Mini, QStyle::State_Small, QWidget::testAttribute(), Qt::WA_MacMiniSize, Qt::WA_MacNormalSize, Qt::WA_MacSmallSize, and widget.

Referenced by QMacStylePrivate::aquaSizeConstrain(), cocoaControlType(), QMacStyle::drawControl(), QQC2_NAMESPACE::getControlSize(), getControlSize(), and QStyleOption::initFrom().

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

Variable Documentation

◆ qstyleBaseDpi

const qreal QStyleHelper::qstyleBaseDpi = 96
static

Definition at line 52 of file qstylehelper.cpp.

Referenced by dpi(), and dpiScaled().