summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDebao Zhang <dbzhang800@gmail.com>2012-03-23 18:19:27 -0700
committerQt by Nokia <qt-info@nokia.com>2012-03-28 11:22:11 +0200
commitd2b1c2ef1f1fea3200d8dee5c58fe79649fd13bb (patch)
tree2508abaa6383ff619546eb6afb4514c146ac92ed /src
parent5e80eb7917c5b4d319766a3cf5122391f54c40a7 (diff)
Remove WA_PaintOutsidePaintEvent
WA_PaintOutsidePaintEvent is only suggested to be used when porting Qt3 code to Qt 4 under X11 platform. and it has been broken now. Change-Id: Ie4297b2a449f1055ca10ada9efb930e6018b1efb Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/global/qnamespace.h1
-rw-r--r--src/corelib/global/qnamespace.qdoc5
-rw-r--r--src/gui/painting/qpainter.cpp24
-rw-r--r--src/widgets/kernel/qwidget.cpp2
-rw-r--r--src/widgets/kernel/qwidgetbackingstore.cpp2
5 files changed, 3 insertions, 31 deletions
diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h
index cef244f7b3..edf8a165a0 100644
--- a/src/corelib/global/qnamespace.h
+++ b/src/corelib/global/qnamespace.h
@@ -342,7 +342,6 @@ public:
WA_UpdatesDisabled = 10,
WA_Mapped = 11,
WA_MacNoClickThrough = 12, // Mac only
- WA_PaintOutsidePaintEvent = 13,
WA_InputMethodEnabled = 14,
WA_WState_Visible = 15,
WA_WState_Hidden = 16,
diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc
index 771f974011..881b55037d 100644
--- a/src/corelib/global/qnamespace.qdoc
+++ b/src/corelib/global/qnamespace.qdoc
@@ -993,11 +993,6 @@
require native painting primitives, you need to reimplement
QWidget::paintEngine() to return 0 and set this flag.
- \value WA_PaintOutsidePaintEvent Makes it possible to use QPainter to
- paint on the widget outside \l{QWidget::paintEvent()}{paintEvent()}. This
- flag is not supported on Windows, Mac OS X or Embedded Linux. We recommend
- that you use it only when porting Qt 3 code to Qt 4.
-
\value WA_PaintUnclipped Makes all painters operating on this widget
unclipped. Children of this widget or other widgets in front of it do not
clip the area the painter can paint on. This flag is only supported for
diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp
index eafbe87b31..2752fbd573 100644
--- a/src/gui/painting/qpainter.cpp
+++ b/src/gui/painting/qpainter.cpp
@@ -970,10 +970,7 @@ void QPainterPrivate::updateState(QPainterState *newState)
\warning When the paintdevice is a widget, QPainter can only be
used inside a paintEvent() function or in a function called by
- paintEvent(); that is unless the Qt::WA_PaintOutsidePaintEvent
- widget attribute is set. On Mac OS X and Windows, you can only
- paint in a paintEvent() function regardless of this attribute's
- setting.
+ paintEvent().
\tableofcontents
@@ -1760,25 +1757,6 @@ bool QPainter::begin(QPaintDevice *pd)
d->engine->state = d->state;
switch (pd->devType()) {
-#if 0
- // is this needed any more??
- case QInternal::Widget:
- {
- const QWidget *widget = static_cast<const QWidget *>(pd);
- Q_ASSERT(widget);
-
- const bool paintOutsidePaintEvent = widget->testAttribute(Qt::WA_PaintOutsidePaintEvent);
- const bool inPaintEvent = widget->testAttribute(Qt::WA_WState_InPaintEvent);
-
- // Adjust offset for alien widgets painting outside the paint event.
- if (!inPaintEvent && paintOutsidePaintEvent && !widget->internalWinId()
- && widget->testAttribute(Qt::WA_WState_Created)) {
- const QPoint offset = widget->mapTo(widget->nativeParentWidget(), QPoint());
- d->state->redirectionMatrix.translate(offset.x(), offset.y());
- }
- break;
- }
-#endif
case QInternal::Pixmap:
{
QPixmap *pm = static_cast<QPixmap *>(pd);
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index e6d5a7af6d..8e6e4368e8 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -5128,7 +5128,7 @@ void QWidgetPrivate::drawWidget(QPaintDevice *pdev, const QRegion &rgn, const QP
paintEngine->d_func()->systemClip = QRegion();
}
q->setAttribute(Qt::WA_WState_InPaintEvent, false);
- if (q->paintingActive() && !q->testAttribute(Qt::WA_PaintOutsidePaintEvent))
+ if (q->paintingActive())
qWarning("QWidget::repaint: It is dangerous to leave painters active on a widget outside of the PaintEvent");
if (paintEngine && paintEngine->autoDestruct()) {
diff --git a/src/widgets/kernel/qwidgetbackingstore.cpp b/src/widgets/kernel/qwidgetbackingstore.cpp
index 2e9f072a0f..93c64133d6 100644
--- a/src/widgets/kernel/qwidgetbackingstore.cpp
+++ b/src/widgets/kernel/qwidgetbackingstore.cpp
@@ -1364,7 +1364,7 @@ void QWidgetPrivate::repaint_sys(const QRegion &rgn)
QWidgetBackingStore::unflushPaint(q, toBePainted);
#endif
- if (!q->testAttribute(Qt::WA_PaintOutsidePaintEvent) && q->paintingActive())
+ if (q->paintingActive())
qWarning("QWidget::repaint: It is dangerous to leave painters active on a widget outside of the PaintEvent");
}