Convert features.graphicseffect to QT_[REQUIRE_]CONFIG

Change-Id: I1bb96088b2e9f2a2cfab5fceeebebe94fa6bb3a6
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
bb10
Stephan Binner 2017-07-09 08:47:10 +02:00
parent bb1e5675a5
commit 93dc459f48
20 changed files with 96 additions and 101 deletions

View File

@ -33,7 +33,6 @@ SOURCES += qgl.cpp \
qglbuffer.cpp \
HEADERS += qglshaderprogram.h \
qgraphicsshadereffect_p.h \
gl2paintengineex/qglgradientcache_p.h \
gl2paintengineex/qglengineshadermanager_p.h \
gl2paintengineex/qgl2pexvertexarray_p.h \
@ -44,7 +43,6 @@ HEADERS += qglshaderprogram.h \
gl2paintengineex/qglshadercache_p.h
SOURCES += qglshaderprogram.cpp \
qgraphicsshadereffect.cpp \
gl2paintengineex/qglgradientcache.cpp \
gl2paintengineex/qglengineshadermanager.cpp \
gl2paintengineex/qgl2pexvertexarray.cpp \
@ -52,4 +50,9 @@ SOURCES += qglshaderprogram.cpp \
gl2paintengineex/qglcustomshaderstage.cpp \
gl2paintengineex/qtextureglyphcache_gl.cpp
qtConfig(graphicseffect) {
HEADERS += qgraphicsshadereffect_p.h
SOURCES += qgraphicsshadereffect.cpp
}
load(qt_module)

View File

@ -39,8 +39,6 @@
#include "qgraphicsshadereffect_p.h"
#ifndef QT_NO_GRAPHICSEFFECT
#include "qglshaderprogram.h"
#include "gl2paintengineex/qglcustomshaderstage_p.h"
#define QGL_HAVE_CUSTOM_SHADERS 1
@ -312,5 +310,3 @@ void QGraphicsShaderEffect::setUniforms(QGLShaderProgram *program)
}
QT_END_NAMESPACE
#endif // QT_NO_GRAPHICSEFFECT

View File

@ -53,12 +53,11 @@
#include <QtWidgets/qgraphicseffect.h>
#ifndef QT_NO_GRAPHICSEFFECT
#include <QtOpenGL/qtopenglglobal.h>
QT_BEGIN_NAMESPACE
QT_REQUIRE_CONFIG(graphicseffect);
QT_BEGIN_NAMESPACE
class QGLShaderProgram;
class QGLCustomShaderEffectStage;
@ -88,6 +87,4 @@ private:
QT_END_NAMESPACE
#endif // QT_NO_GRAPHICSEFFECT
#endif // QGRAPHICSSHADEREFFECT_P_H

View File

@ -114,7 +114,6 @@
#include <QtCore/qdebug.h>
#include <private/qdrawhelper_p.h>
#ifndef QT_NO_GRAPHICSEFFECT
QT_BEGIN_NAMESPACE
QGraphicsEffectPrivate::~QGraphicsEffectPrivate()
@ -1237,5 +1236,3 @@ QT_END_NAMESPACE
#include "moc_qgraphicseffect.cpp"
#include "moc_qgraphicseffect_p.cpp"
#endif //QT_NO_GRAPHICSEFFECT

View File

@ -47,9 +47,9 @@
#include <QtGui/qcolor.h>
#include <QtGui/qbrush.h>
#ifndef QT_NO_GRAPHICSEFFECT
QT_BEGIN_NAMESPACE
QT_REQUIRE_CONFIG(graphicseffect);
QT_BEGIN_NAMESPACE
class QGraphicsItem;
class QStyleOption;
@ -279,7 +279,5 @@ private:
QT_END_NAMESPACE
#endif //QT_NO_GRAPHICSEFFECT
#endif // QGRAPHICSEFFECT_H

View File

@ -59,7 +59,8 @@
#include <private/qobject_p.h>
#include <private/qpixmapfilter_p.h>
#ifndef QT_NO_GRAPHICSEFFECT
QT_REQUIRE_CONFIG(graphicseffect);
QT_BEGIN_NAMESPACE
class QGraphicsEffectSourcePrivate;
@ -226,6 +227,4 @@ public:
QT_END_NAMESPACE
#endif //QT_NO_GRAPHICSEFFECT
#endif // QGRAPHICSEFFECT_P_H

