This is a simple search and replace for KisLayer which is a QObject. qobject_cast doesn't require RTTI and is faster.