Skip to content

Instantly share code, notes, and snippets.

@yorikvanhavre
Last active August 29, 2015 14:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yorikvanhavre/537b1d4ae7db200acd3c to your computer and use it in GitHub Desktop.
Save yorikvanhavre/537b1d4ae7db200acd3c to your computer and use it in GitHub Desktop.
class ViewProviderPath:
def __init__(self,vobj): #mandatory
obj.addProperty("App::PropertyFloat","SomePropertyName","PropertyGroup","Description of this property")
obj.Proxy = self
def __getstate__(self): #mandatory
return None
def __setstate__(self,state): #mandatory
return None
def getIcon(self): #optional
return ":/icons/my_icon.svg"
def attach(self): #optional
# this is executed on object creation and object load from file
pass
def onChanged(self,vobj,prop): #optional
# this is executed when a property of the VIEW PROVIDER changes
pass
def updateData(self,obj,prop): #optional
# this is executed when a property of the APP OBJECT changes
pass
def setEdit(self,vobj,mode): #optional
# this is executed when the object is double-clicked in the tree
pass
def unsetEdit(self,vobj,mode): #optional
# this is executed when the user cancels or terminates edit mode
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment