Revert "QWidgetEffectSourcePrivate::draw(): Call render() when no shared painter exists"
The change causes drawing artifacts in Qt Creator. This reverts commit 8b1377fde16a2049a1c27f6d005bff84a8f85f28. Task-number: QTCREATORBUG-18322 Task-number: QTBUG-60231 Change-Id: Ic05507b0c23ea612fa5a9b92163380059b6e710d Reviewed-by: Andy Shaw <andy.shaw@qt.io>
This commit is contained in:
parent
b598cd0483
commit
bd263452cd
@ -5860,7 +5860,7 @@ QRectF QWidgetEffectSourcePrivate::boundingRect(Qt::CoordinateSystem system) con
|
|||||||
|
|
||||||
void QWidgetEffectSourcePrivate::draw(QPainter *painter)
|
void QWidgetEffectSourcePrivate::draw(QPainter *painter)
|
||||||
{
|
{
|
||||||
if (!context || context->painter != painter || !context->sharedPainter) {
|
if (!context || context->painter != painter) {
|
||||||
m_widget->render(painter);
|
m_widget->render(painter);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -52,7 +52,6 @@ private slots:
|
|||||||
void boundingRect2();
|
void boundingRect2();
|
||||||
void draw();
|
void draw();
|
||||||
void opacity();
|
void opacity();
|
||||||
void nestedOpaqueOpacity();
|
|
||||||
void grayscale();
|
void grayscale();
|
||||||
void colorize();
|
void colorize();
|
||||||
void drawPixmapItem();
|
void drawPixmapItem();
|
||||||
@ -408,26 +407,6 @@ void tst_QGraphicsEffect::opacity()
|
|||||||
QCOMPARE(effect->m_opacity, qreal(0.5));
|
QCOMPARE(effect->m_opacity, qreal(0.5));
|
||||||
}
|
}
|
||||||
|
|
||||||
void tst_QGraphicsEffect::nestedOpaqueOpacity()
|
|
||||||
{
|
|
||||||
// QTBUG-60231: Nesting widgets with a QGraphicsEffect on a toplevel with
|
|
||||||
// QGraphicsOpacityEffect caused crashes due to constructing several
|
|
||||||
// QPainter instances on a device in the fast path for
|
|
||||||
// QGraphicsOpacityEffect::opacity=1
|
|
||||||
QWidget topLevel;
|
|
||||||
topLevel.setWindowTitle(QTest::currentTestFunction());
|
|
||||||
topLevel.resize(QApplication::desktop()->screenGeometry(&topLevel).size() / 8);
|
|
||||||
QGraphicsOpacityEffect *opacityEffect = new QGraphicsOpacityEffect;
|
|
||||||
opacityEffect->setOpacity(1);
|
|
||||||
topLevel.setGraphicsEffect(opacityEffect);
|
|
||||||
QWidget *child = new QWidget(&topLevel);
|
|
||||||
child->resize(topLevel.size() / 2);
|
|
||||||
QGraphicsDropShadowEffect *childEffect = new QGraphicsDropShadowEffect;
|
|
||||||
child->setGraphicsEffect(childEffect);
|
|
||||||
topLevel.show();
|
|
||||||
QVERIFY(QTest::qWaitForWindowExposed(&topLevel));
|
|
||||||
}
|
|
||||||
|
|
||||||
void tst_QGraphicsEffect::grayscale()
|
void tst_QGraphicsEffect::grayscale()
|
||||||
{
|
{
|
||||||
if (qApp->desktop()->depth() < 24)
|
if (qApp->desktop()->depth() < 24)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user