summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp3
-rw-r--r--tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp39
7 files changed, 3 insertions, 73 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");
}
diff --git a/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp b/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp
index c6b2b49d98..3c98f8936c 100644
--- a/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp
@@ -1384,7 +1384,6 @@ void tst_QGraphicsWidget::setAttribute_data()
QTest::newRow("WA_RightToLeft") << Qt::WA_RightToLeft << true;
QTest::newRow("WA_SetStyle") << Qt::WA_SetStyle << true;
QTest::newRow("WA_Resized") << Qt::WA_Resized << true;
- QTest::newRow("unsupported") << Qt::WA_PaintOutsidePaintEvent << false;
}
// void setAttribute(Qt::WidgetAttribute attribute, bool on = true) public
@@ -1393,8 +1392,6 @@ void tst_QGraphicsWidget::setAttribute()
QFETCH(Qt::WidgetAttribute, attribute);
QFETCH(bool, supported);
SubQGraphicsWidget widget;
- if (attribute == Qt::WA_PaintOutsidePaintEvent)
- QTest::ignoreMessage(QtWarningMsg, "QGraphicsWidget::setAttribute: unsupported attribute 13");
widget.setAttribute(attribute);
QCOMPARE(widget.testAttribute(attribute), supported);
}
diff --git a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
index 975c88db05..0c769d55da 100644
--- a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
+++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
@@ -377,9 +377,6 @@ private slots:
#endif
void windowFlags();
void initialPosForDontShowOnScreenWidgets();
-#ifdef Q_WS_X11
- void paintOutsidePaintEvent();
-#endif
void updateOnDestroyedSignal();
void toplevelLineEditFocus();
void inputFocus_task257832();
@@ -8711,42 +8708,6 @@ void tst_QWidget::initialPosForDontShowOnScreenWidgets()
}
}
-#ifdef Q_WS_X11
-void tst_QWidget::paintOutsidePaintEvent()
-{
- QWidget widget;
- widget.resize(200, 200);
-
- QWidget child1(&widget);
- child1.resize(100, 100);
- child1.setPalette(Qt::red);
- child1.setAutoFillBackground(true);
-
- QWidget child2(&widget);
- child2.setGeometry(50, 50, 100, 100);
- child2.setPalette(Qt::blue);
- child2.setAutoFillBackground(true);
-
- widget.show();
- QTest::qWaitForWindowShown(&widget);
- QTest::qWait(60);
-
- const QPixmap before = QPixmap::grabWindow(widget.winId());
-
- // Child 1 should be clipped by child 2, so nothing should change.
- child1.setAttribute(Qt::WA_PaintOutsidePaintEvent);
- QPainter painter(&child1);
- painter.fillRect(child1.rect(), Qt::red);
- painter.end();
- XSync(QX11Info::display(), false); // Flush output buffer.
- QTest::qWait(60);
-
- const QPixmap after = QPixmap::grabWindow(widget.winId());
-
- QCOMPARE(before, after);
-}
-#endif
-
class MyEvilObject : public QObject
{
Q_OBJECT