diff options
Diffstat (limited to 'src/quick/items/qquickgenericshadereffect.cpp')
-rw-r--r-- | src/quick/items/qquickgenericshadereffect.cpp | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/src/quick/items/qquickgenericshadereffect.cpp b/src/quick/items/qquickgenericshadereffect.cpp index 1d71555849..df61ee853d 100644 --- a/src/quick/items/qquickgenericshadereffect.cpp +++ b/src/quick/items/qquickgenericshadereffect.cpp @@ -40,10 +40,27 @@ #include <private/qquickgenericshadereffect_p.h> #include <private/qquickwindow_p.h> #include <private/qquickitem_p.h> -#include <QSignalMapper> QT_BEGIN_NAMESPACE +namespace { +class IntSignalMapper : public QObject +{ + Q_OBJECT + + int value; +public: + explicit IntSignalMapper(int v) + : QObject(nullptr), value(v) {} + +public Q_SLOTS: + void map() { emit mapped(value); } + +Q_SIGNALS: + void mapped(int); +}; +} // unnamed namespace + // The generic shader effect is used whenever on the RHI code path, or when the // scenegraph backend indicates SupportsShaderEffectNode. This, unlike the // monolithic and interconnected (e.g. with particles) OpenGL variant, passes @@ -547,15 +564,10 @@ void QQuickGenericShaderEffect::updateShaderVars(Shader shaderType) if (!mp.hasNotifySignal()) qWarning("ShaderEffect: property '%s' does not have notification method", v.name.constData()); - // Have a QSignalMapper that emits mapped() with an index+type on each property change notify signal. + // Have a IntSignalMapper that emits mapped() with an index+type on each property change notify signal. auto &sm(m_signalMappers[shaderType][i]); - if (!sm.mapper) { -QT_WARNING_PUSH -QT_WARNING_DISABLE_DEPRECATED - sm.mapper = new QSignalMapper; -QT_WARNING_POP - sm.mapper->setMapping(m_item, i | (shaderType << 16)); - } + if (!sm.mapper) + sm.mapper = new IntSignalMapper(i | (shaderType << 16)); sm.active = true; const QByteArray signalName = '2' + mp.notifySignal().methodSignature(); QObject::connect(m_item, signalName, sm.mapper, SLOT(map())); @@ -665,3 +677,4 @@ void QQuickGenericShaderEffect::markGeometryDirtyAndUpdateIfSupportsAtlas() QT_END_NAMESPACE #include "moc_qquickgenericshadereffect_p.cpp" +#include "qquickgenericshadereffect.moc" |