<s> import PythonQt <EOL> from PythonQt import QtCore , QtGui <EOL> from director . timercallback import TimerCallback <EOL> import director . objectmodel as om <EOL> from director import propertyset <EOL> def startApplication ( enableQuitTimer = False ) : <EOL> appInstance = QtGui . QApplication . instance ( ) <EOL> if enableQuitTimer : <EOL> quitTimer = TimerCallback ( ) <EOL> quitTimer . callback = appInstance . quit <EOL> quitTimer . singleShot ( <NUM_LIT:0.1> ) <EOL> appInstance . exec_ ( ) <EOL> def main ( ) : <EOL> obj = om . ObjectModelItem ( '<STR_LIT:test>' ) <EOL> obj . addProperty ( '<STR_LIT>' , <NUM_LIT:1.0> , attributes = om . PropertyAttributes ( decimals = <NUM_LIT:2> , minimum = <NUM_LIT:0> , maximum = <NUM_LIT:100> , singleStep = <NUM_LIT:0.5> ) ) <EOL> obj . addProperty ( '<STR_LIT>' , [ <NUM_LIT:1.0> , <NUM_LIT> , <NUM_LIT> ] , attributes = om . PropertyAttributes ( decimals = <NUM_LIT:2> , minimum = <NUM_LIT:0> , maximum = <NUM_LIT:100> , singleStep = <NUM_LIT:0.5> ) ) <EOL> obj . addProperty ( '<STR_LIT:int>' , <NUM_LIT:1> , attributes = om . PropertyAttributes ( minimum = <NUM_LIT:0> , maximum = <NUM_LIT:100> , singleStep = <NUM_LIT:5> ) ) <EOL> obj . addProperty ( '<STR_LIT>' , [ <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:3> ] , attributes = om . PropertyAttributes ( minimum = <NUM_LIT:0> , maximum = <NUM_LIT:100> , singleStep = <NUM_LIT:1> ) ) <EOL> obj . addProperty ( '<STR_LIT:bool>' , True ) <EOL> obj . addProperty ( '<STR_LIT:str>' , '<STR_LIT:value>' ) <EOL> obj . addProperty ( '<STR_LIT>' , <NUM_LIT:0> , attributes = om . PropertyAttributes ( enumNames = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] ) ) <EOL> obj . addProperty ( '<STR_LIT>' , [ <NUM_LIT:1.0> , <NUM_LIT:0.5> , <NUM_LIT:0.0> ] ) <EOL> panel = PythonQt . dd . ddPropertiesPanel ( ) <EOL> panel . setBrowserModeToWidget ( ) <EOL> panel . show ( ) <EOL> panelConnector = propertyset . PropertyPanelConnector ( obj . properties , panel ) <EOL> def onPropertyChanged ( propertySet , propertyName ) : <EOL> obj . properties . setPropertyAttribute ( '<STR_LIT>' , '<STR_LIT>' , [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] ) <EOL> obj . properties . connectPropertyChanged ( onPropertyChanged ) <EOL> obj . setProperty ( '<STR_LIT:bool>' , False ) <EOL> assert '<STR_LIT>' in obj . properties . getPropertyAttribute ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> _pythonManager . consoleWidget ( ) . show ( ) <EOL> startApplication ( enableQuitTimer = True ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> main ( ) </s>
