11#include "private/qstyle_p.h"
12#include "private/qguiapplication_p.h"
13#include <qpa/qplatformtheme.h>
38 if (
uint bit = (controls & (0x1 <<
i)))
363 d->proxyStyle =
this;
375 d->proxyStyle =
this;
378 "StandardPixmap in QPlatformTheme and QStyle out of sync");
541 const int pixmapWidth = pixmapSize.
width();
542 const int pixmapHeight = pixmapSize.
height();
545 y +=
h/2 - pixmapHeight/2;
547 y +=
h - pixmapHeight;
549 x +=
w - pixmapWidth;
551 x +=
w/2 - pixmapWidth/2;
553 x +=
w - pixmapWidth;
2177 int x = rectangle.
x();
2178 int y = rectangle.
y();
2179 int w =
size.width();
2180 int h =
size.height();
2225 if (
span <= 0 || max <= min)
2227 if (logicalValue < min)
2228 return upsideDown ?
span : 0;
2229 if (logicalValue > max)
2230 return upsideDown ? 0 :
span;
2233 const uint p = upsideDown ?
qint64(max) - logicalValue :
qint64(logicalValue) - min;
2236 double dpos = (double(
p))/(
double(
range)/
span);
2271 return upsideDown ? max : min;
2273 return upsideDown ? min : max;
2279 return upsideDown ? max - tmp : tmp + min;
2284 return upsideDown ? max - tmp : tmp + min;
2382 for (
int i = 0;
i < count1; ++
i) {
2383 for (
int j = 0;
j < count2; ++
j) {
2404 return d->proxyStyle ==
this ?
this :
d->proxyStyle->proxy();
2413void QStyle::setProxy(
QStyle *style)
2417 d->proxyStyle = style;
2429#include "moc_qstyle.cpp"
The QApplication class manages the GUI application's control flow and main settings.
const QColor & color() const
Returns the brush color.
The QColor class provides colors based on RGB, HSV or CMYK values.
QColor darker(int f=200) const noexcept
QColor lighter(int f=150) const noexcept
\reentrant \inmodule QtGui
static Qt::Alignment visualAlignment(Qt::LayoutDirection direction, Qt::Alignment alignment)
static QPlatformTheme * platformTheme()
static bool isRightToLeft()
Returns true if the application's layout direction is Qt::RightToLeft; otherwise returns false.
Qt::LayoutDirection layoutDirection
the default layout direction for this application
The QPainter class performs low-level painting on widgets and other paint devices.
const QBrush & background() const
Returns the current background brush.
const QPen & pen() const
Returns the painter's current pen.
void setPen(const QColor &color)
This is an overloaded member function, provided for convenience. It differs from the above function o...
void drawText(const QPointF &p, const QString &s)
Draws the given text with the currently defined text direction, beginning at the given position.
void drawPixmap(const QRectF &targetRect, const QPixmap &pixmap, const QRectF &sourceRect)
Draws the rectangular portion source of the given pixmap into the given target in the paint device.
void fillRect(const QRectF &, const QBrush &)
Fills the given rectangle with the brush specified.
The QPalette class contains color groups for each widget state.
const QBrush & brush(ColorGroup cg, ColorRole cr) const
Returns the brush in the specified color group, used for the given color role.
const QBrush & light() const
Returns the light brush of the current color group.
qreal widthF() const
Returns the pen width with floating point precision.
Returns a copy of the pixmap that is transformed using the given transformation transform and transfo...
\inmodule QtCore\reentrant
constexpr int x() const noexcept
Returns the x coordinate of this point.
constexpr int y() const noexcept
Returns the y coordinate of this point.
constexpr qreal width() const noexcept
Returns the width of the rectangle.
constexpr qreal right() const noexcept
Returns the x-coordinate of the rectangle's right edge.
\inmodule QtCore\reentrant
constexpr int height() const noexcept
Returns the height of the rectangle.
constexpr int x() const noexcept
Returns the x-coordinate of the rectangle's left edge.
constexpr QSize size() const noexcept
Returns the size of the rectangle.
constexpr int width() const noexcept
Returns the width of the rectangle.
constexpr int y() const noexcept
Returns the y-coordinate of the rectangle's top edge.
constexpr int right() const noexcept
Returns the x-coordinate of the rectangle's right edge.
constexpr qreal width() const noexcept
Returns the width.
constexpr qreal height() const noexcept
Returns the height.
constexpr int height() const noexcept
Returns the height.
constexpr int width() const noexcept
Returns the width.
\macro QT_RESTRICTED_CAST_FROM_ASCII
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
The QStyleOption class stores the parameters used by QStyle functions.
static bool useFullScreenForPopup()
The QStyle class is an abstract base class that encapsulates the look and feel of a GUI.
virtual void polish(QWidget *widget)
Initializes the appearance of the given widget.
virtual QRect itemPixmapRect(const QRect &r, int flags, const QPixmap &pixmap) const
Returns the area within the given rectangle in which to draw the specified pixmap according to the de...
virtual QPalette standardPalette() const
Returns the style's standard palette.
static Qt::Alignment visualAlignment(Qt::LayoutDirection direction, Qt::Alignment alignment)
Transforms an alignment of Qt::AlignLeft or Qt::AlignRight without Qt::AlignAbsolute into Qt::AlignLe...
virtual int styleHint(StyleHint stylehint, const QStyleOption *opt=nullptr, const QWidget *widget=nullptr, QStyleHintReturn *returnData=nullptr) const =0
Returns an integer representing the specified style hint for the given widget described by the provid...
virtual ~QStyle()
Destroys the style object.
virtual void drawItemPixmap(QPainter *painter, const QRect &rect, int alignment, const QPixmap &pixmap) const
Draws the given pixmap in the specified rectangle, according to the specified alignment,...
virtual QRect itemTextRect(const QFontMetrics &fm, const QRect &r, int flags, bool enabled, const QString &text) const
Returns the area within the given rectangle in which to draw the provided text according to the speci...
virtual int layoutSpacing(QSizePolicy::ControlType control1, QSizePolicy::ControlType control2, Qt::Orientation orientation, const QStyleOption *option=nullptr, const QWidget *widget=nullptr) const =0
QStyle()
Constructs a style object.
static QRect alignedRect(Qt::LayoutDirection direction, Qt::Alignment alignment, const QSize &size, const QRect &rectangle)
Returns a new rectangle of the specified size that is aligned to the given rectangle according to the...
static int sliderPositionFromValue(int min, int max, int val, int space, bool upsideDown=false)
Converts the given logicalValue to a pixel position.
static QRect visualRect(Qt::LayoutDirection direction, const QRect &boundingRect, const QRect &logicalRect)
Returns the given logicalRectangle converted to screen coordinates based on the specified direction.
int combinedLayoutSpacing(QSizePolicy::ControlTypes controls1, QSizePolicy::ControlTypes controls2, Qt::Orientation orientation, QStyleOption *option=nullptr, QWidget *widget=nullptr) const
static int sliderValueFromPosition(int min, int max, int pos, int space, bool upsideDown=false)
Converts the given pixel position to a logical value.
QString name() const
Returns the name of the style.
virtual void drawItemText(QPainter *painter, const QRect &rect, int flags, const QPalette &pal, bool enabled, const QString &text, QPalette::ColorRole textRole=QPalette::NoRole) const
Draws the given text in the specified rectangle using the provided painter and palette.
virtual void unpolish(QWidget *widget)
Uninitialize the given {widget}'s appearance.
const QStyle * proxy() const
static QPoint visualPos(Qt::LayoutDirection direction, const QRect &boundingRect, const QPoint &logicalPos)
Returns the given logicalPosition converted to screen coordinates based on the specified direction.
Combined button and popup list for selecting options.
Q_DECL_CONST_FUNCTION QT_POPCOUNT_CONSTEXPR uint qPopulationCount(quint32 v) noexcept
#define Q_STATIC_ASSERT_X(Condition, Message)
int qRound(qfloat16 d) noexcept
constexpr const T & qMax(const T &a, const T &b)
GLint GLint GLint GLint GLint x
[0]
GLfloat GLfloat GLfloat w
[0]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLenum GLenum GLsizei count
GLenum GLenum GLsizei const GLuint GLboolean enabled
GLsizei GLenum const void GLuint GLsizei GLfloat * metrics
GLfloat GLfloat GLfloat GLfloat h
GLenum GLenum GLsizei void GLsizei void void * span
GLenum GLenum GLenum GLenum GLenum scale
static const QRectF boundingRect(const QPointF *points, int pointCount)
Int aligned(Int v, Int byteAlign)
static int unpackControlTypes(QSizePolicy::ControlTypes controls, QSizePolicy::ControlType *array)
static QT_BEGIN_NAMESPACE const int MaxBits