X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModuleBase%2FModuleBase_ListView.cpp;h=d9fe13d2c18339a17daaafebe041484adacb8e43;hb=be64ac512378281d54e4a73e8edb68ae43d0c5a7;hp=d1dc0158ab1b8a47c0ffb3d98790bbdefda7cc82;hpb=e6d80bfe0fbb4134680850dcac93998b42a31507;p=modules%2Fshaper.git diff --git a/src/ModuleBase/ModuleBase_ListView.cpp b/src/ModuleBase/ModuleBase_ListView.cpp index d1dc0158a..d9fe13d2c 100644 --- a/src/ModuleBase/ModuleBase_ListView.cpp +++ b/src/ModuleBase/ModuleBase_ListView.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2014-2017 CEA/DEN, EDF R&D +// Copyright (C) 2014-2019 CEA/DEN, EDF R&D // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -12,10 +12,9 @@ // // 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 +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #include "ModuleBase_ListView.h" @@ -24,7 +23,6 @@ #include #include #include -#include #include #ifndef WIN32 @@ -34,47 +32,6 @@ 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 +55,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())); } //********************************************************************