]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #1071: Update view port of resized QTreeWidget
authorVitaly SMETANNIKOV <vsv@opencascade.com>
Wed, 11 Nov 2015 14:55:25 +0000 (17:55 +0300)
committerVitaly SMETANNIKOV <vsv@opencascade.com>
Wed, 11 Nov 2015 14:55:25 +0000 (17:55 +0300)
src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp

index cadef7521a29517de99e82411f091e6feb78128c..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,