-// Copyright (C) 2014-2017 CEA/DEN, EDF R&D
+// Copyright (C) 2014-2023 CEA, EDF
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include "ModuleBase_ParamSpinBox.h"
: QAbstractSpinBox(theParent),
myIsEquation(false),
myAcceptVariables(true),
- mySingleStep(1),
myMinimum(-DBL_MAX),
- myMaximum(DBL_MAX)
+ myMaximum(DBL_MAX),
+ mySingleStep(1)
{
myCompleter = new QCompleter(this);
myCompleter->setWidget(lineEdit());
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);
}
/*!
double ModuleBase_ParamSpinBox::value() const
{
- std::string aa = lineEdit()->text().toStdString();
return lineEdit()->text().toDouble();
}