[Uml-devel] KDE/kdesdk/umbrello/umbrello/widgets

Ralf Habacker ralf.habacker at gmail.com
Thu Jan 19 22:40:28 UTC 2012


SVN commit 1274738 by habacker:

Fixed widget font size calculation issue when loading poseidon321.xmi.

When setting a font we need to recalculate the font metrics too.

CCBUG: 291894

 M  +8 -8      umlwidget.cpp  


--- trunk/KDE/kdesdk/umbrello/umbrello/widgets/umlwidget.cpp #1274737:1274738
@@ -288,13 +288,17 @@
     m_isInstance = false;
     setMinimumSize(DefaultMinimumSize);
     setMaximumSize(DefaultMaximumSize);
+    
+    for (int i = 0; i < (int)FT_INVALID; ++i)
+        m_pFontMetrics[(UMLWidget::FontType)i] = 0;
+    
     if (m_scene) {
         m_useFillColor = true;
         m_usesDiagramFillColor = true;
         m_usesDiagramUseFillColor = true;
         const Settings::OptionState& optionState = m_scene->optionState();
         m_FillColor = optionState.uiState.fillColor;
-        m_Font       = optionState.uiState.font;
+        setFont(optionState.uiState.font);
         m_showStereotype = optionState.classState.showStereoType;
     } else {
         uError() << "SERIOUS PROBLEM - m_scene is NULL";
@@ -304,9 +308,6 @@
         m_showStereotype = false;
     }
 
-    for (int i = 0; i < (int)FT_INVALID; ++i)
-        m_pFontMetrics[(UMLWidget::FontType)i] = 0;
-
     m_resizable = true;
 
     m_selected = false;
@@ -1434,13 +1435,12 @@
     m_nId = STR2ID(id);
 
     if (!font.isEmpty()) {
-        //QFont newFont;
-        m_Font.fromString(font);
-        //setFont(newFont);
+        QFont newFont;
+        newFont.fromString(font);
+        setFont(newFont);
     } else {
         uWarning() << "Using default font " << m_Font.toString()
         << " for widget with xmi.id " << ID2STR(m_nId) << endl;
-        //setFont( m_Font );
     }
 
     setSize(w.toInt(), h.toInt());




More information about the umbrello-devel mailing list