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

Gopala Krishna A krishna.ggk at gmail.com
Wed Aug 27 03:08:07 UTC 2008


SVN commit 853044 by gopala:

Fixes undesirable word wrapping of TextItems in TextItemGroup.

For example this bug was visible in ClassifierWidget, whose part of
name used to be wrapped to next line when a minimum size was set on
the widget.



 M  +12 -0     textitem.cpp  


--- branches/work/soc-umbrello/umbrello/textitem.cpp #853043:853044
@@ -184,6 +184,10 @@
 /**
  * Reimplemented to retain the italic/bold status on font change.
  *
+ * It is important to note that, this method retains the old bold,
+ * italic and underline property of the font and hence all these
+ * properties should be set explicitly.
+ *
  * @note This overrides (hides) the base's non virtual method.
  */
 void TextItem::setFont(QFont f)
@@ -192,6 +196,7 @@
 
     f.setBold(old.bold());
     f.setItalic(old.italic());
+    f.setUnderline(old.underline());
 
     QGraphicsTextItem::setFont(f);
 }
@@ -241,6 +246,10 @@
     QGraphicsTextItem::paint(p, o, w);
 }
 
+/**
+ * This is a utility method to copy all the attributes of this
+ * TextItem to \a other TextItem.
+ */
 void TextItem::copyAttributesTo(TextItem *other) const
 {
     other->setDefaultTextColor(defaultTextColor());
@@ -248,6 +257,9 @@
     other->setAcceptHoverEvents(acceptHoverEvents());
     other->setAlignment(alignment());
     other->setFont(font());
+    other->setBold(bold());
+    other->setItalic(italic());
+    other->setUnderline(underline());
     other->setBackgroundBrush(backgroundBrush());
 }
 




More information about the umbrello-devel mailing list