42 #ifndef QSTYLEPAINTER_H 43 #define QSTYLEPAINTER_H 45 #include <QtGui/qpainter.h> 46 #include <QtGui/qstyle.h> 47 #include <QtGui/qwidget.h> 63 Q_ASSERT_X(w,
"QStylePainter::QStylePainter",
"Widget must be non-zero");
73 inline void drawItemPixmap(
const QRect &r,
int flags,
const QPixmap &pixmap);
112 #endif // QSTYLEPAINTER_H The QPainter class performs low-level painting on widgets and other paint devices.
#define QT_END_NAMESPACE
This macro expands to.
QPointer< QWidget > widget
ColorRole
The ColorRole enum defines the different symbolic color roles used in current GUIs.
void drawControl(QStyle::ControlElement ce, const QStyleOption &opt)
Use the widget's style to draw a control element ce specified by QStyleOption option.
ComplexControl
This enum describes the available complex controls.
QStyle * style() const
Return the current style used by the QStylePainter.
#define Q_DISABLE_COPY(Class)
Disables the use of copy constructors and assignment operators for the given Class.
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.
The QString class provides a Unicode character string.
bool begin(QPaintDevice *)
Begins painting the paint device and returns true if successful; otherwise returns false...
QStylePainter(QWidget *w)
Construct a QStylePainter using widget widget for its paint device.
#define QT_BEGIN_NAMESPACE
This macro expands to.
void drawItemPixmap(const QRect &r, int flags, const QPixmap &pixmap)
Draws the pixmap in rectangle rect.
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.
The QStyleOption class stores the parameters used by QStyle functions.
bool begin(QWidget *w)
Begin painting operations on the specified widget.
virtual void drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPainter *p, const QWidget *w=0) const =0
Draws the given primitive element with the provided painter using the style options specified by opti...
void drawItemText(const QRect &r, int flags, const QPalette &pal, bool enabled, const QString &text, QPalette::ColorRole textRole=QPalette::NoRole)
virtual void drawComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, QPainter *p, const QWidget *widget=0) const =0
Draws the given control using the provided painter with the style options specified by option...
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...
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, using the provided painter.
#define Q_ASSERT_X(cond, where, what)
PrimitiveElement
This enum describes the various primitive elements.
virtual void drawControl(ControlElement element, const QStyleOption *opt, QPainter *p, const QWidget *w=0) const =0
Draws the given element with the provided painter with the style options specified by option...
The QStyle class is an abstract base class that encapsulates the look and feel of a GUI...
The QRect class defines a rectangle in the plane using integer precision.
The QPixmap class is an off-screen image representation that can be used as a paint device...
The QStylePainter class is a convenience class for drawing QStyle elements inside a widget...
ControlElement
This enum represents a control element.
The QStyleOptionComplex class is used to hold parameters that are common to all complex controls...
void drawComplexControl(QStyle::ComplexControl cc, const QStyleOptionComplex &opt)
Use the widget's style to draw a complex control cc specified by the QStyleOptionComplex option...
The QPalette class contains color groups for each widget state.