summaryrefslogtreecommitdiffstats
path: root/chalk/ui/kis_layerbox.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chalk/ui/kis_layerbox.cc')
-rw-r--r--chalk/ui/kis_layerbox.cc88
1 files changed, 44 insertions, 44 deletions
diff --git a/chalk/ui/kis_layerbox.cc b/chalk/ui/kis_layerbox.cc
index cfdc6acd..424c405d 100644
--- a/chalk/ui/kis_layerbox.cc
+++ b/chalk/ui/kis_layerbox.cc
@@ -61,8 +61,8 @@
#include "kis_layerbox.h"
-KisLayerBox::KisLayerBox(KisCanvasSubject *subject, TQWidget *tqparent, const char *name)
- : super(tqparent, name), m_image(0)
+KisLayerBox::KisLayerBox(KisCanvasSubject *subject, TQWidget *parent, const char *name)
+ : super(parent, name), m_image(0)
{
TQVBoxLayout *vbox = new TQVBoxLayout(this);
vbox->setAutoAdd(true);
@@ -200,7 +200,7 @@ void KisLayerBox::slotLayerAdded(KisLayerSP layer)
vKisLayerSP layersAdded;
- if (layer->tqparent() == m_image->rootLayer())
+ if (layer->parent() == m_image->rootLayer())
{
KisPopulateVisitor visitor(list());
layer->accept(visitor);
@@ -208,7 +208,7 @@ void KisLayerBox::slotLayerAdded(KisLayerSP layer)
}
else
{
- KisPopulateVisitor visitor(static_cast<KisLayerItem*>(list()->layer(layer->tqparent()->id())));
+ KisPopulateVisitor visitor(static_cast<KisLayerItem*>(list()->layer(layer->parent()->id())));
layer->accept(visitor);
layersAdded = visitor.layersAdded();
}
@@ -229,8 +229,8 @@ void KisLayerBox::slotLayerRemoved(KisLayerSP layer, KisGroupLayerSP wasParent,
void KisLayerBox::slotLayerMoved(KisLayerSP layer, KisGroupLayerSP wasParent, KisLayerSP)
{
- int parentID = layer->tqparent()->id();
- if (layer->tqparent() == m_image->rootLayer())
+ int parentID = layer->parent()->id();
+ if (layer->parent() == m_image->rootLayer())
parentID = -1;
int siblingID = -1;
@@ -239,7 +239,7 @@ void KisLayerBox::slotLayerMoved(KisLayerSP layer, KisGroupLayerSP wasParent, Ki
list()->moveLayer(layer->id(), parentID, siblingID);
- markModified(layer->tqparent());
+ markModified(layer->parent());
markModified(wasParent);
updateUI();
}
@@ -302,16 +302,16 @@ void KisLayerBox::slotLayerPropertyChanged(LayerItem* item, const TQString& name
void KisLayerBox::slotLayerMoved(LayerItem* item, LayerItem*, LayerItem*)
{
KisLayerSP layer = m_image->findLayer(item->id());
- KisGroupLayerSP tqparent;
- if( item->tqparent() )
- tqparent = dynamic_cast<KisGroupLayer*>(m_image->findLayer(item->tqparent()->id()).data());
- if( !tqparent )
- tqparent = m_image->rootLayer();
+ KisGroupLayerSP parent;
+ if( item->parent() )
+ parent = dynamic_cast<KisGroupLayer*>(m_image->findLayer(item->parent()->id()).data());
+ if( !parent )
+ parent = m_image->rootLayer();
KisLayerSP above = 0;
if (item->nextSibling())
above = m_image->findLayer(item->nextSibling()->id());
if (layer)
- m_image->moveLayer(layer, tqparent.data(), above);
+ m_image->moveLayer(layer, parent.data(), above);
updateUI();
}
@@ -320,7 +320,7 @@ void KisLayerBox::slotRequestNewLayer(LayerItem* p, LayerItem* after)
KisLayer* l = m_image->rootLayer().data();
if (p)
l = m_image->findLayer(p->id()).data();
- KisGroupLayerSP tqparent = dynamic_cast<KisGroupLayer*>(l);
+ KisGroupLayerSP parent = dynamic_cast<KisGroupLayer*>(l);
KisLayerSP above = 0;
if (after && after->nextSibling())
@@ -328,10 +328,10 @@ void KisLayerBox::slotRequestNewLayer(LayerItem* p, LayerItem* after)
else if (after)
above = 0;
else if (p && p->firstChild())
- above = tqparent->firstChild();
+ above = parent->firstChild();
else if (!p && m_image->rootLayer()->childCount())
above = m_image->rootLayer()->firstChild();
- emit sigRequestLayer(tqparent, above);
+ emit sigRequestLayer(parent, above);
}
void KisLayerBox::slotRequestNewFolder(LayerItem* p, LayerItem* after)
@@ -339,7 +339,7 @@ void KisLayerBox::slotRequestNewFolder(LayerItem* p, LayerItem* after)
KisLayer* l = m_image->rootLayer().data(); //FIXME I hate copy-pasting like this.
if (p)
l = m_image->findLayer(p->id()).data();
- KisGroupLayerSP tqparent = dynamic_cast<KisGroupLayer*>(l);
+ KisGroupLayerSP parent = dynamic_cast<KisGroupLayer*>(l);
KisLayerSP above = 0;
if (after && after->nextSibling())
@@ -347,10 +347,10 @@ void KisLayerBox::slotRequestNewFolder(LayerItem* p, LayerItem* after)
else if (after)
above = 0;
else if (p && p->firstChild())
- above = tqparent->firstChild();
+ above = parent->firstChild();
else if (!p && m_image->rootLayer()->childCount())
above = m_image->rootLayer()->firstChild();
- emit sigRequestGroupLayer(tqparent, above);
+ emit sigRequestGroupLayer(parent, above);
}
void KisLayerBox::slotRequestNewAdjustmentLayer(LayerItem* p, LayerItem* after)
@@ -358,7 +358,7 @@ void KisLayerBox::slotRequestNewAdjustmentLayer(LayerItem* p, LayerItem* after)
KisLayer* l = m_image->rootLayer().data(); //FIXME here too.
if (p)
l = m_image->findLayer(p->id()).data();
- KisGroupLayerSP tqparent = dynamic_cast<KisGroupLayer*>(l);
+ KisGroupLayerSP parent = dynamic_cast<KisGroupLayer*>(l);
KisLayerSP above = 0;
if (after && after->nextSibling())
@@ -366,10 +366,10 @@ void KisLayerBox::slotRequestNewAdjustmentLayer(LayerItem* p, LayerItem* after)
else if (after)
above = 0;
else if (p && p->firstChild())
- above = tqparent->firstChild();
+ above = parent->firstChild();
else if (!p && m_image->rootLayer()->childCount())
above = m_image->rootLayer()->firstChild();
- emit sigRequestAdjustmentLayer(tqparent, above);
+ emit sigRequestAdjustmentLayer(parent, above);
}
void KisLayerBox::slotRequestNewObjectLayer(LayerItem* p, LayerItem* after, const KoDocumentEntry& entry)
@@ -377,7 +377,7 @@ void KisLayerBox::slotRequestNewObjectLayer(LayerItem* p, LayerItem* after, cons
KisLayer* l = m_image->rootLayer().data(); //FIXME and here.
if (p)
l = m_image->findLayer(p->id()).data();
- KisGroupLayerSP tqparent = dynamic_cast<KisGroupLayer*>(l);
+ KisGroupLayerSP parent = dynamic_cast<KisGroupLayer*>(l);
KisLayerSP above = 0;
if (after && after->nextSibling())
@@ -385,10 +385,10 @@ void KisLayerBox::slotRequestNewObjectLayer(LayerItem* p, LayerItem* after, cons
else if (after)
above = 0;
else if (p && p->firstChild())
- above = tqparent->firstChild();
+ above = parent->firstChild();
else if (!p && m_image->rootLayer()->childCount())
above = m_image->rootLayer()->firstChild();
- emit sigRequestPartLayer(tqparent, above, entry);
+ emit sigRequestPartLayer(parent, above, entry);
}
void KisLayerBox::slotRequestRemoveLayer(LayerItem* item)
@@ -410,7 +410,7 @@ void KisLayerBox::slotRequestLayerProperties(LayerItem* item)
void KisLayerBox::updateUI()
{
m_lst->bnDelete->setEnabled(list()->activeLayer());
- m_lst->bnRaise->setEnabled(list()->activeLayer() && (list()->activeLayer()->prevSibling() || list()->activeLayer()->tqparent()));
+ m_lst->bnRaise->setEnabled(list()->activeLayer() && (list()->activeLayer()->prevSibling() || list()->activeLayer()->parent()));
m_lst->bnLower->setEnabled(list()->activeLayer() && list()->activeLayer()->nextSibling());
m_lst->intOpacity->setEnabled(list()->activeLayer());
m_lst->cmbComposite->setEnabled(list()->activeLayer());
@@ -464,35 +464,35 @@ void KisLayerBox::slotAddMenuActivated(int type)
return;
KisGroupLayerSP root = m_image->rootLayer();
- KisGroupLayerSP tqparent;
+ KisGroupLayerSP parent;
KisLayerSP above;
if (KisLayerSP active = m_image->activeLayer())
{
- tqparent = root;
+ parent = root;
above = active;
- if (active->tqparent())
- tqparent = active->tqparent();
+ if (active->parent())
+ parent = active->parent();
}
else
{
- tqparent = root;
+ parent = root;
above = m_image->rootLayer()->firstChild();
}
switch (type)
{
case PAINT_LAYER:
- emit sigRequestLayer(tqparent, above);
+ emit sigRequestLayer(parent, above);
break;
case GROUP_LAYER:
- emit sigRequestGroupLayer(tqparent, above);
+ emit sigRequestGroupLayer(parent, above);
break;
case ADJUSTMENT_LAYER:
- emit sigRequestAdjustmentLayer(tqparent, above);
+ emit sigRequestAdjustmentLayer(parent, above);
break;
case OBJECT_LAYER:
default: //goddamned TQt doesn't emit activated for default-assigned IDs, so this does nothing
- emit sigRequestPartLayer(tqparent, above, m_partLayerAction->documentEntry());
+ emit sigRequestPartLayer(parent, above, m_partLayerAction->documentEntry());
}
}
@@ -522,17 +522,17 @@ void KisLayerBox::slotRaiseClicked()
}
KisLayerSP layer = m_image->findLayer(l.first());
- if( l.count() == 1 && layer == layer->tqparent()->firstChild() && layer->tqparent() != m_image->rootLayer())
+ if( l.count() == 1 && layer == layer->parent()->firstChild() && layer->parent() != m_image->rootLayer())
{
- if (KisGroupLayerSP grandtqparent = layer->tqparent()->tqparent())
- m_image->moveLayer(layer, grandtqparent, layer->tqparent().data());
+ if (KisGroupLayerSP grandparent = layer->parent()->parent())
+ m_image->moveLayer(layer, grandparent, layer->parent().data());
}
else
{
for (int i = 0, n = l.count(); i < n; ++i)
if (KisLayerSP li = m_image->findLayer(l[i]))
if (li->prevSibling())
- m_image->moveLayer(li, li->tqparent(), li->prevSibling());
+ m_image->moveLayer(li, li->parent(), li->prevSibling());
}
if( !l.isEmpty() )
@@ -551,7 +551,7 @@ void KisLayerBox::slotLowerClicked()
for (int i = l.count() - 1; i >= 0; --i)
if (LayerItem *layer = l[i])
if (layer->nextSibling())
- list()->moveLayer(layer, layer->tqparent(), layer->nextSibling());
+ list()->moveLayer(layer, layer->parent(), layer->nextSibling());
if( !l.isEmpty() )
list()->ensureItemVisible( l.last() );
@@ -609,7 +609,7 @@ void KisLayerBox::markModified(KisLayer* layer)
while (layer && layer != m_image->rootLayer().data())
{
v.append(layer->id());
- layer = layer->tqparent();
+ layer = layer->parent();
}
for (int i = v.count() - 1; i >= 0; --i)
if (!m_modified.contains(v[i]))
@@ -636,7 +636,7 @@ void KisLayerBox::printChalkLayers() const
root = layer;
printChalkLayers();
indent -= 2;
- root = layer->tqparent();
+ root = layer->parent();
}
}
@@ -652,7 +652,7 @@ void KisLayerBox::printLayerboxLayers() const
root = layer;
printLayerboxLayers();
indent -= 2;
- root = layer->tqparent();
+ root = layer->parent();
}
return;
}
@@ -668,7 +668,7 @@ void KisLayerBox::printLayerboxLayers() const
root = layer;
printLayerboxLayers();
indent -= 2;
- root = layer->tqparent();
+ root = layer->parent();
}
}