forked from qt-creator/qt-creator
Connect CurveEditor edits to the timeline module
Change-Id: Ic00e0840da34bdbb8627b2fe2d8546a867b24966 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
@@ -44,6 +44,7 @@ TreeItem::~TreeItem()
|
||||
m_parent = nullptr;
|
||||
|
||||
qDeleteAll(m_children);
|
||||
m_children.clear();
|
||||
}
|
||||
|
||||
QIcon TreeItem::icon() const
|
||||
@@ -66,6 +67,16 @@ unsigned int TreeItem::id() const
|
||||
return m_id;
|
||||
}
|
||||
|
||||
QString TreeItem::name() const
|
||||
{
|
||||
return m_name;
|
||||
}
|
||||
|
||||
bool TreeItem::hasChildren() const
|
||||
{
|
||||
return !m_children.empty();
|
||||
}
|
||||
|
||||
bool TreeItem::locked() const
|
||||
{
|
||||
return m_locked;
|
||||
@@ -185,7 +196,6 @@ void TreeItem::setPinned(bool pinned)
|
||||
m_pinned = pinned;
|
||||
}
|
||||
|
||||
|
||||
NodeTreeItem::NodeTreeItem(const QString &name, const QIcon &icon)
|
||||
: TreeItem(name)
|
||||
, m_icon(icon)
|
||||
@@ -203,9 +213,12 @@ QIcon NodeTreeItem::icon() const
|
||||
return m_icon;
|
||||
}
|
||||
|
||||
|
||||
PropertyTreeItem::PropertyTreeItem(const QString &name, const AnimationCurve &curve)
|
||||
PropertyTreeItem::PropertyTreeItem(const QString &name,
|
||||
const AnimationCurve &curve,
|
||||
const ValueType &type)
|
||||
: TreeItem(name)
|
||||
, m_type(type)
|
||||
, m_component(Component::Generic)
|
||||
, m_curve(curve)
|
||||
{}
|
||||
|
||||
@@ -214,6 +227,27 @@ PropertyTreeItem *PropertyTreeItem::asPropertyItem()
|
||||
return this;
|
||||
}
|
||||
|
||||
const NodeTreeItem *PropertyTreeItem::parentNodeTreeItem() const
|
||||
{
|
||||
TreeItem *p = parent();
|
||||
while (p) {
|
||||
if (NodeTreeItem *ni = p->asNodeItem())
|
||||
return ni;
|
||||
p = p->parent();
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
ValueType PropertyTreeItem::valueType() const
|
||||
{
|
||||
return m_type;
|
||||
}
|
||||
|
||||
PropertyTreeItem::Component PropertyTreeItem::component() const
|
||||
{
|
||||
return m_component;
|
||||
}
|
||||
|
||||
AnimationCurve PropertyTreeItem::curve() const
|
||||
{
|
||||
return m_curve;
|
||||
@@ -224,4 +258,9 @@ void PropertyTreeItem::setCurve(const AnimationCurve &curve)
|
||||
m_curve = curve;
|
||||
}
|
||||
|
||||
void PropertyTreeItem::setComponent(const Component &comp)
|
||||
{
|
||||
m_component = comp;
|
||||
}
|
||||
|
||||
} // End namespace DesignTools.
|
||||
|
||||
Reference in New Issue
Block a user