Salome HOME
Issue #2513: Provide selection for selector in undocked window
[modules/shaper.git] / src / ModuleBase / ModuleBase_ListView.cpp
index d1dc0158ab1b8a47c0ffb3d98790bbdefda7cc82..a245b9e6f49d7147f2fc6d3a1ab045a87e3974ac 100644 (file)
@@ -24,7 +24,6 @@
 #include <QAction>
 #include <QApplication>
 #include <QClipboard>
-#include <QListWidget>
 #include <QWidget>
 
 #ifndef WIN32
 
 const int ATTRIBUTE_SELECTION_INDEX_ROLE = Qt::UserRole + 1;
 
-/**
-* Customization of a List Widget to make it to be placed on full width of container
-*/
-class CustomListWidget : public QListWidget
-{
-public:
-  /// Constructor
-  /// \param theParent a parent widget
-  CustomListWidget(QWidget* theParent)
-    : QListWidget(theParent)
-  {
-  }
-
-  /// Redefinition of virtual method
-  virtual QSize        sizeHint() const
-  {
-    int aHeight = 2*QFontMetrics(font()).height();
-    QSize aSize = QListWidget::sizeHint();
-    return QSize(aSize.width(), aHeight);
-  }
-
-  /// Redefinition of virtual method
-  virtual QSize        minimumSizeHint() const
-  {
-    int aHeight = 4/*2*/*QFontMetrics(font()).height();
-    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_ListView::ModuleBase_ListView(QWidget* theParent, const QString& theObjectName,
   const QString& theToolTip)
@@ -98,6 +56,7 @@ ModuleBase_ListView::ModuleBase_ListView(QWidget* theParent, const QString& theO
 
   myListControl->setContextMenuPolicy(Qt::ActionsContextMenu);
   connect(myListControl, SIGNAL(itemSelectionChanged()), SLOT(onListSelection()));
+  connect(myListControl, SIGNAL(activated()), this, SIGNAL(listActivated()));
 }
 
 //********************************************************************