7#include <QtWidgets/qtwidgetsglobal.h>
8#include <QtGui/qpainter.h>
9#include <QtWidgets/qstyle.h>
10#include <QtWidgets/qwidget.h>
23 Q_ASSERT_X(
w,
"QStylePainter::QStylePainter",
"Widget must be non-zero");
The QPainter class performs low-level painting on widgets and other paint devices.
bool begin(QPaintDevice *)
Begins painting the paint device and returns true if successful; otherwise returns false.
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.
Returns a copy of the pixmap that is transformed using the given transformation transform and transfo...
\inmodule QtCore\reentrant
\macro QT_RESTRICTED_CAST_FROM_ASCII
\variable QStyleOptionMenuItem::menuItemType
The QStyleOption class stores the parameters used by QStyle functions.
The QStylePainter class is a convenience class for drawing QStyle elements inside a widget.
QStylePainter(QPaintDevice *pd, QWidget *w)
Construct a QStylePainter using pd for its paint device, and attributes from widget.
bool begin(QPaintDevice *pd, QWidget *w)
This is an overloaded member function, provided for convenience. It differs from the above function o...
bool begin(QWidget *w)
Begin painting operations on the specified widget.
void drawControl(QStyle::ControlElement ce, const QStyleOption &opt)
Use the widget's style to draw a control element ce specified by QStyleOption option.
void drawPrimitive(QStyle::PrimitiveElement pe, const QStyleOption &opt)
Use the widget's style to draw a primitive element pe specified by QStyleOption option.
QStylePainter()
Constructs a QStylePainter.
void drawComplexControl(QStyle::ComplexControl cc, const QStyleOptionComplex &opt)
Use the widget's style to draw a complex control cc specified by the QStyleOptionComplex option.
void drawItemText(const QRect &r, int flags, const QPalette &pal, bool enabled, const QString &text, QPalette::ColorRole textRole=QPalette::NoRole)
Draws the text in rectangle rect and palette pal.
QStyle * style() const
Return the current style used by the QStylePainter.
void drawItemPixmap(const QRect &r, int flags, const QPixmap &pixmap)
Draws the pixmap in rectangle rect.
QStylePainter(QWidget *w)
Construct a QStylePainter using widget widget for its paint device.
The QStyle class is an abstract base class that encapsulates the look and feel of a GUI.
virtual void drawComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, QPainter *p, const QWidget *widget=nullptr) const =0
Draws the given control using the provided painter with the style options specified by option.
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,...
ControlElement
This enum represents a control element.
ComplexControl
This enum describes the available complex controls.
PrimitiveElement
This enum describes the various primitive elements.
virtual void drawControl(ControlElement element, const QStyleOption *opt, QPainter *p, const QWidget *w=nullptr) const =0
Draws the given element with the provided painter with the style options specified by option.
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 drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPainter *p, const QWidget *w=nullptr) const =0
Draws the given primitive element with the provided painter using the style options specified by opti...
Combined button and popup list for selecting options.
GLfloat GLfloat GLfloat w
[0]
GLenum GLenum GLsizei const GLuint GLboolean enabled
#define Q_ASSERT_X(cond, x, msg)