Qt 4.8
|
#include "qdrawutil.h"
#include "qbitmap.h"
#include "qpixmapcache.h"
#include "qapplication.h"
#include "qpainter.h"
#include "qpalette.h"
#include <private/qpaintengineex_p.h>
#include <qvarlengtharray.h>
#include <qmath.h>
#include <private/qstylehelper_p.h>
Go to the source code of this file.
Typedefs | |
typedef QVarLengthArray< QRectF, 16 > | QRectFArray |
Functions | |
void | qDrawBorderPixmap (QPainter *painter, const QRect &targetRect, const QMargins &targetMargins, const QPixmap &pixmap, const QRect &sourceRect, const QMargins &sourceMargins, const QTileRules &rules, QDrawBorderPixmap::DrawingHints hints) |
Draws the indicated sourceRect rectangle from the given pixmap into the given targetRect rectangle, using the given painter. More... | |
void | qDrawPlainRect (QPainter *p, int x, int y, int w, int h, const QColor &c, int lineWidth, const QBrush *fill) |
void | qDrawPlainRect (QPainter *p, const QRect &r, const QColor &c, int lineWidth, const QBrush *fill) |
void | qDrawShadeLine (QPainter *p, int x1, int y1, int x2, int y2, const QPalette &pal, bool sunken, int lineWidth, int midLineWidth) |
void | qDrawShadeLine (QPainter *p, const QPoint &p1, const QPoint &p2, const QPalette &pal, bool sunken, int lineWidth, int midLineWidth) |
void | qDrawShadePanel (QPainter *p, int x, int y, int w, int h, const QPalette &pal, bool sunken, int lineWidth, const QBrush *fill) |
void | qDrawShadePanel (QPainter *p, const QRect &r, const QPalette &pal, bool sunken, int lineWidth, const QBrush *fill) |
void | qDrawShadeRect (QPainter *p, int x, int y, int w, int h, const QPalette &pal, bool sunken, int lineWidth, int midLineWidth, const QBrush *fill) |
void | qDrawShadeRect (QPainter *p, const QRect &r, const QPalette &pal, bool sunken, int lineWidth, int midLineWidth, const QBrush *fill) |
void | qDrawWinButton (QPainter *p, int x, int y, int w, int h, const QPalette &pal, bool sunken, const QBrush *fill) |
void | qDrawWinButton (QPainter *p, const QRect &r, const QPalette &pal, bool sunken, const QBrush *fill) |
void | qDrawWinPanel (QPainter *p, int x, int y, int w, int h, const QPalette &pal, bool sunken, const QBrush *fill) |
void | qDrawWinPanel (QPainter *p, const QRect &r, const QPalette &pal, bool sunken, const QBrush *fill) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Draws the Windows-style panel at the rectangle specified by rect using the given painter with a line width of 2 pixels. More... | |
static void | qDrawWinShades (QPainter *p, int x, int y, int w, int h, const QColor &c1, const QColor &c2, const QColor &c3, const QColor &c4, const QBrush *fill) |
This function draws a rectangle with two pixel line width. More... | |
typedef QVarLengthArray<QRectF, 16> QRectFArray |
Definition at line 1086 of file qdrawutil.cpp.
void qDrawBorderPixmap | ( | QPainter * | painter, |
const QRect & | targetRect, | ||
const QMargins & | targetMargins, | ||
const QPixmap & | pixmap, | ||
const QRect & | sourceRect, | ||
const QMargins & | sourceMargins, | ||
const QTileRules & | rules, | ||
QDrawBorderPixmap::DrawingHints | hints | ||
) |
Draws the indicated sourceRect rectangle from the given pixmap into the given targetRect rectangle, using the given painter.
The pixmap will be split into nine segments according to the given targetMargins and sourceMargins structures. Finally, the pixmap will be drawn according to the given rules.
This function is used to draw a scaled pixmap, similar to CSS3 border-images
Definition at line 1106 of file qdrawutil.cpp.
Referenced by QRenderRule::drawBorderImage(), QDeclarativeRectangle::drawRect(), and QDeclarativeBorderImage::paint().
void qDrawPlainRect | ( | QPainter * | p, |
int | x, | ||
int | y, | ||
int | w, | ||
int | h, | ||
const QColor & | c, | ||
int | lineWidth, | ||
const QBrush * | fill | ||
) |
Definition at line 511 of file qdrawutil.cpp.
Referenced by QWindowsMobileStyle::drawComplexControl(), QCommonStyle::drawControl(), QWindowsCEStyle::drawControl(), QWindowsMobileStyle::drawControl(), QWindowsCEStyle::drawPrimitive(), QCommonStyle::drawPrimitive(), QWindowsMobileStyle::drawPrimitive(), QMotifStyle::drawPrimitive(), and qDrawPlainRect().
void qDrawPlainRect | ( | QPainter * | p, |
const QRect & | r, | ||
const QColor & | c, | ||
int | lineWidth, | ||
const QBrush * | fill | ||
) |
Definition at line 726 of file qdrawutil.cpp.
void qDrawShadeLine | ( | QPainter * | p, |
int | x1, | ||
int | y1, | ||
int | x2, | ||
int | y2, | ||
const QPalette & | pal, | ||
bool | sunken, | ||
int | lineWidth, | ||
int | midLineWidth | ||
) |
Definition at line 93 of file qdrawutil.cpp.
Referenced by QMotifStyle::drawComplexControl(), QCommonStyle::drawControl(), QCommonStyle::drawPrimitive(), QMotifStyle::drawPrimitive(), and qDrawShadeLine().
void qDrawShadeLine | ( | QPainter * | p, |
const QPoint & | p1, | ||
const QPoint & | p2, | ||
const QPalette & | pal, | ||
bool | sunken, | ||
int | lineWidth, | ||
int | midLineWidth | ||
) |
Definition at line 568 of file qdrawutil.cpp.
void qDrawShadePanel | ( | QPainter * | p, |
int | x, | ||
int | y, | ||
int | w, | ||
int | h, | ||
const QPalette & | pal, | ||
bool | sunken, | ||
int | lineWidth, | ||
const QBrush * | fill | ||
) |
Definition at line 303 of file qdrawutil.cpp.
Referenced by QMotifStyle::drawComplexControl(), QCommonStyle::drawControl(), QWindowsCEStyle::drawControl(), QCDEStyle::drawControl(), QWindowsStyle::drawControl(), QMotifStyle::drawControl(), QStyleSheetStyle::drawControl(), QCommonStyle::drawPrimitive(), QWindowsMobileStyle::drawPrimitive(), QCDEStyle::drawPrimitive(), QWindowsStyle::drawPrimitive(), QMotifStyle::drawPrimitive(), QDecorationDefault::paint(), QColorLuminancePicker::paintEvent(), and qDrawShadePanel().
void qDrawShadePanel | ( | QPainter * | p, |
const QRect & | r, | ||
const QPalette & | pal, | ||
bool | sunken, | ||
int | lineWidth, | ||
const QBrush * | fill | ||
) |
Definition at line 640 of file qdrawutil.cpp.
void qDrawShadeRect | ( | QPainter * | p, |
int | x, | ||
int | y, | ||
int | w, | ||
int | h, | ||
const QPalette & | pal, | ||
bool | sunken, | ||
int | lineWidth, | ||
int | midLineWidth, | ||
const QBrush * | fill | ||
) |
Definition at line 204 of file qdrawutil.cpp.
Referenced by QCommonStyle::drawControl(), QWindowsStyle::drawControl(), QWindowsCEStyle::drawPrimitive(), QCommonStyle::drawPrimitive(), QWindowsStyle::drawPrimitive(), and qDrawShadeRect().
void qDrawShadeRect | ( | QPainter * | p, |
const QRect & | r, | ||
const QPalette & | pal, | ||
bool | sunken, | ||
int | lineWidth, | ||
int | midLineWidth, | ||
const QBrush * | fill | ||
) |
Definition at line 605 of file qdrawutil.cpp.
void qDrawWinButton | ( | QPainter * | p, |
int | x, | ||
int | y, | ||
int | w, | ||
int | h, | ||
const QPalette & | pal, | ||
bool | sunken, | ||
const QBrush * | fill | ||
) |
Definition at line 435 of file qdrawutil.cpp.
Referenced by QWindowsStyle::drawComplexControl(), QWindowsStyle::drawControl(), QWindowsMobileStyle::drawPrimitive(), QWindowsStyle::drawPrimitive(), and qDrawWinButton().
void qDrawWinButton | ( | QPainter * | p, |
const QRect & | r, | ||
const QPalette & | pal, | ||
bool | sunken, | ||
const QBrush * | fill | ||
) |
Definition at line 669 of file qdrawutil.cpp.
void qDrawWinPanel | ( | QPainter * | p, |
int | x, | ||
int | y, | ||
int | w, | ||
int | h, | ||
const QPalette & | pal, | ||
bool | sunken, | ||
const QBrush * | fill | ||
) |
Definition at line 475 of file qdrawutil.cpp.
Referenced by QCommonStyle::drawComplexControl(), QWindowsStyle::drawComplexControl(), QCommonStyle::drawControl(), QCommonStyle::drawPrimitive(), QWindowsStyle::drawPrimitive(), QDecorationDefault::paint(), QDecorationWindows::paintButton(), QDecorationDefault::paintButton(), and qDrawWinPanel().
void qDrawWinPanel | ( | QPainter * | painter, |
const QRect & | rect, | ||
const QPalette & | palette, | ||
bool | sunken, | ||
const QBrush * | fill | ||
) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Draws the Windows-style panel at the rectangle specified by rect using the given painter with a line width of 2 pixels.
The button's interior is filled with the fill brush unless fill is 0.
The given palette specifies the shading colors. The panel appears sunken if sunken is true, otherwise raised.
Alternatively you can use a QFrame widget and apply the QFrame::setFrameStyle() function to display a shaded panel:
Definition at line 699 of file qdrawutil.cpp.
|
static |
This function draws a rectangle with two pixel line width.
It is called from qDrawWinButton() and qDrawWinPanel().
c1..c4 and fill are used:
1 1 1 1 1 2 1 3 3 3 4 2 1 3 F F 4 2 1 3 F F 4 2 1 4 4 4 4 2 2 2 2 2 2 2
Definition at line 384 of file qdrawutil.cpp.
Referenced by qDrawWinButton(), and qDrawWinPanel().