[Uml-devel] KDE/kdesdk/umbrello/umbrello/widgets
Ralf Habacker
ralf.habacker at gmail.com
Wed Dec 14 12:24:04 UTC 2011
SVN commit 1268726 by habacker:
fixed bug displaying to small class widgets
M +8 -1 classifierwidget.cpp
M +0 -1 umlwidget.cpp
--- trunk/KDE/kdesdk/umbrello/umbrello/widgets/classifierwidget.cpp #1268725:1268726
@@ -73,6 +73,14 @@
m_showStereotype = ops.classState.showStereoType;
m_drawAsCircle = false;
m_pAssocWidget = NULL;
+
+ /*
+ force calculation of the widget size to avoid too small widgets
+ Q: could this not be handled in UMLWidget for all widgets ?
+ */
+ QSize size = calculateSize();
+ setSize(size.width(), size.height());
+
setShowAttSigs( ops.classState.showAttSig );
}
@@ -353,7 +361,6 @@
else
displayedName = m_pObject->name();
const UMLWidget::FontType nft = (m_pObject->isAbstract() ? FT_BOLD_ITALIC : FT_BOLD);
- //const int nameWidth = getFontMetrics(nft).boundingRect(displayName).width();
const int nameWidth = UMLWidget::getFontMetrics(nft).size(0,displayedName).width();
if (nameWidth > width)
width = nameWidth;
--- trunk/KDE/kdesdk/umbrello/umbrello/widgets/umlwidget.cpp #1268725:1268726
@@ -966,7 +966,6 @@
setFontMetrics(fontType, painter.fontMetrics());
}
-//FIXME this is probably the source of problems with widgets not being wide enough
QFontMetrics &UMLWidget::getFontMetrics(UMLWidget::FontType fontType)
{
if (m_pFontMetrics[fontType] == 0) {
More information about the umbrello-devel
mailing list