8#include <QtCore/qmath.h>
9#include <QtGui/qpainter.h>
10#include <QtGui/qpixmapcache.h>
11#include <QtGui/qwindow.h>
12#include <QtGui/private/qhighdpiscaling_p.h>
13#include <QtGui/private/qguiapplication_p.h>
14#include <QtGui/private/qmath_p.h>
15#include <QtGui/private/qhexstring_p.h>
64 return option->fontMetrics.fontDpi();
84#if QT_CONFIG(accessibility)
85bool isInstanceOf(
QObject *
obj, QAccessible::Role role)
88 QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(
obj);
89 match = iface && iface->role() == role;
94bool hasAncestor(
QObject *
obj, QAccessible::Role role)
99 if (isInstanceOf(
parent, role))
109 int bigLineSize = radius / 6;
112 if (bigLineSize > radius / 2)
113 bigLineSize = radius / 2;
129 a = (startAngle - (currentSliderPosition - dial->
minimum) * spanAngle
141 static const qreal rad_factor = 180 /
Q_PI;
144 if (
p1.x() ==
p2.x()) {
152 if (
p1.x() <=
p2.x()) {
161 _angle =
qAtan(
m) * rad_factor;
164 _angle = 180 - _angle;
188 int maximum = dial->
minimum + 1000;
192 poly.
resize(2 + 2 * notches);
193 int smallLineSize = bigLineSize / 2;
194 for (
int i = 0;
i <= notches; ++
i) {
196 : (
Q_PI * 8 -
i * 10 *
Q_PI / notches) / 6;
200 poly[2 *
i] =
QPointF(xc + (
r - bigLineSize) *
c,
201 yc - (
r - bigLineSize) *
s);
204 poly[2 *
i] =
QPointF(xc + (
r - 1 - smallLineSize) *
c,
205 yc - (
r - 1 - smallLineSize) *
s);
206 poly[2 *
i + 1] =
QPointF(xc + (
r - 1) *
c, yc -(
r - 1) *
s);
223 const qreal penSize =
r/20.0;
237 buttonColor.
setHsv(buttonColor .hue(),
238 qMin(140, buttonColor .saturation()),
250 int(
r * 2 - 2 * d_ - 2),
251 int(
r * 2 - 2 * d_ - 2));
255 qreal shadowSize =
qMax(1.0, penSize/2.0);
257 2*shadowSize, 2*shadowSize);
263 p->setBrush(shadowGradient);
265 p->translate(shadowSize, shadowSize);
266 p->drawEllipse(shadowRect);
267 p->translate(-shadowSize, -shadowSize);
271 br.width()*1.3, br.center().x(),
272 br.center().y() - br.height()/2);
277 p->setBrush(gradient);
285 p->setPen(buttonColor.
lighter(110));
286 p->drawEllipse(br.adjusted(1, 1, -1, -1));
294 p->setPen(
QPen(highlight, 2.0));
296 p->drawEllipse(br.adjusted(-1, -1, 1, 1));
302 buttonColor = buttonColor.
lighter(104);
305 QRectF dialRect(dp.x() - ds, dp.y() - ds, 2*ds, 2*ds);
IOBluetoothDevice * device
bool frame
whether the spin box draws itself with a frame
ButtonSymbols buttonSymbols
the current button symbol mode
virtual StepEnabled stepEnabled() const
Virtual function that determines whether stepping up and down is legal at any given time.
const QColor & color() const
Returns the brush color.
The QColor class provides colors based on RGB, HSV or CMYK values.
int saturation() const noexcept
Returns the HSV saturation color component of this color.
void setAlphaF(float alpha)
Sets the alpha of this color to alpha.
QColor darker(int f=200) const noexcept
QColor toHsv() const noexcept
Creates and returns an HSV QColor based on this color.
int hue() const noexcept
Returns the HSV hue color component of this color.
void setAlpha(int alpha)
Sets the alpha of this color to alpha.
void setHsv(int h, int s, int v, int a=255)
Sets a HSV color value; h is the hue, s is the saturation, v is the value and a is the alpha componen...
int value() const noexcept
Returns the value color component of this color.
QColor lighter(int f=150) const noexcept
static bool testAttribute(Qt::ApplicationAttribute attribute)
Returns true if attribute attribute is set; otherwise returns false.
void setColorAt(qreal pos, const QColor &color)
Creates a stop point at the given position with the given color.
void resize(qsizetype size)
The QPainter class performs low-level painting on widgets and other paint devices.
void setPen(const QColor &color)
This is an overloaded member function, provided for convenience. It differs from the above function o...
void drawLine(const QLineF &line)
Draws a line defined by line.
void restore()
Restores the current painter state (pops a saved state off the stack).
void drawLines(const QLineF *lines, int lineCount)
Draws the first lineCount lines in the array lines using the current pen.
void save()
Saves the current painter state (pushes the state onto a stack).
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 drawEllipse(const QRectF &r)
Draws the ellipse defined by the given rectangle.
void setBrush(const QBrush &brush)
Sets the painter's brush to the given brush.
void setRenderHint(RenderHint hint, bool on=true)
Sets the given render hint on the painter if on is true; otherwise clears the render hint.
The QPalette class contains color groups for each widget state.
const QBrush & highlight() const
Returns the highlight brush of the current color group.
const QBrush & button() const
Returns the button brush of the current color group.
const QColor & color(ColorGroup cg, ColorRole cr) const
Returns the color in the specified color group, used for the given color role.
Returns a copy of the pixmap that is transformed using the given transformation transform and transfo...
\inmodule QtCore\reentrant
constexpr qreal x() const noexcept
Returns the x coordinate of this point.
constexpr qreal y() const noexcept
Returns the y coordinate of this point.
The QPolygonF class provides a list of points using floating point precision.
QStyle::SubControls activeSubControls
\inmodule QtCore\reentrant
constexpr qreal width() const noexcept
Returns the width of the rectangle.
constexpr QRectF adjusted(qreal x1, qreal y1, qreal x2, qreal y2) const noexcept
Returns a new rectangle with dx1, dy1, dx2 and dy2 added respectively to the existing coordinates of ...
constexpr QPointF center() const noexcept
Returns the center point of the rectangle.
\inmodule QtCore\reentrant
constexpr int height() const noexcept
Returns the height of the rectangle.
constexpr int width() const noexcept
Returns the width of the rectangle.
\macro QT_RESTRICTED_CAST_FROM_ASCII
static QString fromLatin1(QByteArrayView ba)
This is an overloaded member function, provided for convenience. It differs from the above function o...
QString uniqueName(const QString &key, const QStyleOption *option, const QSize &size)
int calcBigLineSize(int radius)
QPolygonF calcLines(const QStyleOptionSlider *dial)
static QPointF calcRadialPos(const QStyleOptionSlider *dial, qreal offset)
qreal dpi(const QStyleOption *option)
void drawBorderPixmap(const QPixmap &pixmap, QPainter *painter, const QRect &rect, int left, int top, int right, int bottom)
WidgetSizePolicy widgetSizePolicy(const QStyleOption *opt)
QColor backgroundColor(const QPalette &pal)
static const qreal qstyleBaseDpi
qreal dpiScaled(qreal value, qreal dpi)
void drawDial(const QStyleOptionSlider *option, QPainter *painter)
Combined button and popup list for selecting options.
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
static QT_BEGIN_NAMESPACE const qreal Q_PI
constexpr const T & qMin(const T &a, const T &b)
constexpr const T & qMax(const T &a, const T &b)
GLint GLsizei GLsizei height
GLboolean GLboolean GLboolean GLboolean a
[7]
GLuint GLfloat GLfloat GLfloat GLfloat y1
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLuint GLfloat GLfloat GLfloat x1
GLdouble GLdouble GLdouble GLdouble top
GLenum GLenum GLsizei const GLuint GLboolean enabled
GLenum GLuint GLintptr offset
GLfixed GLfixed GLfixed y2
QT_BEGIN_NAMESPACE Q_GUI_EXPORT int qt_defaultDpiX()
#define BEGIN_STYLE_PIXMAPCACHE(a)
#define END_STYLE_PIXMAPCACHE
static bool match(const uchar *found, uint foundLen, const char *target, uint targetLen)
\inmodule QtCore \reentrant
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent