Gui::PropertyEditor::PropertyItem Class Reference

#include <PropertyItem.h>

Public Member Functions

void appendChild (PropertyItem *child)
 
virtual void assignProperty (const App::Property *)
 
virtual void bind (const App::ObjectIdentifier &_path)
 
virtual void bind (const App::Property &prop)
 override the bind functions to ensure we issue the propertyBound() call, which is then overloaded by childs which like to be informed of a binding More...
 
PropertyItem * child (int row)
 
int childCount () const
 
int columnCount () const
 
virtual QWidget * createEditor (QWidget *parent, const QObject *receiver, const char *method) const
 Creates the appropriate editor for this item and sets the editor to the value of overrideValue(). More...
 
QWidget * createExpressionEditor (QWidget *parent, const QObject *receiver, const char *method) const
 
PropertyEditorWidget * createPropertyEditorWidget (QWidget *parent) const
 
virtual QVariant data (int column, int role) const
 
int decimals () const
 
virtual QVariant editorData (QWidget *editor) const
 
QString expressionAsString () const
 
QVariant expressionEditorData (QWidget *editor) const
 
Qt::ItemFlags flags (int column) const
 
App::Property * getFirstProperty ()
 
const App::Property * getFirstProperty () const
 
const std::vector< App::Property * > & getPropertyData () const
 
bool hasAnyExpression () const
 
bool hasProperty (const App::Property *) const
 
void insertChild (int, PropertyItem *child)
 
bool isExpanded () const
 
bool isLinked () const
 
bool isReadOnly () const
 
virtual bool isSeparator () const
 
void moveChild (int from, int to)
 
PropertyItem * parent () const
 
virtual void propertyBound ()
 
QString propertyName () const
 
void removeChildren (int from, int to)
 PropertyItem::removeChildren Deletes the children in the range of [from, to]. More...
 
bool removeProperty (const App::Property *)
 
void reset ()
 
virtual int row () const
 
bool setData (const QVariant &value)
 
void setDecimals (int)
 
virtual void setEditorData (QWidget *editor, const QVariant &data) const
 
void setExpanded (bool e)
 
void setExpressionEditorData (QWidget *editor, const QVariant &data) const
 
void setLinked (bool)
 
void setParent (PropertyItem *parent)
 
void setPropertyData (const std::vector< App::Property * > &)
 Sets the current property objects. More...
 
void setPropertyName (QString name, QString realName=QString())
 
void setPropertyValue (const QString &)
 
void setReadOnly (bool)
 
PropertyItem * takeChild (int)
 PropertyItem::takeChild Removes the child at index row but doesn't delete it. More...
 
bool testStatus (App::Property::Status pos) const
 
void updateData ()
 
 ~PropertyItem ()
 
- Public Member Functions inherited from Gui::ExpressionBinding
virtual bool apply ()
 
virtual bool apply (const std::string &propName)
 
bool autoApply () const
 
virtual void bind (const App::ObjectIdentifier &_path)
 
virtual void bind (const App::Property &prop)
 
 ExpressionBinding ()
 
QPixmap getIcon (const char *name, const QSize &size) const
 
bool hasExpression () const
 
bool isBound () const
 
void setAutoApply (bool value)
 
void unbind ()
 
virtual ~ExpressionBinding ()
 

Protected Member Functions

virtual QVariant decoration (const QVariant &) const
 
virtual QVariant displayName () const
 
virtual void initialize ()
 
virtual void onChange ()
 
 PropertyItem ()
 
virtual void setValue (const QVariant &)
 
virtual QVariant toolTip (const App::Property *) const
 
virtual QVariant toString (const QVariant &) const
 
virtual QVariant value (const App::Property *) const
 
- Protected Member Functions inherited from Gui::ExpressionBinding
void expressionChange (const App::ObjectIdentifier &id)
 
std::string getEscapedExpressionString () const
 
std::shared_ptr< App::Expression > getExpression () const
 
std::string getExpressionString (bool no_throw=true) const
 
const App::ObjectIdentifier & getPath () const
 
void makeLabel (QLineEdit *parent)
 
void objectDeleted (const App::DocumentObject &)
 
virtual void onChange ()
 
virtual void setExpression (std::shared_ptr< App::Expression > expr)
 

Protected Attributes

QList< PropertyItem * > childItems
 
QString displayText
 
bool expanded
 
bool linked
 
PropertyItem * parentItem
 
int precision
 
std::vector< App::Property * > propertyItems
 
QString propName
 
bool readonly
 
- Protected Attributes inherited from Gui::ExpressionBinding
QPalette defaultPalette
 
boost::signals2::scoped_connection expressionchanged
 
int iconHeight
 
ExpressionLabel * iconLabel
 
bool m_autoApply
 
boost::signals2::scoped_connection objectdeleted
 

Friends

class PropertyItemAttorney
 

Constructor & Destructor Documentation

◆ ~PropertyItem()

PropertyItem::~PropertyItem ( )

References childItems.

◆ PropertyItem()

PropertyItem::PropertyItem ( )
protected

Member Function Documentation

◆ appendChild()