View File

@ -54,7 +54,6 @@
#include "private/qmemrotate_p.h"
#include "private/qdrawhelper_p.h"
#ifndef QT_NO_GRAPHICSEFFECT
QT_BEGIN_NAMESPACE
class QPixmapFilterPrivate : public QObjectPrivate
@ -1353,5 +1352,3 @@ void QPixmapDropShadowFilter::draw(QPainter *p,
QT_END_NAMESPACE
#include "moc_qpixmapfilter_p.cpp"
#endif //QT_NO_GRAPHICSEFFECT

View File

@ -56,9 +56,9 @@
#include <QtGui/qpixmap.h>
#include <QtWidgets/qgraphicseffect.h>
#ifndef QT_NO_GRAPHICSEFFECT
QT_BEGIN_NAMESPACE
QT_REQUIRE_CONFIG(graphicseffect);
QT_BEGIN_NAMESPACE
class QPainter;
class QPlatformPixmap;
@ -187,5 +187,4 @@ public:
QT_END_NAMESPACE
#endif //QT_NO_GRAPHICSEFFECT
#endif // QPIXMAPFILTER_H

View File

@ -756,7 +756,9 @@
#include <QtWidgets/qstyleoption.h>
#include <QtGui/qevent.h>
#include <QtGui/qinputmethod.h>
#if QT_CONFIG(graphicseffect)
#include <QtWidgets/qgraphicseffect.h>
#endif
#include <private/qgraphicsitem_p.h>
#include <private/qgraphicswidget_p.h>
@ -1558,9 +1560,9 @@ QGraphicsItem::~QGraphicsItem()
setParentItem(0);
}
#ifndef QT_NO_GRAPHICSEFFECT
#if QT_CONFIG(graphicseffect)
delete d_ptr->graphicsEffect;
#endif //QT_NO_GRAPHICSEFFECT
#endif // QT_CONFIG(graphicseffect)
if (d_ptr->transformData) {
for(int i = 0; i < d_ptr->transformData->graphicsTransforms.size(); ++i) {
QGraphicsTransform *t = d_ptr->transformData->graphicsTransforms.at(i);
@ -2383,9 +2385,9 @@ void QGraphicsItemPrivate::setVisibleHelper(bool newVisible, bool explicitly,
if (c)
c->purge();
if (scene) {
#ifndef QT_NO_GRAPHICSEFFECT
#if QT_CONFIG(graphicseffect)
invalidateParentGraphicsEffectsRecursively();
#endif //QT_NO_GRAPHICSEFFECT
#endif // QT_CONFIG(graphicseffect)
scene->d_func()->markDirty(q_ptr, QRectF(), /*invalidateChildren=*/false, /*force=*/true);
}
}
@ -2832,11 +2834,11 @@ void QGraphicsItem::setOpacity(qreal opacity)
// Update.
if (d_ptr->scene) {
#ifndef QT_NO_GRAPHICSEFFECT
#if QT_CONFIG(graphicseffect)
d_ptr->invalidateParentGraphicsEffectsRecursively();
if (!(d_ptr->flags & ItemDoesntPropagateOpacityToChildren))
d_ptr->invalidateChildGraphicsEffectsRecursively(QGraphicsItemPrivate::OpacityChanged);
#endif //QT_NO_GRAPHICSEFFECT
#endif // QT_CONFIG(graphicseffect)
d_ptr->scene->d_func()->markDirty(this, QRectF(),
/*invalidateChildren=*/true,
/*force=*/false,
@ -2854,7 +2856,7 @@ void QGraphicsItem::setOpacity(qreal opacity)
\since 4.6
*/
#ifndef QT_NO_GRAPHICSEFFECT
#if QT_CONFIG(graphicseffect)
QGraphicsEffect *QGraphicsItem::graphicsEffect() const
{
return d_ptr->graphicsEffect;
@ -2896,11 +2898,11 @@ void QGraphicsItem::setGraphicsEffect(QGraphicsEffect *effect)
prepareGeometryChange();
}
}
#endif //QT_NO_GRAPHICSEFFECT
#endif // QT_CONFIG(graphicseffect)
void QGraphicsItemPrivate::updateChildWithGraphicsEffectFlagRecursively()
{
#ifndef QT_NO_GRAPHICSEFFECT
#if QT_CONFIG(graphicseffect)
QGraphicsItemPrivate *itemPrivate = this;
do {
// parent chain already notified?
@ -2923,7 +2925,7 @@ void QGraphicsItemPrivate::updateChildWithGraphicsEffectFlagRecursively()
*/
QRectF QGraphicsItemPrivate::effectiveBoundingRect(const QRectF &rect) const
{
#ifndef QT_NO_GRAPHICSEFFECT
#if QT_CONFIG(graphicseffect)
Q_Q(const QGraphicsItem);
QGraphicsEffect *effect = graphicsEffect;
if (scene && effect && effect->isEnabled()) {
@ -2939,7 +2941,7 @@ QRectF QGraphicsItemPrivate::effectiveBoundingRect(const QRectF &rect) const
}
return q->mapRectFromScene(sceneEffectRect);
}
#endif //QT_NO_GRAPHICSEFFECT
#endif // QT_CONFIG(graphicseffect)
return rect;
}
@ -2955,7 +2957,7 @@ QRectF QGraphicsItemPrivate::effectiveBoundingRect(const QRectF &rect) const
*/
QRectF QGraphicsItemPrivate::effectiveBoundingRect(QGraphicsItem *topMostEffectItem) const
{
#ifndef QT_NO_GRAPHICSEFFECT
#if QT_CONFIG(graphicseffect)
Q_Q(const QGraphicsItem);
QRectF brect = effectiveBoundingRect(q_ptr->boundingRect());
if (ancestorFlags & QGraphicsItemPrivate::AncestorClipsChildren
@ -2980,10 +2982,10 @@ QRectF QGraphicsItemPrivate::effectiveBoundingRect(QGraphicsItem *topMostEffectI
}
return brect;
#else //QT_NO_GRAPHICSEFFECT
#else //QT_CONFIG(graphicseffect)
Q_UNUSED(topMostEffectItem);
return q_ptr->boundingRect();
#endif //QT_NO_GRAPHICSEFFECT
#endif // QT_CONFIG(graphicseffect)
}
@ -5485,7 +5487,7 @@ int QGraphicsItemPrivate::depth() const
/*!
\internal
*/
#ifndef QT_NO_GRAPHICSEFFECT
#if QT_CONFIG(graphicseffect)
void QGraphicsItemPrivate::invalidateParentGraphicsEffectsRecursively()
{
QGraphicsItemPrivate *itemPrivate = this;
@ -5516,7 +5518,7 @@ void QGraphicsItemPrivate::invalidateChildGraphicsEffectsRecursively(QGraphicsIt
childPrivate->invalidateChildGraphicsEffectsRecursively(reason);
}
}
#endif //QT_NO_GRAPHICSEFFECT
#endif // QT_CONFIG(graphicseffect)
/*!
\internal
@ -5798,9 +5800,9 @@ void QGraphicsItem::update(const QRectF &rect)
return;
// Make sure we notify effects about invalidated source.
#ifndef QT_NO_GRAPHICSEFFECT
#if QT_CONFIG(graphicseffect)
d_ptr->invalidateParentGraphicsEffectsRecursively();
#endif //QT_NO_GRAPHICSEFFECT
#endif // QT_CONFIG(graphicseffect)
if (CacheMode(d_ptr->cacheMode) != NoCache) {
// Invalidate cache.
@ -11225,7 +11227,7 @@ int QGraphicsItemGroup::type() const
return Type;
}
#ifndef QT_NO_GRAPHICSEFFECT
#if QT_CONFIG(graphicseffect)
QRectF QGraphicsItemEffectSourcePrivate::boundingRect(Qt::CoordinateSystem system) const
{
const bool deviceCoordinates = (system == Qt::DeviceCoordinates);
@ -11366,7 +11368,7 @@ QPixmap QGraphicsItemEffectSourcePrivate::pixmap(Qt::CoordinateSystem system, QP
return pixmap;
}
#endif //QT_NO_GRAPHICSEFFECT
#endif // QT_CONFIG(graphicseffect)
#ifndef QT_NO_DEBUG_STREAM
static void formatGraphicsItemHelper(QDebug debug, const QGraphicsItem *item)

View File

@ -228,11 +228,11 @@ public:
qreal effectiveOpacity() const;
void setOpacity(qreal opacity);
#ifndef QT_NO_GRAPHICSEFFECT
#if QT_CONFIG(graphicseffect)
// Effect
QGraphicsEffect *graphicsEffect() const;
void setGraphicsEffect(QGraphicsEffect *effect);
#endif //QT_NO_GRAPHICSEFFECT
#endif // QT_CONFIG(graphicseffect)
Qt::MouseButtons acceptedMouseButtons() const;
void setAcceptedMouseButtons(Qt::MouseButtons buttons);
@ -550,7 +550,7 @@ class Q_WIDGETS_EXPORT QGraphicsObject : public QObject, public QGraphicsItem
Q_PROPERTY(qreal rotation READ rotation WRITE setRotation NOTIFY rotationChanged)
Q_PROPERTY(qreal scale READ scale WRITE setScale NOTIFY scaleChanged)
Q_PROPERTY(QPointF transformOriginPoint READ transformOriginPoint WRITE setTransformOriginPoint)
#ifndef QT_NO_GRAPHICSEFFECT
#if QT_CONFIG(graphicseffect)
Q_PROPERTY(QGraphicsEffect *effect READ graphicsEffect WRITE setGraphicsEffect)
#endif
Q_PRIVATE_PROPERTY(QGraphicsItem::d_func(), QDeclarativeListProperty<QGraphicsObject> children READ childrenList DESIGNABLE false NOTIFY childrenChanged)

View File

@ -59,9 +59,6 @@
#include "qgraphicstransform.h"
#include <private/qgraphicstransform_p.h>
#include <private/qgraphicseffect_p.h>
#include <qgraphicseffect.h>
#include <QtCore/qpoint.h>
#if !defined(QT_NO_GRAPHICSVIEW)
@ -217,13 +214,13 @@ public:
bool ignoreDirtyBit = false, bool ignoreOpacity = false) const;
virtual void transformChanged() {}
int depth() const;
#ifndef QT_NO_GRAPHICSEFFECT
#if QT_CONFIG(graphicseffect)
enum InvalidateReason {
OpacityChanged
};
void invalidateParentGraphicsEffectsRecursively();
void invalidateChildGraphicsEffectsRecursively(InvalidateReason reason);
#endif //QT_NO_GRAPHICSEFFECT
#endif // QT_CONFIG(graphicseffect)
void invalidateDepthRecursively();
void resolveDepth();
void addChild(QGraphicsItem *child);
@ -590,7 +587,7 @@ struct QGraphicsItemPaintInfo
quint32 drawItem : 1;
};
#ifndef QT_NO_GRAPHICSEFFECT
#if QT_CONFIG(graphicseffect)
class QGraphicsItemEffectSourcePrivate : public QGraphicsEffectSourcePrivate
{
public:
@ -650,7 +647,7 @@ public:
QGraphicsItemPaintInfo *info;
QTransform lastEffectTransform;
};
#endif //QT_NO_GRAPHICSEFFECT
#endif // QT_CONFIG(graphicseffect)
/*!
Returns \c true if \a item1 is on top of \a item2.
@ -784,7 +781,7 @@ inline bool QGraphicsItemPrivate::insertionOrder(QGraphicsItem *a, QGraphicsItem
inline void QGraphicsItemPrivate::markParentDirty(bool updateBoundingRect)
{
QGraphicsItemPrivate *parentp = this;
#ifndef QT_NO_GRAPHICSEFFECT
#if QT_CONFIG(graphicseffect)
if (updateBoundingRect && parentp->graphicsEffect && !parentp->inSetPosHelper) {
parentp->notifyInvalidated = 1;
static_cast<QGraphicsItemEffectSourcePrivate *>(parentp->graphicsEffect->d_func()
@ -800,7 +797,7 @@ inline void QGraphicsItemPrivate::markParentDirty(bool updateBoundingRect)
// ### Only do this if the parent's effect applies to the entire subtree.
parentp->notifyBoundingRectChanged = 1;
}
#ifndef QT_NO_GRAPHICSEFFECT
#if QT_CONFIG(graphicseffect)
if (parentp->graphicsEffect) {
if (updateBoundingRect) {
static_cast<QGraphicsItemEffectSourcePrivate *>(parentp->graphicsEffect->d_func()

View File

@ -243,10 +243,11 @@
#include <QtWidgets/qtooltip.h>
#include <QtGui/qtransform.h>
#include <QtGui/qinputmethod.h>
#include <QtWidgets/qgraphicseffect.h>
#include <private/qapplication_p.h>
#include <private/qobject_p.h>
#if QT_CONFIG(graphicseffect)
#include <private/qgraphicseffect_p.h>
#endif
#include <private/qgesturemanager_p.h>
#include <private/qpathclipper_p.h>
@ -4810,7 +4811,7 @@ void QGraphicsScenePrivate::drawSubtreeRecursive(QGraphicsItem *item, QPainter *
if (itemHasChildren && itemClipsChildrenToShape)
ENSURE_TRANSFORM_PTR;
#ifndef QT_NO_GRAPHICSEFFECT
#if QT_CONFIG(graphicseffect)
if (item->d_ptr->graphicsEffect && item->d_ptr->graphicsEffect->isEnabled()) {
ENSURE_TRANSFORM_PTR;
QGraphicsItemPaintInfo info(viewTransform, transformPtr, effectTransform, exposedRegion, widget, &styleOptionTmp,
@ -4847,7 +4848,7 @@ void QGraphicsScenePrivate::drawSubtreeRecursive(QGraphicsItem *item, QPainter *
painter->setWorldTransform(restoreTransform);
sourced->info = 0;
} else
#endif //QT_NO_GRAPHICSEFFECT
#endif // QT_CONFIG(graphicseffect)
{
draw(item, painter, viewTransform, transformPtr, exposedRegion, widget, opacity,
effectTransform, wasDirtyParentSceneTransform, drawItem);

View File

@ -249,7 +249,7 @@ public:
item->d_ptr->fullUpdatePending = 0;
item->d_ptr->ignoreVisible = 0;
item->d_ptr->ignoreOpacity = 0;
#ifndef QT_NO_GRAPHICSEFFECT
#if QT_CONFIG(graphicseffect)
QGraphicsEffect::ChangeFlags flags;
if (item->d_ptr->notifyBoundingRectChanged) {
flags |= QGraphicsEffect::SourceBoundingRectChanged;
@ -259,15 +259,15 @@ public:
flags |= QGraphicsEffect::SourceInvalidated;
item->d_ptr->notifyInvalidated = 0;
}
#endif //QT_NO_GRAPHICSEFFECT
#endif // QT_CONFIG(graphicseffect)
if (recursive) {
for (int i = 0; i < item->d_ptr->children.size(); ++i)
resetDirtyItem(item->d_ptr->children.at(i), recursive);
}
#ifndef QT_NO_GRAPHICSEFFECT
#if QT_CONFIG(graphicseffect)
if (flags && item->d_ptr->graphicsEffect)
item->d_ptr->graphicsEffect->sourceChanged(flags);
#endif //QT_NO_GRAPHICSEFFECT
#endif // QT_CONFIG(graphicseffect)
}
inline void ensureSortedTopLevelItems()

View File

@ -51,6 +51,7 @@
#include "qhash.h"
#include "qset.h"
#include "qlayout.h"
#include "qpixmapcache.h"
#include "qstyle.h"
#include "qstyleoption.h"
#include "qstylefactory.h"

View File

@ -84,7 +84,9 @@
#include <QtGui/private/qopenglcontext_p.h>
#include <QtGui/qoffscreensurface.h>
#if QT_CONFIG(graphicseffect)
#include <private/qgraphicseffect_p.h>
#endif
#include <qbackingstore.h>
#include <private/qwidgetbackingstore_p.h>
#if 0 // Used to be included in Qt4 for Q_WS_MAC
@ -2115,7 +2117,7 @@ void QWidgetPrivate::setSystemClip(QPaintDevice *paintDevice, const QRegion &reg
paintEngine->d_func()->systemClip = scaleTransform.map(region);
}
#ifndef QT_NO_GRAPHICSEFFECT
#if QT_CONFIG(graphicseffect)
void QWidgetPrivate::invalidateGraphicsEffectsRecursively()
{
Q_Q(QWidget);
@ -2130,7 +2132,7 @@ void QWidgetPrivate::invalidateGraphicsEffectsRecursively()
w = w->parentWidget();
} while (w);
}
#endif //QT_NO_GRAPHICSEFFECT
#endif // QT_CONFIG(graphicseffect)
void QWidgetPrivate::setDirtyOpaqueRegion()
{
@ -2138,9 +2140,9 @@ void QWidgetPrivate::setDirtyOpaqueRegion()
dirtyOpaqueChildren = true;
#ifndef QT_NO_GRAPHICSEFFECT
#if QT_CONFIG(graphicseffect)
invalidateGraphicsEffectsRecursively();
#endif //QT_NO_GRAPHICSEFFECT
#endif // QT_CONFIG(graphicseffect)
if (q->isWindow())
return;
@ -2294,12 +2296,12 @@ void QWidgetPrivate::clipToEffectiveMask(QRegion &region) const
const QWidget *w = q;
QPoint offset;
#ifndef QT_NO_GRAPHICSEFFECT
#if QT_CONFIG(graphicseffect)
if (graphicsEffect) {
w = q->parentWidget();
offset -= data.crect.topLeft();
}
#endif //QT_NO_GRAPHICSEFFECT
#endif // QT_CONFIG(graphicseffect)
while (w) {
const QWidgetPrivate *wd = w->d_func();
@ -2332,13 +2334,13 @@ void QWidgetPrivate::updateIsOpaque()
// hw: todo: only needed if opacity actually changed
setDirtyOpaqueRegion();
#ifndef QT_NO_GRAPHICSEFFECT
#if QT_CONFIG(graphicseffect)
if (graphicsEffect) {
// ### We should probably add QGraphicsEffect::isOpaque at some point.
setOpaque(false);
return;
}
#endif //QT_NO_GRAPHICSEFFECT
#endif // QT_CONFIG(graphicseffect)
Q_Q(QWidget);
#if 0 // Used to be included in Qt4 for Q_WS_X11
@ -5299,13 +5301,13 @@ QPixmap QWidget::grab(const QRect &rectangle)
\sa setGraphicsEffect()
*/
#ifndef QT_NO_GRAPHICSEFFECT
#if QT_CONFIG(graphicseffect)
QGraphicsEffect *QWidget::graphicsEffect() const
{
Q_D(const QWidget);
return d->graphicsEffect;
}
#endif //QT_NO_GRAPHICSEFFECT
#endif // QT_CONFIG(graphicseffect)
/*!
@ -5329,7 +5331,7 @@ QGraphicsEffect *QWidget::graphicsEffect() const
\sa graphicsEffect()
*/
#ifndef QT_NO_GRAPHICSEFFECT
#if QT_CONFIG(graphicseffect)
void QWidget::setGraphicsEffect(QGraphicsEffect *effect)
{
Q_D(QWidget);
@ -5353,7 +5355,7 @@ void QWidget::setGraphicsEffect(QGraphicsEffect *effect)
d->updateIsOpaque();
}
#endif //QT_NO_GRAPHICSEFFECT
#endif // QT_CONFIG(graphicseffect)
bool QWidgetPrivate::isAboutToShow() const
{
@ -5505,7 +5507,7 @@ void QWidgetPrivate::drawWidget(QPaintDevice *pdev, const QRegion &rgn, const QP
bool onScreen = paintOnScreen();
Q_Q(QWidget);
#ifndef QT_NO_GRAPHICSEFFECT
#if QT_CONFIG(graphicseffect)
if (graphicsEffect && graphicsEffect->isEnabled()) {
QGraphicsEffectSource *source = graphicsEffect->d_func()->source;
QWidgetEffectSourcePrivate *sourced = static_cast<QWidgetEffectSourcePrivate *>
@ -5541,7 +5543,7 @@ void QWidgetPrivate::drawWidget(QPaintDevice *pdev, const QRegion &rgn, const QP
return;
}
}
#endif //QT_NO_GRAPHICSEFFECT
#endif // QT_CONFIG(graphicseffect)
const bool alsoOnScreen = flags & DrawPaintOnScreen;
const bool recursive = flags & DrawRecursive;
@ -5848,7 +5850,7 @@ void QWidgetPrivate::paintSiblingsRecursive(QPaintDevice *pdev, const QObjectLis
}
}
#ifndef QT_NO_GRAPHICSEFFECT
#if QT_CONFIG(graphicseffect)
QRectF QWidgetEffectSourcePrivate::boundingRect(Qt::CoordinateSystem system) const
{
if (system != Qt::DeviceCoordinates)
@ -5923,7 +5925,7 @@ QPixmap QWidgetEffectSourcePrivate::pixmap(Qt::CoordinateSystem system, QPoint *
m_widget->render(&pixmap, pixmapOffset, QRegion(), QWidget::DrawChildren);
return pixmap;
}
#endif //QT_NO_GRAPHICSEFFECT
#endif // QT_CONFIG(graphicseffect)
#ifndef QT_NO_GRAPHICSVIEW
/*!

View File

@ -347,10 +347,10 @@ public:
Q_INVOKABLE QPixmap grab(const QRect &rectangle = QRect(QPoint(0, 0), QSize(-1, -1)));
#ifndef QT_NO_GRAPHICSEFFECT
#if QT_CONFIG(graphicseffect)
QGraphicsEffect *graphicsEffect() const;
void setGraphicsEffect(QGraphicsEffect *effect);
#endif //QT_NO_GRAPHICSEFFECT
#endif // QT_CONFIG(graphicseffect)
#ifndef QT_NO_GESTURES
void grabGesture(Qt::GestureType type, Qt::GestureFlags flags = Qt::GestureFlags());

View File

@ -64,7 +64,9 @@
#include "QtWidgets/qsizepolicy.h"
#include "QtWidgets/qstyle.h"
#include "QtWidgets/qapplication.h"
#if QT_CONFIG(graphicseffect)
#include <private/qgraphicseffect_p.h>
#endif
#include "QtWidgets/qgraphicsproxywidget.h"
#include "QtWidgets/qgraphicsscene.h"
#include "QtWidgets/qgraphicsview.h"
@ -418,9 +420,9 @@ public:
void setOpaque(bool opaque);
void updateIsTranslucent();
bool paintOnScreen() const;
#ifndef QT_NO_GRAPHICSEFFECT
#if QT_CONFIG(graphicseffect)
void invalidateGraphicsEffectsRecursively();
#endif //QT_NO_GRAPHICSEFFECT
#endif // QT_CONFIG(graphicseffect)
const QRegion &getOpaqueChildren() const;
void setDirtyOpaqueRegion();
@ -589,10 +591,10 @@ public:
inline QRect effectiveRectFor(const QRect &rect) const
{
#ifndef QT_NO_GRAPHICSEFFECT
#if QT_CONFIG(graphicseffect)
if (graphicsEffect && graphicsEffect->isEnabled())
return graphicsEffect->boundingRectFor(rect).toAlignedRect();
#endif //QT_NO_GRAPHICSEFFECT
#endif // QT_CONFIG(graphicseffect)
return rect;
}
@ -882,7 +884,7 @@ struct QWidgetPaintContext
QPainter *painter;
};
#ifndef QT_NO_GRAPHICSEFFECT
#if QT_CONFIG(graphicseffect)
class QWidgetEffectSourcePrivate : public QGraphicsEffectSourcePrivate
{
public:
@ -935,7 +937,7 @@ public:
QTransform lastEffectTransform;
bool updateDueToGraphicsEffect;
};
#endif //QT_NO_GRAPHICSEFFECT
#endif // QT_CONFIG(graphicseffect)
inline QWExtra *QWidgetPrivate::extraData() const
{

View File

@ -53,7 +53,9 @@
#include <private/qwidget_p.h>
#include <private/qapplication_p.h>
#include <private/qpaintengine_raster_p.h>
#if QT_CONFIG(graphicseffect)
#include <private/qgraphicseffect_p.h>
#endif
#include <QtGui/private/qwindow_p.h>
#include <qpa/qplatformbackingstore.h>
@ -522,9 +524,9 @@ void QWidgetBackingStore::markDirty(const QRegion &rgn, QWidget *widget,
Q_ASSERT(widget->window() == tlw);
Q_ASSERT(!rgn.isEmpty());
#ifndef QT_NO_GRAPHICSEFFECT
#if QT_CONFIG(graphicseffect)
widget->d_func()->invalidateGraphicsEffectsRecursively();
#endif //QT_NO_GRAPHICSEFFECT
#endif // QT_CONFIG(graphicseffect)
if (widget->d_func()->paintOnScreen()) {
if (widget->d_func()->dirty.isEmpty()) {
@ -563,11 +565,11 @@ void QWidgetBackingStore::markDirty(const QRegion &rgn, QWidget *widget,
if (bufferState == BufferInvalid) {
const bool eventAlreadyPosted = !dirty.isEmpty() || updateRequestSent;
#ifndef QT_NO_GRAPHICSEFFECT
#if QT_CONFIG(graphicseffect)
if (widget->d_func()->graphicsEffect)
dirty += widget->d_func()->effectiveRectFor(rgn.boundingRect()).translated(offset);
else
#endif //QT_NO_GRAPHICSEFFECT
#endif // QT_CONFIG(graphicseffect)
dirty += rgn.translated(offset);
if (!eventAlreadyPosted || updateTime == UpdateNow)
sendUpdateRequest(tlw, updateTime);
@ -582,11 +584,11 @@ void QWidgetBackingStore::markDirty(const QRegion &rgn, QWidget *widget,
if (widget->d_func()->inDirtyList) {
if (!qt_region_strictContains(widget->d_func()->dirty, widgetRect)) {
#ifndef QT_NO_GRAPHICSEFFECT
#if QT_CONFIG(graphicseffect)
if (widget->d_func()->graphicsEffect)
widget->d_func()->dirty += widget->d_func()->effectiveRectFor(rgn.boundingRect());
else
#endif //QT_NO_GRAPHICSEFFECT
#endif // QT_CONFIG(graphicseffect)
widget->d_func()->dirty += rgn;
}
} else {
@ -614,9 +616,9 @@ void QWidgetBackingStore::markDirty(const QRect &rect, QWidget *widget,
Q_ASSERT(widget->window() == tlw);
Q_ASSERT(!rect.isEmpty());
#ifndef QT_NO_GRAPHICSEFFECT
#if QT_CONFIG(graphicseffect)
widget->d_func()->invalidateGraphicsEffectsRecursively();
#endif //QT_NO_GRAPHICSEFFECT
#endif // QT_CONFIG(graphicseffect)
if (widget->d_func()->paintOnScreen()) {
if (widget->d_func()->dirty.isEmpty()) {

View File

@ -176,11 +176,11 @@ private:
{
if (widget && !widget->d_func()->inDirtyList && !widget->data->in_destructor) {
QWidgetPrivate *widgetPrivate = widget->d_func();
#ifndef QT_NO_GRAPHICSEFFECT
#if QT_CONFIG(graphicseffect)
if (widgetPrivate->graphicsEffect)
widgetPrivate->dirty = widgetPrivate->effectiveRectFor(rgn.boundingRect());
else
#endif //QT_NO_GRAPHICSEFFECT
#endif // QT_CONFIG(graphicseffect)
widgetPrivate->dirty = rgn;
dirtyWidgets.append(widget);
widgetPrivate->inDirtyList = true;

View File

@ -23,8 +23,10 @@ include(itemviews/itemviews.pri)
include(graphicsview/graphicsview.pri)
include(util/util.pri)
include(statemachine/statemachine.pri)
include(effects/effects.pri)
qtConfig(graphicseffect) {
include(effects/effects.pri)
}
QMAKE_LIBS += $$QMAKE_LIBS_GUI