Salome HOME
Fix fillet validator
[modules/shaper.git] / src / ModuleBase / ModuleBase_WidgetMultiSelector.cpp
index af676208cc5d3c9c53c12096e93c092d6ab06812..d3dffd6a29e8c1cf33db354131fb94546e1985e8 100755 (executable)
@@ -32,6 +32,7 @@
 #include <QAction>
 #include <QApplication>
 #include <QClipboard>
+#include <QTimer>
 
 #include <memory>
 #include <string>
@@ -64,6 +65,17 @@ public:
     QSize aSize = QListWidget::minimumSizeHint();
     return QSize( aSize.width(), aHeight );
   }
+
+#ifndef WIN32
+// The code is necessary only for Linux because
+//it can not update viewport on widget resize
+protected:
+  void resizeEvent(QResizeEvent* theEvent)
+  {
+    QListWidget::resizeEvent(theEvent);
+    QTimer::singleShot(5, viewport(), SLOT(repaint()));
+  }
+#endif
 };
 
 ModuleBase_WidgetMultiSelector::ModuleBase_WidgetMultiSelector(QWidget* theParent,
@@ -304,8 +316,7 @@ QList<QWidget*> ModuleBase_WidgetMultiSelector::getControls() const
 //********************************************************************
 void ModuleBase_WidgetMultiSelector::onSelectionTypeChanged()
 {
-  activateSelection(true);
-  activateFilters(true);
+  activateSelectionAndFilters(true);
   QList<ModuleBase_ViewerPrs> anEmptyList;
   // This method will call Selection changed event which will call onSelectionChanged
   // To clear mySelection, myListControl and storeValue()
@@ -354,14 +365,12 @@ void ModuleBase_WidgetMultiSelector::setCurrentShapeType(const TopAbs_ShapeEnum
     aShapeTypeName = myTypeCombo->itemText(idx);
     TopAbs_ShapeEnum aRefType = ModuleBase_Tools::shapeType(aShapeTypeName);
     if(aRefType == theShapeType && idx != myTypeCombo->currentIndex()) {
-      activateSelection(false);
-      activateFilters(false);
+      activateSelectionAndFilters(false);
       bool isBlocked = myTypeCombo->blockSignals(true);
       myTypeCombo->setCurrentIndex(idx);
       myTypeCombo->blockSignals(isBlocked);
 
-      activateSelection(true);
-      activateFilters(true);
+      activateSelectionAndFilters(true);
       break;
     }
   }