> dst = (KisPaintLayer*)img->activeLayer().data(); weee another java developer :) In that case, the activeLayer is forced to be a KisPaintLayer by the flatten operation, but the best C++ solution is : dst = dynamic_cast<KisPaintLayer*>(img->activeLayer().data()); and if dst == 0 then throw an error message. -- --- Cyrille Berger ---