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
QStyleHelper Namespace Reference

Enumerations

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

Functions

static bool usePixmapCache (const QStyleOption *opt)
 
QString uniqueName (const QString &key, const QStyleOption *option, const QSize &size, qreal dpr)
 
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 411 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 66 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 93 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 98 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 88 of file qstylehelper.cpp.

References dpi(), and qstyleBaseDpi.

Referenced by dpiScaled(), dpiScaled(), QWindowsVistaStyle::drawControl(), QCommonStyle::pixelMetric(), QWindows11Style::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 354 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,
qreal dpr )

Definition at line 35 of file qstylehelper.cpp.

References QAbstractSpinBox::buttonSymbols, dpr(), QAbstractSpinBox::frame, spinBox, QAbstractSpinBox::stepEnabled(), and usePixmapCache().

Referenced by QCommonStyle::drawPrimitive().

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

◆ usePixmapCache()

static bool QStyleHelper::usePixmapCache ( const QStyleOption * opt)
inlinestatic

Definition at line 28 of file qstylehelper.cpp.

References opt, QStyleOption::styleObject, QWidget::testAttribute(), Qt::WA_StyleSheetTarget, and widget.

Referenced by uniqueName().

+ 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 423 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 63 of file qstylehelper.cpp.

Referenced by dpi(), and dpiScaled().