void PropertyItem::appendChild ( PropertyItem *  child)

◆ assignProperty()

void PropertyItem::assignProperty ( const App::Property *  )
virtual

◆ bind() [1/2]

void PropertyItem::bind ( const App::ObjectIdentifier &  _path)
virtual

◆ bind() [2/2]

void PropertyItem::bind ( const App::Property &  prop)
virtual

override the bind functions to ensure we issue the propertyBound() call, which is then overloaded by childs which like to be informed of a binding

Reimplemented from Gui::ExpressionBinding.

References Gui::ExpressionBinding::bind(), and propertyBound().

Referenced by SketcherGui::PropertyConstraintListItem::initialize(), Gui::PropertyEditor::PropertyVectorItem::propertyBound(), Gui::PropertyEditor::PropertyEnumItem::propertyBound(), and setPropertyData().

◆ child()

◆ childCount()

◆ columnCount()

int PropertyItem::columnCount ( ) const

◆ createEditor()

QWidget * PropertyItem::createEditor ( QWidget *  parent,
const QObject *  receiver,
const char *  method 
) const
virtual

Creates the appropriate editor for this item and sets the editor to the value of overrideValue().

Reimplemented in PartGui::PropertyEnumAttacherItem.

Referenced by Gui::PropertyEditor::PropertyItemDelegate::createEditor().

◆ createExpressionEditor()

◆ createPropertyEditorWidget()

◆ data()

QVariant PropertyItem::data ( int  column,
int  role 
) const
virtual

◆ decimals()

◆ decoration()

QVariant PropertyItem::decoration ( const QVariant &  ) const
protectedvirtual

◆ displayName()

QVariant PropertyItem::displayName ( ) const
protectedvirtual

References displayText.

Referenced by data().

◆ editorData()

QVariant PropertyItem::editorData ( QWidget *  editor) const
virtual

◆ expressionAsString()

◆ expressionEditorData()

QVariant PropertyItem::expressionEditorData ( QWidget *  editor) const

◆ flags()

Qt::ItemFlags PropertyItem::flags ( int  column) const

◆ getFirstProperty() [1/2]

◆ getFirstProperty() [2/2]

const App::Property * PropertyItem::getFirstProperty ( ) const

References propertyItems.

◆ getPropertyData()

◆ hasAnyExpression()

bool PropertyItem::hasAnyExpression ( ) const

◆ hasProperty()

bool PropertyItem::hasProperty ( const App::Property *  prop) const

◆ initialize()

void PropertyItem::initialize ( )
protectedvirtual

◆ insertChild()

void PropertyItem::insertChild ( int  index,
PropertyItem *  child 
)

References child(), and childItems.

◆ isExpanded()

◆ isLinked()

bool PropertyItem::isLinked ( ) const

References linked.

◆ isReadOnly()

◆ isSeparator()

◆ moveChild()

void PropertyItem::moveChild ( int  from,
int  to 
)

References childItems.

◆ onChange()

void PropertyItem::onChange ( )
protectedvirtual

◆ parent()

◆ propertyBound()

virtual void Gui::PropertyEditor::PropertyItem::propertyBound ( )
virtual

◆ propertyName()

◆ removeChildren()

void PropertyItem::removeChildren ( int  from,
int  to 
)

PropertyItem::removeChildren Deletes the children in the range of [from, to].

References child(), and childItems.

Referenced by Gui::PropertyEditor::PropertyModel::removeRows().

◆ removeProperty()

bool PropertyItem::removeProperty ( const App::Property *  prop)

◆ reset()

void PropertyItem::reset ( )

◆ row()

◆ setData()

◆ setDecimals()

void PropertyItem::setDecimals ( int  prec)

◆ setEditorData()

void PropertyItem::setEditorData ( QWidget *  editor,
const QVariant &  data 
) const
virtual

◆ setExpanded()

◆ setExpressionEditorData()

void PropertyItem::setExpressionEditorData ( QWidget *  editor,
const QVariant &  data 
) const

◆ setLinked()

void PropertyItem::setLinked ( bool  l)

◆ setParent()

◆ setPropertyData()

void PropertyItem::setPropertyData ( const std::vector< App::Property * > &  items)

◆ setPropertyName()

void PropertyItem::setPropertyName ( QString  name,
QString  realName = QString() 
)

◆ setPropertyValue()

void PropertyItem::setPropertyValue ( const QString &  value)

References Gui::Command::App, Base::Console(), Base::ConsoleSingleton::Error(), Base::Persistence::getClassTypeId(), isReadOnly(), parent(), propertyItems, and App::Property::ReadOnly.

