Commit c626051d authored by Frederik Gladhorn's avatar Frederik Gladhorn Committed by Scott Petrovic

Prepare qobject_cast over dynamic_cast

This is a simple search and replace for KisLayer which is a QObject.
qobject_cast doesn't require RTTI and is faster.
parent d47abbee
......@@ -97,7 +97,7 @@ void KisImageLayerRemoveCommandImpl::Private::restoreClones()
void KisImageLayerRemoveCommandImpl::Private::processClones(KisNodeSP node)
{
KisLayerSP layer(dynamic_cast<KisLayer*>(node.data()));
KisLayerSP layer(qobject_cast<KisLayer*>(node.data()));
if(!layer || !layer->hasClones()) return;
if(reincarnatedNodes.isEmpty()) {
......
......@@ -27,7 +27,7 @@ KisActivateSelectionMaskCommand::KisActivateSelectionMaskCommand(KisSelectionMas
m_value(value)
{
if (m_previousActiveMask != m_selectionMask) {
KisLayerSP parent(dynamic_cast<KisLayer*>(selectionMask->parent().data()));
KisLayerSP parent(qobject_cast<KisLayer*>(selectionMask->parent().data()));
if (parent) {
m_previousActiveMask = parent->selectionMask();
}
......
......@@ -82,7 +82,7 @@ void KisGeneratorLayer::slotDelayedStaticUpdate()
* meanwhile. Just ignore the updates in the case.
*/
KisLayerSP parentLayer(dynamic_cast<KisLayer*>(parent().data()));
KisLayerSP parentLayer(qobject_cast<KisLayer*>(parent().data()));
if (!parentLayer) return;
KisImageSP image = parentLayer->image();
......
......@@ -53,10 +53,10 @@ KisColorSpaceConvertVisitor::~KisColorSpaceConvertVisitor()
bool KisColorSpaceConvertVisitor::visit(KisGroupLayer * layer)
{
convertPaintDevice(layer);
KisLayerSP child = dynamic_cast<KisLayer*>(layer->firstChild().data());
KisLayerSP child = qobject_cast<KisLayer*>(layer->firstChild().data());
while (child) {
child->accept(*this);
child = dynamic_cast<KisLayer*>(child->nextSibling().data());
child = qobject_cast<KisLayer*>(child->nextSibling().data());
}
layer->resetCache();
......
......@@ -206,7 +206,7 @@ KisLayer* KisGroupLayer::onlyMeaningfulChild() const
KisLayer *onlyLayer = 0;
while (child) {
KisLayer *layer = dynamic_cast<KisLayer*>(child);
KisLayer *layer = qobject_cast<KisLayer*>(child);
if (layer) {
if (onlyLayer) return 0;
onlyLayer = layer;
......
......@@ -579,7 +579,7 @@ void KisImage::cropImage(const QRect& newRect)
void KisImage::cropNode(KisNodeSP node, const QRect& newRect)
{
bool isLayer = dynamic_cast<KisLayer*>(node.data());
bool isLayer = qobject_cast<KisLayer*>(node.data());
KUndo2MagicString actionName = isLayer ?
kundo2_i18n("Crop Layer") :
kundo2_i18n("Crop Mask");
......
......@@ -864,7 +864,7 @@ QRect KisLayer::exactBounds() const
KisLayerSP KisLayer::parentLayer() const
{
return dynamic_cast<KisLayer*>(parent().data());
return qobject_cast<KisLayer*>(parent().data());
}
KisMetaData::Store* KisLayer::metaData()
......
......@@ -56,7 +56,7 @@ namespace KisLayerUtils {
void fetchSelectionMasks(KisNodeList mergedNodes, QVector<KisSelectionMaskSP> &selectionMasks)
{
foreach (KisNodeSP node, mergedNodes) {
KisLayerSP layer = dynamic_cast<KisLayer*>(node.data());
KisLayerSP layer = qobject_cast<KisLayer*>(node.data());
KisSelectionMaskSP mask;
......@@ -111,7 +111,7 @@ namespace KisLayerUtils {
}
KisLayerSP dstLayer() override {
return dynamic_cast<KisLayer*>(dstNode.data());
return qobject_cast<KisLayer*>(dstNode.data());
}
};
......@@ -344,7 +344,7 @@ namespace KisLayerUtils {
break;
}
KisLayerSP layer = dynamic_cast<KisLayer*>(node.data());
KisLayerSP layer = qobject_cast<KisLayer*>(node.data());
if (layer && layer->layerStyle()) {
compositionVaries = true;
break;
......@@ -506,7 +506,7 @@ namespace KisLayerUtils {
bool RemoveNodeHelper::scanForLastLayer(KisImageWSP image, KisNodeList nodesToRemove) {
bool removeLayers = false;
Q_FOREACH(KisNodeSP nodeToRemove, nodesToRemove) {
if (dynamic_cast<KisLayer*>(nodeToRemove.data())) {
if (qobject_cast<KisLayer*>(nodeToRemove.data())) {
removeLayers = true;
break;
}
......@@ -517,7 +517,7 @@ namespace KisLayerUtils {
KisNodeSP node = image->root()->firstChild();
while (node) {
if (!nodesToRemove.contains(node) &&
dynamic_cast<KisLayer*>(node.data())) {
qobject_cast<KisLayer*>(node.data())) {
lastLayer = false;
break;
......@@ -744,7 +744,7 @@ namespace KisLayerUtils {
if (!layer->prevSibling()) return;
// XXX: this breaks if we allow free mixing of masks and layers
KisLayerSP prevLayer = dynamic_cast<KisLayer*>(layer->prevSibling().data());
KisLayerSP prevLayer = qobject_cast<KisLayer*>(layer->prevSibling().data());
if (!prevLayer) return;
if (!layer->visible() && !prevLayer->visible()) {
......@@ -878,7 +878,7 @@ namespace KisLayerUtils {
KisNodeList::iterator it = nodes.begin();
while (it != nodes.end()) {
if ((!allowMasks && !dynamic_cast<KisLayer*>(it->data())) ||
if ((!allowMasks && !qobject_cast<KisLayer*>(it->data())) ||
checkIsChildOf(*it, nodes)) {
qDebug() << "Skipping node" << ppVar((*it)->name());
......@@ -1124,7 +1124,7 @@ namespace KisLayerUtils {
KisLayerSP parentLayer;
do {
parentLayer = dynamic_cast<KisLayer*>(parent.data());
parentLayer = qobject_cast<KisLayer*>(parent.data());
parent = parent->parent();
} while(!parentLayer && parent);
......@@ -1180,7 +1180,7 @@ namespace KisLayerUtils {
if (mergedNodes.isEmpty()) return false;
KisLayerSP parentLayer = dynamic_cast<KisLayer*>(selectionMasks.first()->parent().data());
KisLayerSP parentLayer = qobject_cast<KisLayer*>(selectionMasks.first()->parent().data());
KIS_ASSERT_RECOVER(parentLayer) { return 0; }
KisImageSignalVector emitSignals;
......
......@@ -160,7 +160,7 @@ void KisNode::Private::processDuplicatedClones(const KisNode *srcDuplicationRoot
clone->copyFrom());
if (newCopyFrom) {
KisLayer *newCopyFromLayer = dynamic_cast<KisLayer*>(const_cast<KisNode*>(newCopyFrom));
KisLayer *newCopyFromLayer = qobject_cast<KisLayer*>(const_cast<KisNode*>(newCopyFrom));
KIS_ASSERT_RECOVER_RETURN(newCopyFromLayer);
clone->setCopyFrom(newCopyFromLayer);
......
......@@ -97,7 +97,7 @@ private:
prevNode = prevNode->prevSibling();
}
KisLayer *layer = dynamic_cast<KisLayer*>(m_node.data());
KisLayer *layer = qobject_cast<KisLayer*>(m_node.data());
if(layer && layer->hasClones()) {
Q_FOREACH (KisCloneLayerSP clone, layer->registeredClones()) {
if(!clone) continue;
......
......@@ -48,7 +48,7 @@ void KisRecalculateTransformMaskJob::run()
m_mask->recaclulateStaticImage();
KisLayerSP layer = dynamic_cast<KisLayer*>(m_mask->parent().data());
KisLayerSP layer = qobject_cast<KisLayer*>(m_mask->parent().data());
if (!layer) {
warnKrita << "WARNING: KisRecalculateTransformMaskJob::run() Mask has no parent layer! Skipping projection update!";
......
......@@ -150,7 +150,7 @@ bool KisSelectionMask::active() const
void KisSelectionMask::setActive(bool active)
{
KisImageWSP image = this->image();
KisLayerSP parentLayer = dynamic_cast<KisLayer*>(parent().data());
KisLayerSP parentLayer = qobject_cast<KisLayer*>(parent().data());
if (active && parentLayer) {
KisSelectionMaskSP activeMask = parentLayer->selectionMask();
......
......@@ -158,7 +158,7 @@ void KisTransformMask::slotDelayedStaticUpdate()
* meanwhile. Just ignore the updates in the case.
*/
KisLayerSP parentLayer = dynamic_cast<KisLayer*>(parent().data());
KisLayerSP parentLayer = qobject_cast<KisLayer*>(parent().data());
if (!parentLayer) return;
KisImageSP image = parentLayer->image();
......@@ -175,7 +175,7 @@ KisPaintDeviceSP KisTransformMask::buildPreviewDevice()
* is not entirely safe.
*/
KisLayerSP parentLayer = dynamic_cast<KisLayer*>(parent().data());
KisLayerSP parentLayer = qobject_cast<KisLayer*>(parent().data());
KIS_ASSERT_RECOVER(parentLayer) { return new KisPaintDevice(colorSpace()); }
KisPaintDeviceSP device =
......@@ -195,7 +195,7 @@ void KisTransformMask::recaclulateStaticImage()
* is not entirely safe.
*/
KisLayerSP parentLayer = dynamic_cast<KisLayer*>(parent().data());
KisLayerSP parentLayer = qobject_cast<KisLayer*>(parent().data());
KIS_ASSERT_RECOVER_RETURN(parentLayer);
if (!m_d->staticCacheDevice) {
......@@ -386,7 +386,7 @@ QRect KisTransformMask::extent() const
QRect partialChangeRect;
QRect existentProjection;
KisLayerSP parentLayer = dynamic_cast<KisLayer*>(parent().data());
KisLayerSP parentLayer = qobject_cast<KisLayer*>(parent().data());
if (parentLayer) {
partialChangeRect = parentLayer->partialChangeRect(const_cast<KisTransformMask*>(this), rc);
existentProjection = parentLayer->projection()->extent();
......@@ -401,7 +401,7 @@ QRect KisTransformMask::exactBounds() const
QRect partialChangeRect;
QRect existentProjection;
KisLayerSP parentLayer = dynamic_cast<KisLayer*>(parent().data());
KisLayerSP parentLayer = qobject_cast<KisLayer*>(parent().data());
if (parentLayer) {
partialChangeRect = parentLayer->partialChangeRect(const_cast<KisTransformMask*>(this), rc);
existentProjection = parentLayer->projection()->exactBounds();
......
......@@ -130,7 +130,7 @@ KisColorizeMask::KisColorizeMask(const KisColorizeMask& rhs)
void KisColorizeMask::initializeCompositeOp()
{
KisLayerSP parentLayer(dynamic_cast<KisLayer*>(parent().data()));
KisLayerSP parentLayer(qobject_cast<KisLayer*>(parent().data()));
if (!parentLayer || !parentLayer->original()) return;
KisImageSP image = parentLayer->image();
......@@ -258,7 +258,7 @@ void KisColorizeMask::slotUpdateRegenerateFilling()
m_d->originalSequenceNumber = src->sequenceNumber();
m_d->coloringProjection->clear();
KisLayerSP parentLayer(dynamic_cast<KisLayer*>(parent().data()));
KisLayerSP parentLayer(qobject_cast<KisLayer*>(parent().data()));
if (!parentLayer) return;
KisImageSP image = parentLayer->image();
......@@ -491,7 +491,7 @@ QRect KisColorizeMask::nonDependentExtent() const
KisImageSP KisColorizeMask::fetchImage() const
{
KisLayerSP parentLayer(dynamic_cast<KisLayer*>(parent().data()));
KisLayerSP parentLayer(qobject_cast<KisLayer*>(parent().data()));
if (!parentLayer) return KisImageSP();
return parentLayer->image();
......
......@@ -96,7 +96,7 @@ void KisRecordedFilterAction::play(KisNodeSP node, const KisPlayInfo& _info, KoU
{
KisFilterConfigurationSP kfc = d->configuration();
KisPaintDeviceSP dev = node->paintDevice();
KisLayerSP layer = dynamic_cast<KisLayer*>(node.data());
KisLayerSP layer = qobject_cast<KisLayer*>(node.data());
QRect r1 = dev->extent();
KisTransaction transaction(kundo2_i18n("Filter: \"%1\"", d->filter->name()), dev);
......
......@@ -529,7 +529,7 @@ KisLayerSP flattenLayerHelper(ContainerTest &p, KisLayerSP layer, bool nothingHa
QList<QVariant> arguments = spy.takeFirst();
KisNodeSP newNode = arguments.first().value<KisNodeSP>();
KisLayerSP newLayer = dynamic_cast<KisLayer*>(newNode.data());
KisLayerSP newLayer = qobject_cast<KisLayer*>(newNode.data());
return newLayer;
}
......@@ -600,7 +600,7 @@ KisLayerSP mergeHelper(ContainerTest &p, KisLayerSP layer)
//KisLayerUtils::mergeDown(p.image, layer, KisMetaData::MergeStrategyRegistry::instance()->get("Drop"));
p.image->waitForDone();
KisLayerSP newLayer = dynamic_cast<KisLayer*>(parent->at(newIndex).data());
KisLayerSP newLayer = qobject_cast<KisLayer*>(parent->at(newIndex).data());
return newLayer;
}
......
......@@ -92,10 +92,10 @@ bool KisSaveGroupVisitor::visit(KisColorizeMask* ) {
bool KisSaveGroupVisitor::visit(KisGroupLayer *layer)
{
if (layer == m_image->rootLayer()) {
KisLayerSP child = dynamic_cast<KisLayer*>(layer->firstChild().data());
KisLayerSP child = qobject_cast<KisLayer*>(layer->firstChild().data());
while (child) {
child->accept(*this);
child = dynamic_cast<KisLayer*>(child->nextSibling().data());
child = qobject_cast<KisLayer*>(child->nextSibling().data());
}
}
......
......@@ -788,7 +788,7 @@ KisLayerSP KisView::currentLayer() const
else {
node = d->currentNode;
}
return dynamic_cast<KisLayer*>(node.data());
return qobject_cast<KisLayer*>(node.data());
}
KisMaskSP KisView::currentMask() const
......
......@@ -181,7 +181,7 @@ void KisDlgFilter::createMask()
d->filterManager->cancel();
}
KisLayer *layer = dynamic_cast<KisLayer*>(d->node.data());
KisLayer *layer = qobject_cast<KisLayer*>(d->node.data());
KisFilterMaskSP mask = new KisFilterMask();
mask->initSelection(d->view->selection(), layer);
mask->setFilter(d->uiFilterDialog.filterSelection->configuration());
......
......@@ -239,7 +239,7 @@ void KisActionManager::updateGUI()
// if a node exists, we know there is an active layer as well
flags |= KisAction::ACTIVE_NODE;
layer = dynamic_cast<KisLayer*>(node.data());
layer = qobject_cast<KisLayer*>(node.data());
if (layer) {
flags |= KisAction::ACTIVE_LAYER;
}
......
......@@ -351,7 +351,7 @@ void KisLayerManager::convertNodeToPaintLayer(KisNodeSP source)
if (!image) return;
KisLayer *srcLayer = dynamic_cast<KisLayer*>(source.data());
KisLayer *srcLayer = qobject_cast<KisLayer*>(source.data());
if (srcLayer && (srcLayer->inherits("KisGroupLayer") || srcLayer->layerStyle() || srcLayer->childCount() > 0)) {
image->flattenLayer(srcLayer);
return;
......@@ -647,7 +647,7 @@ void KisLayerManager::mergeLayer()
} else if (!tryMergeSelectionMasks(m_view->activeNode(), image)) {
if (!layer->prevSibling()) return;
KisLayer *prevLayer = dynamic_cast<KisLayer*>(layer->prevSibling().data());
KisLayer *prevLayer = qobject_cast<KisLayer*>(layer->prevSibling().data());
if (!prevLayer) return;
if (layer->metaData()->isEmpty() && prevLayer->metaData()->isEmpty()) {
......
......@@ -154,7 +154,7 @@ void KisMaskManager::createMaskCommon(KisMaskSP mask, KisNodeSP activeNode, KisP
KisNodeSP above;
adjustMaskPosition(mask, activeNode, avoidActiveNode, parent, above);
KisLayerSP parentLayer = dynamic_cast<KisLayer*>(parent.data());
KisLayerSP parentLayer = qobject_cast<KisLayer*>(parent.data());
Q_ASSERT(parentLayer);
if (!suppressSelection) {
......@@ -251,7 +251,7 @@ void KisMaskManager::maskProperties()
if (activeMask()->inherits("KisFilterMask")) {
KisFilterMask *mask = static_cast<KisFilterMask*>(activeMask().data());
KisLayerSP layer = dynamic_cast<KisLayer*>(mask->parent().data());
KisLayerSP layer = qobject_cast<KisLayer*>(mask->parent().data());
if (! layer)
return;
......
......@@ -190,7 +190,7 @@ void KisMimeData::initializeExternalNode(KisNodeSP *node,
KisShapeController *shapeController)
{
// layers store a link to the image, so update it
KisLayer *layer = dynamic_cast<KisLayer*>(node->data());
KisLayer *layer = qobject_cast<KisLayer*>(node->data());
if (layer) {
layer->setImage(image);
}
......
......@@ -285,7 +285,7 @@ struct ChannelFlagAdapter : public BaseAdapter {
}
private:
static KisLayerSP toLayer(KisNodeSP node) {
return dynamic_cast<KisLayer*>(node.data());
return qobject_cast<KisLayer*>(node.data());
}
private:
Property m_prop;
......
......@@ -158,7 +158,7 @@ bool KisNodeManager::Private::activateNodeImpl(KisNodeSP node)
selection->setActiveLayer(shapeLayer);
imageView->setCurrentNode(node);
if (KisLayerSP layer = dynamic_cast<KisLayer*>(node.data())) {
if (KisLayerSP layer = qobject_cast<KisLayer*>(node.data())) {
maskManager.activateMask(0);
layerManager.activateLayer(layer);
} else if (KisMaskSP mask = dynamic_cast<KisMask*>(node.data())) {
......@@ -383,7 +383,7 @@ void KisNodeManager::moveNodeAt(KisNodeSP node, KisNodeSP parent, int index)
if (parent->allowAsChild(node)) {
if (node->inherits("KisSelectionMask") && parent->inherits("KisLayer")) {
KisSelectionMask *m = dynamic_cast<KisSelectionMask*>(node.data());
KisLayer *l = dynamic_cast<KisLayer*>(parent.data());
KisLayer *l = qobject_cast<KisLayer*>(parent.data());
KisSelectionMaskSP selMask = l->selectionMask();
if (m && m->active() && l && l->selectionMask())
selMask->setActive(false);
......
......@@ -125,7 +125,7 @@ QByteArray KisPSDLayerStyleCollectionResource::generateMD5() const
void KisPSDLayerStyleCollectionResource::collectAllLayerStyles(KisNodeSP root)
{
KisLayer* layer = dynamic_cast<KisLayer*>(root.data());
KisLayer* layer = qobject_cast<KisLayer*>(root.data());
if (layer && layer->layerStyle()) {
KisPSDLayerStyleSP clone = layer->layerStyle()->clone();
......@@ -143,7 +143,7 @@ void KisPSDLayerStyleCollectionResource::collectAllLayerStyles(KisNodeSP root)
void KisPSDLayerStyleCollectionResource::assignAllLayerStyles(KisNodeSP root)
{
KisLayer* layer = dynamic_cast<KisLayer*>(root.data());
KisLayer* layer = qobject_cast<KisLayer*>(root.data());
if (layer && layer->layerStyle()) {
QUuid uuid = layer->layerStyle()->uuid();
......
......@@ -243,9 +243,9 @@ KisSelectionSP KisResourcesSnapshot::activeSelection() const
KisSelectionSP selection = m_d->image ? m_d->image->globalSelection() : 0;
KisLayerSP layer = dynamic_cast<KisLayer*>(m_d->currentNode.data());
KisLayerSP layer = qobject_cast<KisLayer*>(m_d->currentNode.data());
KisSelectionMaskSP mask;
if((layer = dynamic_cast<KisLayer*>(m_d->currentNode.data()))) {
if((layer = qobject_cast<KisLayer*>(m_d->currentNode.data()))) {
selection = layer->selection();
} else if ((mask = dynamic_cast<KisSelectionMask*>(m_d->currentNode.data())) &&
mask->selection() == selection) {
......
......@@ -82,7 +82,7 @@ namespace KisToolUtils {
{
KisNodeSP foundNode = 0;
while (node) {
KisLayerSP layer = dynamic_cast<KisLayer*>(node.data());
KisLayerSP layer = qobject_cast<KisLayer*>(node.data());
if (!layer || !layer->isEditable()) {
node = node->prevSibling();
......
......@@ -84,7 +84,7 @@ void KisImageFromClipboard::createImage()
KisImageWSP image = doc->image();
if (image && image->root() && image->root()->firstChild()) {
KisLayer * layer = dynamic_cast<KisLayer*>(image->root()->firstChild().data());
KisLayer * layer = qobject_cast<KisLayer*>(image->root()->firstChild().data());
KisPaintDeviceSP clip = KisClipboard::instance()->clip(QRect(), true);
if (clip) {
......
......@@ -117,7 +117,7 @@ KisImageBuilder_Result CSVSaver::encode(QIODevice *io)
while (node) {
if (node->inherits("KisLayer")) {
KisLayer* paintLayer = dynamic_cast<KisLayer*>(node.data());
KisLayer* paintLayer = qobject_cast<KisLayer*>(node.data());
CSVLayerRecord* layerRecord = new CSVLayerRecord();
layers.prepend(layerRecord); //reverse order!
......
......@@ -258,7 +258,7 @@ bool KisKraLoadVisitor::visit(KisCloneLayer *layer)
}
KisNodeSP srcNode = layer->copyFromInfo().findNode(m_image->rootLayer());
KisLayerSP srcLayer = dynamic_cast<KisLayer*>(srcNode.data());
KisLayerSP srcLayer = qobject_cast<KisLayer*>(srcNode.data());
Q_ASSERT(srcLayer);
layer->setCopyFrom(srcLayer);
......@@ -278,7 +278,7 @@ void KisKraLoadVisitor::initSelectionForMask(KisMask *mask)
cloneLayer->accept(*this);
}
KisLayer *parentLayer = dynamic_cast<KisLayer*>(mask->parent().data());
KisLayer *parentLayer = qobject_cast<KisLayer*>(mask->parent().data());
// the KisKraLoader must have already set the parent for us
Q_ASSERT(parentLayer);
mask->initSelection(parentLayer);
......
......@@ -53,7 +53,7 @@ bool checkHomogenity(KisNodeSP root, const KoColorSpace* cs)
break;
}
}
KisLayer *layer = dynamic_cast<KisLayer*>(child.data());
KisLayer *layer = qobject_cast<KisLayer*>(child.data());
if (layer) {
if (layer->colorSpace() != cs) {
res = false;
......
......@@ -369,7 +369,7 @@ KisNodeSP findOnlyTransparencyMask(KisNodeSP node, FlattenedNode::Type type)
return 0;
}
KisLayer *layer = dynamic_cast<KisLayer*>(node.data());
KisLayer *layer = qobject_cast<KisLayer*>(node.data());
QList<KisEffectMaskSP> masks = layer->effectMasks();
if (masks.size() != 1) return 0;
......
......@@ -134,7 +134,7 @@ void KisPSDTest::testOpenLayerStyles()
QSharedPointer<KisDocument> doc = openPsdDocument(sourceFileInfo);
QVERIFY(doc->image());
KisLayerSP layer = dynamic_cast<KisLayer*>(doc->image()->root()->lastChild().data());
KisLayerSP layer = qobject_cast<KisLayer*>(doc->image()->root()->lastChild().data());
QVERIFY(layer->layerStyle());
QVERIFY(layer->layerStyle()->dropShadow());
QVERIFY(layer->layerStyle()->dropShadow()->effectEnabled());
......@@ -149,7 +149,7 @@ void KisPSDTest::testOpenLayerStylesWithPattern()
QSharedPointer<KisDocument> doc = openPsdDocument(sourceFileInfo);
QVERIFY(doc->image());
KisLayerSP layer = dynamic_cast<KisLayer*>(doc->image()->root()->lastChild().data());
KisLayerSP layer = qobject_cast<KisLayer*>(doc->image()->root()->lastChild().data());
QVERIFY(layer->layerStyle());
QVERIFY(layer->layerStyle()->patternOverlay());
QVERIFY(layer->layerStyle()->patternOverlay()->effectEnabled());
......@@ -166,7 +166,7 @@ void KisPSDTest::testOpenLayerStylesWithPatternMulti()
QSharedPointer<KisDocument> doc = openPsdDocument(sourceFileInfo);
QVERIFY(doc->image());
KisLayerSP layer = dynamic_cast<KisLayer*>(doc->image()->root()->lastChild().data());
KisLayerSP layer = qobject_cast<KisLayer*>(doc->image()->root()->lastChild().data());
QVERIFY(layer->layerStyle());
QVERIFY(layer->layerStyle()->patternOverlay());
......@@ -189,7 +189,7 @@ void KisPSDTest::testSaveLayerStylesWithPatternMulti()
QSharedPointer<KisDocument> doc = openPsdDocument(sourceFileInfo);
QVERIFY(doc->image());
KisLayerSP layer = dynamic_cast<KisLayer*>(doc->image()->root()->lastChild().data());
KisLayerSP layer = qobject_cast<KisLayer*>(doc->image()->root()->lastChild().data());
QVERIFY(layer->layerStyle());
QVERIFY(layer->layerStyle()->patternOverlay());
......@@ -216,7 +216,7 @@ void KisPSDTest::testSaveLayerStylesWithPatternMulti()
QImage result = doc->image()->projection()->convertToQImage(0, doc->image()->bounds());
//QVERIFY(TestUtil::checkQImageExternal(result, "psd_test", "transparency_masks", "kiki_single"));
KisLayerSP layer = dynamic_cast<KisLayer*>(doc->image()->root()->lastChild().data());
KisLayerSP layer = qobject_cast<KisLayer*>(doc->image()->root()->lastChild().data());
QVERIFY(layer->layerStyle());
QVERIFY(layer->layerStyle()->patternOverlay());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment