• Oliver Kellogg's avatar
    Add default value capability at stereotype attribute: · 66da747f
    Oliver Kellogg authored
    umbrello/uml1model/stereotype.h
    - In class AttributeDef,
      - add member defaultVal of type QString;
      - extend constructor for externally provided defaultVal.
    
    umbrello/uml1model/stereotype.cpp
    - In function saveToXMI1 loop over m_attrDefs, if ad.defaultVal is
      non empty then setAttribute "initialValue" on attElement.
    - In function load1 traversal of QDomNodes tag "UML:Stereotype.feature"
      while-loop over attElem tag "UML:Attribute" retrieve attElem attribute
      "initialValue" into local dfltVal of type QString.
      Pass dfltVal into AttributeDef constructor.
    
    umbrello/dialogs/stereoattributedialog.h
    - Add member m_pDefaultValueLabel[N_STEREOATTRS] of type QLabel*.
    - Add member m_pDefaultValueEdit [N_STEREOATTRS] of type KLineEdit*.
    
    umbrello/dialogs/stereoattributedialog.cpp
    - In function setupDialog() for-loop of row,
      - place m_pDefaultValueLabel[row], m_pDefaultValueEdit[row] into
        columns 4, 5 using Dialog_Utils::makeLabeledEditField();
      - in case (adefs.count() > row) initialize m_pDefaultValueEdit[row]
        from adefs.at(row).defaultVal.
    - In function apply() pass m_pDefaultValueEdit[i]->text().trimmed()
      into UMLStereotype::AttributeDef constructor argument dfltVal.
    
    CCBUG: 73847
    66da747f
stereoattributedialog.cpp 4.75 KB