X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModuleBase%2FModuleBase_ParamSpinBox.cpp;h=f559eb68ae905e635206739f874b6c9a1fc10958;hb=8df398a914d768c5625808a7aa8ed504461f8b2a;hp=40b50fb1757ff1dca0a7f0dbbe0a3b3f88689685;hpb=98cde5751003b058c42dce34d53645f70572cb4c;p=modules%2Fshaper.git diff --git a/src/ModuleBase/ModuleBase_ParamSpinBox.cpp b/src/ModuleBase/ModuleBase_ParamSpinBox.cpp index 40b50fb17..f559eb68a 100644 --- a/src/ModuleBase/ModuleBase_ParamSpinBox.cpp +++ b/src/ModuleBase/ModuleBase_ParamSpinBox.cpp @@ -13,17 +13,45 @@ #include #include +#include +#include +#include + #include #include +//#define DEBUG_COMPLETE_WITH_PARAMETERS ModuleBase_ParamSpinBox::ModuleBase_ParamSpinBox(QWidget* theParent, int thePrecision) : ModuleBase_DoubleSpinBox(theParent, thePrecision), myAcceptVariables(true) { +#ifdef DEBUG_COMPLETE_WITH_PARAMETERS + myCompleter = new QCompleter(this); + myCompleter->setWidget(this); + myCompleter->setCompletionMode(QCompleter::PopupCompletion); + + myCompleterModel = new QStringListModel(this); + myCompleter->setModel(myCompleterModel); + // Use sorted model to accelerate completion (QCompleter will use binary search) + myCompleter->setModelSorting(QCompleter::CaseInsensitivelySortedModel); + myCompleter->setCaseSensitivity(Qt::CaseInsensitive); + + lineEdit()->setCompleter(myCompleter); +#endif + connectSignalsAndSlots(); } +void ModuleBase_ParamSpinBox::setCompletionList(QStringList& theList) +{ +#ifdef DEBUG_COMPLETE_WITH_PARAMETERS + theList.sort(); + theList.removeDuplicates(); + myCompleterModel->setStringList(theList); +#endif +} + /*! \brief Destructor. */