KDWinUtils
Helper library for MFC to Qt migration
|
The KPainter class is used to paint on a widget. More...
#include <kpainter.h>
Public Member Functions | |
void | BitBlt (const QRect &rect, const QPixmap &pSrcDC, int xSrc, int ySrc) |
Draws a bitmap at the specified coordinates. | |
void | BitBlt (int x, int y, int nWidth, int nHeight, const QPixmap &pSrcDC, int xSrc, int ySrc) |
Draws a bitmap at the specified coordinates. | |
void | Chord (int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4) |
void | Ellipse (const KRect &rect) |
Draws an ellipse using the current pen and fills it using the current brush. | |
void | Ellipse (int x1, int y1, int x2, int y2) |
Draws an ellipse using the current pen and fills it using the current brush. | |
void | FillRect (const KRect &rect, const KBrush &brush) |
Fills a given rectangle by using a specific brush. | |
KSize | GetTextExtent (const KString &str) const |
Computes the width and height of a line of text based on the current font. | |
void | IntersectClipRect (const KRect &rect) |
Enables clipping, and sets the clip region to the given rectangle. | |
void | IntersectClipRect (int x1, int y1, int x2, int y2) |
Enables clipping, and sets the clip region to the given rectangle. | |
template<typename T > | |
KPainter (KWidgetBase< T > *widget) | |
Construct a new KPainter object based on a KWidget or KDialog. | |
void | LineTo (int x, int y) |
Draws a line from the current position up to, but not including, a point. | |
void | MoveTo (int x, int y) |
Moves the current position. | |
void | Pie (int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4) |
Draws a pie-shaped wedge. | |
void | PolyBezier (const KPoint *points, int pointCount) |
Draws one or more Bzier splines. The current position isn't used or updated. | |
void | Polygon (const KPoint *points, int pointCount) |
Draws a polygon consisting of two or more points (vertices) connected by lines. | |
void | Rectangle (const KRect &rect) |
Draws a rectangle using the current pen and fills it using the current brush. | |
void | Rectangle (int x1, int y1, int x2, int y2) |
Draws a rectangle using the current pen and fills it using the current brush. | |
void | RoundRect (const KRect &rect, int ellipseWidth, int ellipseHeight) |
Draws a rounded rectangle using the current pen and fills it using the current brush. | |
void | RoundRect (int x1, int y1, int x2, int y2, int ellipseWidth, int ellipseHeight) |
Draws a rounded rectangle using the current pen and fills it using the current brush. | |
void | SelectClipRgn (QRegion *region) |
Sets the clipping region to be used for drawing. | |
KBrush | SelectObject (const KBrush &brush) |
Sets the brush to be used for drawing. | |
KFont | SelectObject (const KFont &font) |
Sets the font to be used for drawing. | |
KPen | SelectObject (const KPen &pen) |
Sets the pen to be used for drawing. | |
QColor | SetBkColor (const QColor &color) |
Sets the background color to be used for drawing (ie the brush color) | |
QColor | SetTextColor (const QColor &color) |
Sets the text color to be used for drawing (ie the pen color) | |
void | TextOut (int x, int y, const KString &text) |
Writes a character string at a specified location using the currently selected font. | |
void | TextOut (int x, int y, const KString &text, int nCount) |
Writes a character string at a specified location using the currently selected font. | |
The KPainter class is used to paint on a widget.
This class can replace CDC or CPaintDC with the same API, and can be used in the same way as QPainter (it's inheriting QPainter).
|
inline |
void KPainter::BitBlt | ( | const QRect & | rect, |
const QPixmap & | pSrcDC, | ||
int | xSrc, | ||
int | ySrc ) |
Draws a bitmap at the specified coordinates.
void KPainter::BitBlt | ( | int | x, |
int | y, | ||
int | nWidth, | ||
int | nHeight, | ||
const QPixmap & | pSrcDC, | ||
int | xSrc, | ||
int | ySrc ) |
Draws a bitmap at the specified coordinates.
void KPainter::Chord | ( | int | x1, |
int | y1, | ||
int | x2, | ||
int | y2, | ||
int | x3, | ||
int | y3, | ||
int | x4, | ||
int | y4 ) |
void KPainter::Ellipse | ( | const KRect & | rect | ) |
Draws an ellipse using the current pen and fills it using the current brush.
void KPainter::Ellipse | ( | int | x1, |
int | y1, | ||
int | x2, | ||
int | y2 ) |
Draws an ellipse using the current pen and fills it using the current brush.
Fills a given rectangle by using a specific brush.
Computes the width and height of a line of text based on the current font.
void KPainter::IntersectClipRect | ( | const KRect & | rect | ) |
Enables clipping, and sets the clip region to the given rectangle.
If clipping is already enabled, the new clip region is the intersection of the current clip region and the rectangle.
void KPainter::IntersectClipRect | ( | int | x1, |
int | y1, | ||
int | x2, | ||
int | y2 ) |
Enables clipping, and sets the clip region to the given rectangle.
If clipping is already enabled, the new clip region is the intersection of the current clip region and the rectangle.
void KPainter::LineTo | ( | int | x, |
int | y ) |
Draws a line from the current position up to, but not including, a point.
void KPainter::MoveTo | ( | int | x, |
int | y ) |
Moves the current position.
void KPainter::Pie | ( | int | x1, |
int | y1, | ||
int | x2, | ||
int | y2, | ||
int | x3, | ||
int | y3, | ||
int | x4, | ||
int | y4 ) |
Draws a pie-shaped wedge.
void KPainter::PolyBezier | ( | const KPoint * | points, |
int | pointCount ) |
Draws one or more Bzier splines. The current position isn't used or updated.
void KPainter::Polygon | ( | const KPoint * | points, |
int | pointCount ) |
Draws a polygon consisting of two or more points (vertices) connected by lines.
void KPainter::Rectangle | ( | const KRect & | rect | ) |
Draws a rectangle using the current pen and fills it using the current brush.
void KPainter::Rectangle | ( | int | x1, |
int | y1, | ||
int | x2, | ||
int | y2 ) |
Draws a rectangle using the current pen and fills it using the current brush.
void KPainter::RoundRect | ( | const KRect & | rect, |
int | ellipseWidth, | ||
int | ellipseHeight ) |
Draws a rounded rectangle using the current pen and fills it using the current brush.
void KPainter::RoundRect | ( | int | x1, |
int | y1, | ||
int | x2, | ||
int | y2, | ||
int | ellipseWidth, | ||
int | ellipseHeight ) |
Draws a rounded rectangle using the current pen and fills it using the current brush.
void KPainter::SelectClipRgn | ( | QRegion * | region | ) |
Sets the clipping region to be used for drawing.
If the region is null, the clipping is diasabled.
Sets the brush to be used for drawing.
Sets the font to be used for drawing.
Sets the pen to be used for drawing.
QColor KPainter::SetBkColor | ( | const QColor & | color | ) |
Sets the background color to be used for drawing (ie the brush color)
QColor KPainter::SetTextColor | ( | const QColor & | color | ) |
Sets the text color to be used for drawing (ie the pen color)
void KPainter::TextOut | ( | int | x, |
int | y, | ||
const KString & | text ) |
Writes a character string at a specified location using the currently selected font.
void KPainter::TextOut | ( | int | x, |
int | y, | ||
const KString & | text, | ||
int | nCount ) |
Writes a character string at a specified location using the currently selected font.