Salome HOME
Merge remote-tracking branch 'remotes/origin/occ/eliminateWarnings'
[modules/shaper.git] / src / ModuleBase / ModuleBase_ParamSpinBox.cpp
index 5d48ad9a81edab5bab1f47f165fdf44cb4f56bb2..e9c87937401bdfde2d6b04245493b1e10d93b957 100644 (file)
@@ -81,6 +81,17 @@ void ModuleBase_ParamSpinBox::setCompletionList(QStringList& theList)
   theList.removeDuplicates();
   theList.sort();
   myCompleterModel->setStringList(theList);
+
+  QAbstractItemView* aPopup = myCompleter->popup();
+  QFontMetrics aMetric = aPopup->fontMetrics();
+  int aWidth = 0;
+  QRect aRect;
+  foreach(QString aStr, theList) {
+    aRect = aMetric.boundingRect(aStr);
+    if (aRect.width() > aWidth)
+      aWidth = aRect.width();
+  }
+  aPopup->setMinimumWidth(aWidth + 25);
 }
 
 /*!