v2.0.0
Loading...
Searching...
No Matches
abstracttreeitem.cpp
Go to the documentation of this file.
1//=============================================================================================================
35
36//=============================================================================================================
37// INCLUDES
38//=============================================================================================================
39
40#include "abstracttreeitem.h"
41
43 : QStandardItem(text)
44 , m_type(type)
45{
46 // Set default values
47 setData(true, VisibleRole); // Visible by default
48 setData(QMatrix4x4(), TransformRole); // Identity
49 setData(QColor(Qt::white), ColorRole);
50 setData(1.0f, AlphaRole);
51}
52
54{
55 return QStandardItem::UserType + m_type;
56}
57
59{
60 setData(visible, VisibleRole);
61}
62
64{
65 return data(VisibleRole).toBool();
66}
67
69{
70 setData(transform, TransformRole);
71}
72
74{
75 return data(TransformRole).value<QMatrix4x4>();
76}
77
79{
80 setData(color, ColorRole);
81}
82
84{
85 return data(ColorRole).value<QColor>();
86}
87
89{
90 setData(alpha, AlphaRole);
91}
92
94{
95 return data(AlphaRole).toFloat();
96}
AbstractTreeItem class declaration.
void setTransform(const QMatrix4x4 &transform)
QColor color() const
AbstractTreeItem(const QString &text="", int type=AbstractItem)
void setAlpha(float alpha)
void setColor(const QColor &color)
QMatrix4x4 transform() const
void setVisible(bool visible)
int type() const override