8#include <QtGui/qpainter.h>
9#include <QtGui/qbitmap.h>
10#include <QtGui/qpixmapcache.h>
11#include <QtGui/qpa/qplatformtheme.h>
13#include <QtGui/private/qguiapplication_p.h>
16# include <QtCore/qdebug.h>
103 const int pixmapWidth =
pixmap.width()/
pixmap.devicePixelRatio();
104 const int pixmapHeight =
pixmap.height()/
pixmap.devicePixelRatio();
107 y +=
h/2 - pixmapHeight/2;
109 y +=
h - pixmapHeight;
111 x +=
w - pixmapWidth;
113 x +=
w/2 - pixmapWidth/2;
115 x +=
w - pixmapWidth;
230 int x = rectangle.
x();
231 int y = rectangle.
y();
232 int w =
size.width();
233 int h =
size.height();
235 y += rectangle.
size().height()/2 -
h/2;
237 y += rectangle.
size().height() -
h;
239 x += rectangle.
size().width() -
w;
241 x += rectangle.
size().width()/2 -
w/2;
278 if (
span <= 0 || logicalValue < min || max <= min)
280 if (logicalValue > max)
281 return upsideDown ?
span : min;
284 uint p = upsideDown ? max - logicalValue : logicalValue - min;
287 double dpos = (double(
p))/(
double(
range)/
span);
322 return upsideDown ? max : min;
324 return upsideDown ? min : max;
330 return upsideDown ? max - tmp : tmp + min;
335 return upsideDown ? max - tmp : tmp + min;
379#include "moc_qquickstyle.cpp"
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.
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.
static bool useFullScreenForPopup()
const QStyle * proxy() const
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 ~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...
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.
static int sliderValueFromPosition(int min, int max, int pos, int space, bool upsideDown=false)
Converts the given pixel position to a logical value.
virtual int styleHint(StyleHint stylehint, const QStyleOption *opt=nullptr, QStyleHintReturn *returnData=nullptr) const =0
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.
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.
\inmodule QtCore\reentrant
constexpr void getRect(int *x, int *y, int *w, int *h) const
Extracts the position of the rectangle's top-left corner to *x and *y, and its dimensions to *width a...
QRect intersected(const QRect &other) const noexcept
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 void translate(int dx, int dy) noexcept
Moves the rectangle dx along the x axis and dy along the y axis, relative to the current position.
constexpr int y() const noexcept
Returns the y-coordinate of the rectangle's top edge.
\macro QT_RESTRICTED_CAST_FROM_ASCII
bool isEmpty() const noexcept
Returns true if the string has no characters; otherwise returns false.
Combined button and popup list for selecting options.
GLint GLint GLint GLint GLint x
[0]
GLfloat GLfloat GLfloat w
[0]
GLenum GLuint GLintptr GLsizeiptr size
[1]
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)