Referenced by Gui::PropertyEditor::PropertyStringItem::setValue(), Gui::PropertyEditor::PropertyFontItem::setValue(), Gui::PropertyEditor::PropertyIntegerItem::setValue(), Gui::PropertyEditor::PropertyIntegerConstraintItem::setValue(), Gui::PropertyEditor::PropertyFloatItem::setValue(), Gui::PropertyEditor::PropertyUnitItem::setValue(), Gui::PropertyEditor::PropertyFloatConstraintItem::setValue(), Gui::PropertyEditor::PropertyBoolItem::setValue(), Gui::PropertyEditor::PropertyVectorItem::setValue(), Gui::PropertyEditor::PropertyVectorListItem::setValue(), Gui::PropertyEditor::PropertyVectorDistanceItem::setValue(), Gui::PropertyEditor::PropertyMatrixItem::setValue(), Gui::PropertyEditor::PropertyRotationItem::setValue(), Gui::PropertyEditor::PropertyPlacementItem::setValue(), Gui::PropertyEditor::PropertyEnumItem::setValue(), Gui::PropertyEditor::PropertyStringListItem::setValue(), Gui::PropertyEditor::PropertyFloatListItem::setValue(), Gui::PropertyEditor::PropertyIntegerListItem::setValue(), Gui::PropertyEditor::PropertyColorItem::setValue(), Gui::PropertyEditor::PropertyMaterialItem::setValue(), Gui::PropertyEditor::PropertyMaterialListItem::setValue(), Gui::PropertyEditor::PropertyFileItem::setValue(), Gui::PropertyEditor::PropertyPathItem::setValue(), Gui::PropertyEditor::PropertyTransientFileItem::setValue(), and Gui::PropertyEditor::PropertyLinkItem::setValue().

◆ setReadOnly()

void PropertyItem::setReadOnly ( bool  ro)

◆ setValue()

◆ takeChild()

PropertyItem * PropertyItem::takeChild ( int  row)

PropertyItem::takeChild Removes the child at index row but doesn't delete it.

References child(), childItems, and setParent().

◆ testStatus()

bool PropertyItem::testStatus ( App::Property::Status  pos) const

References propertyItems.

◆ toolTip()

◆ toString()

◆ updateData()

◆ value()

QVariant PropertyItem::value ( const App::Property *  ) const
protectedvirtual

Reimplemented in Gui::PropertyEditor::PropertyStringItem, Gui::PropertyEditor::PropertyFontItem, Gui::PropertyEditor::PropertyIntegerItem, Gui::PropertyEditor::PropertyIntegerConstraintItem, Gui::PropertyEditor::PropertyFloatItem, Gui::PropertyEditor::PropertyUnitItem, Gui::PropertyEditor::PropertyFloatConstraintItem, Gui::PropertyEditor::PropertyBoolItem, Gui::PropertyEditor::PropertyVectorItem, Gui::PropertyEditor::PropertyVectorListItem, Gui::PropertyEditor::PropertyVectorDistanceItem, Gui::PropertyEditor::PropertyMatrixItem, Gui::PropertyEditor::PropertyRotationItem, Gui::PropertyEditor::PropertyPlacementItem, Gui::PropertyEditor::PropertyEnumItem, Gui::PropertyEditor::PropertyStringListItem, Gui::PropertyEditor::PropertyFloatListItem, Gui::PropertyEditor::PropertyIntegerListItem, Gui::PropertyEditor::PropertyColorItem, Gui::PropertyEditor::PropertyMaterialItem, Gui::PropertyEditor::PropertyMaterialListItem, Gui::PropertyEditor::PropertyFileItem, Gui::PropertyEditor::PropertyPathItem, Gui::PropertyEditor::PropertyTransientFileItem, FemGui::PropertyFemMeshItem, MeshGui::PropertyMeshKernelItem, SketcherGui::PropertyConstraintListItem, and Gui::PropertyEditor::PropertyLinkItem.

Referenced by data(), PathScripts.PathProperty.Property::displayString(), PathScripts.PathProperty.PropertyQuantity::displayString(), PathScripts.PathSetupSheetOpPrototype.Property::displayString(), PathScripts.PathSetupSheetOpPrototype.PropertyQuantity::displayString(), Mod.PartDesign.WizardShaft.SegmentFunction.SegmentFunction::evaluate(), PathScripts.PathProperty.Property::getValue(), PathScripts.PathSetupSheetOpPrototype.Property::getValue(), Mod.PartDesign.WizardShaft.SegmentFunction.IntervalFunction::lowervalue(), PathScripts.PathProperty.Property::setValue(), and PathScripts.PathSetupSheetOpPrototype.Property::setValue().

Friends And Related Function Documentation

◆ PropertyItemAttorney

Member Data Documentation

◆ childItems

QList<PropertyItem*> Gui::PropertyEditor::PropertyItem::childItems
protected

◆ displayText

QString Gui::PropertyEditor::PropertyItem::displayText
protected

Referenced by displayName(), and setPropertyName().

◆ expanded

bool Gui::PropertyEditor::PropertyItem::expanded
protected

◆ linked

bool Gui::PropertyEditor::PropertyItem::linked
protected

Referenced by data(), isLinked(), and setLinked().

◆ parentItem

PropertyItem* Gui::PropertyEditor::PropertyItem::parentItem
protected

◆ precision

◆ propertyItems

◆ propName

QString Gui::PropertyEditor::PropertyItem::propName
protected

◆ readonly

bool Gui::PropertyEditor::PropertyItem::readonly
protected

Referenced by isReadOnly(), and setReadOnly().


The documentation for this class was generated from the following files: