summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qpainter.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/painting/qpainter.h')
-rw-r--r--src/gui/painting/qpainter.h77
1 files changed, 2 insertions, 75 deletions
diff --git a/src/gui/painting/qpainter.h b/src/gui/painting/qpainter.h
index 30f8da0928..fd40111368 100644
--- a/src/gui/painting/qpainter.h
+++ b/src/gui/painting/qpainter.h
@@ -49,7 +49,6 @@
#include <QtGui/qpixmap.h>
#include <QtGui/qimage.h>
#include <QtGui/qtextoption.h>
-#include <QtGui/qdrawutil.h>
#ifndef QT_INCLUDE_COMPAT
#include <QtGui/qpolygon.h>
@@ -133,7 +132,7 @@ public:
bool end();
bool isActive() const;
- void initFrom(const QWidget *widget);
+ void initFrom(const QPaintDevice *device);
enum CompositionMode {
CompositionMode_SourceOver,
@@ -464,85 +463,13 @@ public:
void beginNativePainting();
void endNativePainting();
-#ifdef QT3_SUPPORT
-
- inline QT3_SUPPORT void setBackgroundColor(const QColor &color) { setBackground(color); }
- inline QT3_SUPPORT const QColor &backgroundColor() const { return background().color(); }
-
- inline QT3_SUPPORT void drawText(int x, int y, const QString &s, int pos, int len)
- { drawText(x, y, s.mid(pos, len)); }
- inline QT3_SUPPORT void drawText(const QPoint &p, const QString &s, int pos, int len)
- { drawText(p, s.mid(pos, len)); }
- inline QT3_SUPPORT void drawText(int x, int y, const QString &s, int len)
- { drawText(x, y, s.left(len)); }
- inline QT3_SUPPORT void drawText(const QPoint &p, const QString &s, int len)
- { drawText(p, s.left(len)); }
- inline QT3_SUPPORT void drawText(const QRect &r, int flags, const QString &str, int len, QRect *br=0)
- { drawText(r, flags, str.left(len), br); }
- inline QT3_SUPPORT void drawText(int x, int y, int w, int h, int flags, const QString &text, int len, QRect *br=0)
- { drawText(QRect(x, y, w, h), flags, text.left(len), br); }
- inline QT3_SUPPORT QRect boundingRect(const QRect &rect, int flags, const QString &text, int len)
- { return boundingRect(rect, flags, text.left(len)); }
- inline QT3_SUPPORT QRect boundingRect(int x, int y, int w, int h, int flags, const QString &text, int len)
- { return boundingRect(QRect(x, y, w, h), flags, text.left(len)); }
-
- inline QT3_SUPPORT bool begin(QPaintDevice *pdev, const QWidget *init)
- { bool ret = begin(pdev); initFrom(init); return ret; }
- QT3_SUPPORT void drawPoints(const QPolygon &pa, int index, int npoints = -1)
- { drawPoints(pa.constData() + index, npoints == -1 ? pa.size() - index : npoints); }
-
- QT3_SUPPORT void drawCubicBezier(const QPolygon &pa, int index = 0);
-
- QT3_SUPPORT void drawLineSegments(const QPolygon &points, int index = 0, int nlines = -1);
-
- inline QT3_SUPPORT void drawPolyline(const QPolygon &pa, int index, int npoints = -1)
- { drawPolyline(pa.constData() + index, npoints == -1 ? pa.size() - index : npoints); }
-
- inline QT3_SUPPORT void drawPolygon(const QPolygon &pa, bool winding, int index = 0, int npoints = -1)
- { drawPolygon(pa.constData() + index, npoints == -1 ? pa.size() - index : npoints,
- winding ? Qt::WindingFill : Qt::OddEvenFill); }
-
- inline QT3_SUPPORT void drawPolygon(const QPolygonF &polygon, bool winding, int index = 0,
- int npoints = -1)
- { drawPolygon(polygon.constData() + index, npoints == -1 ? polygon.size() - index : npoints,
- winding ? Qt::WindingFill : Qt::OddEvenFill); }
-
- inline QT3_SUPPORT void drawConvexPolygon(const QPolygonF &polygon, int index, int npoints = -1)
- { drawConvexPolygon(polygon.constData() + index, npoints == -1 ? polygon.size() - index : npoints); }
- inline QT3_SUPPORT void drawConvexPolygon(const QPolygon &pa, int index, int npoints = -1)
- { drawConvexPolygon(pa.constData() + index, npoints == -1 ? pa.size() - index : npoints); }
-
- static inline QT3_SUPPORT void redirect(QPaintDevice *pdev, QPaintDevice *replacement)
- { setRedirected(pdev, replacement); }
- static inline QT3_SUPPORT QPaintDevice *redirect(QPaintDevice *pdev)
- { return const_cast<QPaintDevice*>(redirected(pdev)); }
-
- inline QT3_SUPPORT void setWorldXForm(bool enabled) { setMatrixEnabled(enabled); }
- inline QT3_SUPPORT bool hasWorldXForm() const { return matrixEnabled(); }
- inline QT3_SUPPORT void resetXForm() { resetTransform(); }
-
- inline QT3_SUPPORT void setViewXForm(bool enabled) { setViewTransformEnabled(enabled); }
- inline QT3_SUPPORT bool hasViewXForm() const { return viewTransformEnabled(); }
-
- QT3_SUPPORT void map(int x, int y, int *rx, int *ry) const;
- QT3_SUPPORT QPoint xForm(const QPoint &) const; // map virtual -> deviceb
- QT3_SUPPORT QRect xForm(const QRect &) const;
- QT3_SUPPORT QPolygon xForm(const QPolygon &) const;
- QT3_SUPPORT QPolygon xForm(const QPolygon &, int index, int npoints) const;
- QT3_SUPPORT QPoint xFormDev(const QPoint &) const; // map device -> virtual
- QT3_SUPPORT QRect xFormDev(const QRect &) const;
- QT3_SUPPORT QPolygon xFormDev(const QPolygon &) const;
- QT3_SUPPORT QPolygon xFormDev(const QPolygon &, int index, int npoints) const;
- QT3_SUPPORT qreal translationX() const;
- QT3_SUPPORT qreal translationY() const;
-#endif
-
private:
Q_DISABLE_COPY(QPainter)
friend class Q3Painter;
QScopedPointer<QPainterPrivate> d_ptr;
+ friend class QWidget;
friend class QFontEngine;
friend class QFontEngineBox;
friend class QFontEngineFT;