From 82e69a0e94df9e2cfc43cdb22f9e48483f2355a1 Mon Sep 17 00:00:00 2001
From: Olivier Langella <Olivier.Langella@moulon.inra.fr>
Date: Thu, 30 Mar 2017 22:09:43 +0200
Subject: [PATCH] refresh layout signal ok

---
 src/CMakeLists.txt                              | 4 ++--
 src/gui/protein_list_view/proteinlistwindow.cpp | 7 +++++--
 src/gui/protein_list_view/proteinlistwindow.h   | 1 +
 src/gui/protein_list_view/proteintablemodel.cpp | 4 +++-
 4 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 46172223..617e2004 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -29,8 +29,8 @@ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Xml_EXECUTABLE_COMPILE_FLAGS} ${Qt5
 
 #sudo apt-get install libpappsomspp-dev
 #FIND_PACKAGE( Pappsomspp REQUIRED )
-# SET (PAPPSOMSPP_DIR  "/home/olivier/eclipse/git/pappsomspp")
- SET (PAPPSOMSPP_DIR  "/home/langella/developpement/git/pappsomspp")
+ SET (PAPPSOMSPP_DIR  "/home/olivier/eclipse/git/pappsomspp")
+# SET (PAPPSOMSPP_DIR  "/home/langella/developpement/git/pappsomspp")
  SET (PAPPSOMSPP_INCLUDE_DIR "${PAPPSOMSPP_DIR}/src")
  SET (PAPPSOMSPP_QT4_LIBRARY "${PAPPSOMSPP_DIR}/cbuild/src/libpappsomspp-qt4.so")
 
diff --git a/src/gui/protein_list_view/proteinlistwindow.cpp b/src/gui/protein_list_view/proteinlistwindow.cpp
index 6fe75065..53464b8e 100644
--- a/src/gui/protein_list_view/proteinlistwindow.cpp
+++ b/src/gui/protein_list_view/proteinlistwindow.cpp
@@ -80,10 +80,15 @@ ProteinListWindow::ProteinListWindow(ProjectWindow *parent):
     connect( this, SIGNAL( focusReceived(bool) ),this, SLOT(doFocusReceived(bool)) );
     connect(ui->centralwidget, SIGNAL(customContextMenuRequested(const QPoint &)),
             this, SLOT(showContextMenu(const QPoint &)));
+    connect(_p_proxy_model, SIGNAL(layoutChanged()),
+            this, SLOT(doProxyLayoutChanged()));
     //connect(_protein_table_model_p, SIGNAL(layoutChanged()), this, SLOT(updateStatusBar()));
 #endif
 }
 
+void ProteinListWindow::doProxyLayoutChanged() {
+    updateStatusBar();
+}
 void ProteinListWindow::showEvalueColumn(bool show) {
     _display_evalue = show;
 
@@ -173,7 +178,6 @@ void ProteinListWindow::doIdentificationGroupGrouped(IdentificationGroup * p_ide
     qDebug() << "ProteinListWindow::doIdentificationGroupGrouped begin";
     if (_p_identification_group == p_identification_group) {
         _p_proxy_model->setSourceModel(_protein_table_model_p);
-        updateStatusBar();
     }
     qDebug() << "ProteinListWindow::doIdentificationGroupGrouped end";
 }
@@ -183,7 +187,6 @@ void ProteinListWindow::setIdentificationGroup(IdentificationGroup * p_identific
         _p_identification_group = p_identification_group;
         _protein_table_model_p->setIdentificationGroup(p_identification_group);
         _p_proxy_model->setSourceModel(_protein_table_model_p);
-        updateStatusBar();
     }
 
 }
diff --git a/src/gui/protein_list_view/proteinlistwindow.h b/src/gui/protein_list_view/proteinlistwindow.h
index 4ce0985f..71edbe90 100644
--- a/src/gui/protein_list_view/proteinlistwindow.h
+++ b/src/gui/protein_list_view/proteinlistwindow.h
@@ -63,6 +63,7 @@ protected slots:
     void doNotValidHide(bool hide);
     void doNotCheckedHide(bool hide);
     void doNotGroupedHide(bool hide);
+    void doProxyLayoutChanged();
     void showContextMenu(const QPoint &);
     void showEvalueColumn(bool show);
     void showAccessionColumn(bool show);
diff --git a/src/gui/protein_list_view/proteintablemodel.cpp b/src/gui/protein_list_view/proteintablemodel.cpp
index 04f36808..f8f8b429 100644
--- a/src/gui/protein_list_view/proteintablemodel.cpp
+++ b/src/gui/protein_list_view/proteintablemodel.cpp
@@ -104,6 +104,7 @@ void ProteinTableModel::refresh() {
     QModelIndex topLeft = createIndex(0,0);
     QModelIndex bottomRight = createIndex(rowCount(),columnCount());
     emit dataChanged(topLeft, bottomRight);
+    emit layoutChanged();
     qDebug() << "ProteinTableModel::refresh end ";
 }
 
@@ -126,7 +127,7 @@ void ProteinTableModel::onProteinSearchEdit(QString protein_search_string) {
     QModelIndex topLeft = createIndex(0,0);
     QModelIndex bottomRight = createIndex(rowCount(),columnCount());
     emit dataChanged(topLeft, bottomRight);
-    _p_protein_list_window->updateStatusBar();
+    emit layoutChanged();
 }
 
 void ProteinTableModel::setIdentificationGroup(IdentificationGroup * p_identification_group) {
@@ -137,6 +138,7 @@ void ProteinTableModel::setIdentificationGroup(IdentificationGroup * p_identific
     QModelIndex bottomRight = createIndex(rowCount(),columnCount());
     emit dataChanged(topLeft, topLeft);
     emit headerDataChanged(Qt::Horizontal, 0,3);
+    emit layoutChanged();
 }
 
 int ProteinTableModel::rowCount(const QModelIndex &parent ) const {
-- 
GitLab