[Uml-devel] branches/work/soc-umbrello/umbrello

Gopala Krishna A krishna.ggk at gmail.com
Thu Jul 31 11:00:36 UTC 2008


SVN commit 840094 by gopala:

Added TextItemGroup::insertItemAt method to allow insertion of
TextItems at required position.



 M  +18 -0     textitemgroup.cpp  
 M  +2 -1      textitemgroup.h  


--- branches/work/soc-umbrello/umbrello/textitemgroup.cpp #840093:840094
@@ -88,6 +88,24 @@
     m_textItems.append(textItem);
 }
 
+void TextItemGroup::insertTextItemAt(int i, TextItem *textItem)
+{
+    if(m_textItems.contains(textItem)) {
+        uDebug() << "TextItem(" << (void*)textItem << ") "
+                 << textItem->text() << " is already in the group";
+        return;
+    }
+
+	textItem->setAlignment(m_alignment);
+	textItem->setDefaultTextColor(m_fontColor);
+	textItem->setHoverBrush(m_hoverBrush);
+	textItem->setBackgroundBrush(m_backgroundBrush);
+	textItem->setFont(m_font);
+
+	textItem->setParentItem(m_parentItem);
+    m_textItems.insert(i, textItem);
+}
+
 void TextItemGroup::deleteTextItem(TextItem *textItem)
 {
     deleteTextItemAt(indexOf(textItem));
--- branches/work/soc-umbrello/umbrello/textitemgroup.h #840093:840094
@@ -58,7 +58,8 @@
 		return m_textItems;
 	}
 
-	void appendTextItem(TextItem *item);
+    void appendTextItem(TextItem *item);
+    void insertTextItemAt(int i, TextItem *item);
     void deleteTextItem(TextItem *item);
     void deleteTextItemAt(int index);
 




More information about the umbrello-devel mailing list