Skip to content
Snippets Groups Projects
Commit 856a9ed0 authored by Olivier Langella's avatar Olivier Langella
Browse files

trying to get focus in protein list

parent 707690bd
No related branches found
No related tags found
No related merge requests found
...@@ -54,6 +54,9 @@ void IdentificationGroup::addProteinMatch(ProteinMatch * protein_match) { ...@@ -54,6 +54,9 @@ void IdentificationGroup::addProteinMatch(ProteinMatch * protein_match) {
void IdentificationGroup::addMsRunIdSp(pappso::MsRunIdSp ms_run_sp) { void IdentificationGroup::addMsRunIdSp(pappso::MsRunIdSp ms_run_sp) {
_ms_run_list.push_back(ms_run_sp); _ms_run_list.push_back(ms_run_sp);
} }
const std::vector<pappso::MsRunIdSp> & IdentificationGroup::getMsRunIdSpList() const {
return _ms_run_list;
}
std::vector<ProteinMatch *> & IdentificationGroup::getProteinMatchList() { std::vector<ProteinMatch *> & IdentificationGroup::getProteinMatchList() {
return _protein_match_list; return _protein_match_list;
} }
......
...@@ -61,6 +61,8 @@ public: ...@@ -61,6 +61,8 @@ public:
void updateAutomaticFilters(const AutomaticFilterParameters & automatic_filter_parameters); void updateAutomaticFilters(const AutomaticFilterParameters & automatic_filter_parameters);
void startGrouping (const GroupingType & grouping_type); void startGrouping (const GroupingType & grouping_type);
const std::vector<pappso::MsRunIdSp> & getMsRunIdSpList() const;
private : private :
GroupingExperiment * _p_grp_experiment= nullptr; GroupingExperiment * _p_grp_experiment= nullptr;
......
...@@ -32,6 +32,9 @@ ...@@ -32,6 +32,9 @@
<layout class="QFormLayout" name="formLayout_2"> <layout class="QFormLayout" name="formLayout_2">
<item row="0" column="0"> <item row="0" column="0">
<widget class="QPushButton" name="viewProteinListButton"> <widget class="QPushButton" name="viewProteinListButton">
<property name="toolTip">
<string>press ctrl to open a new window</string>
</property>
<property name="text"> <property name="text">
<string>View protein list</string> <string>View protein list</string>
</property> </property>
......
...@@ -52,7 +52,7 @@ ProjectWindow::ProjectWindow(MainWindow *parent): ...@@ -52,7 +52,7 @@ ProjectWindow::ProjectWindow(MainWindow *parent):
#endif #endif
/* /*
*/ */
this->setDisabled(true); this->setDisabled(true);
} }
...@@ -63,6 +63,10 @@ ProjectWindow::~ProjectWindow() ...@@ -63,6 +63,10 @@ ProjectWindow::~ProjectWindow()
delete ui; delete ui;
} }
void ProjectWindow::setDefaultProteinListWindow(ProteinListWindow* p_protein_list_window) {
_p_current_protein_list_window = p_protein_list_window;
}
void ProjectWindow::connectNewProteinListWindow() { void ProjectWindow::connectNewProteinListWindow() {
qDebug() << "ProjectWindow::connectNewProteinListWindow begin"; qDebug() << "ProjectWindow::connectNewProteinListWindow begin";
_p_current_protein_list_window = new ProteinListWindow(this); _p_current_protein_list_window = new ProteinListWindow(this);
...@@ -82,7 +86,7 @@ void ProjectWindow::connectNewProteinListWindow() { ...@@ -82,7 +86,7 @@ void ProjectWindow::connectNewProteinListWindow() {
#endif #endif
qDebug() << "ProjectWindow::connectNewProteinListWindow end"; qDebug() << "ProjectWindow::connectNewProteinListWindow end";
} }
void ProjectWindow::doProteinMatchClicked(ProteinMatch * protein_match) { void ProjectWindow::doProteinMatchClicked(ProteinMatch * protein_match) {
...@@ -112,6 +116,8 @@ void ProjectWindow::doViewProteinList(IdentificationGroup* p_identification_grou ...@@ -112,6 +116,8 @@ void ProjectWindow::doViewProteinList(IdentificationGroup* p_identification_grou
void ProjectWindow::setProjectSp(ProjectSp project_sp) { void ProjectWindow::setProjectSp(ProjectSp project_sp) {
_project_sp = project_sp; _project_sp = project_sp;
vector< MsRunIdSp > ms_run_list = _project_sp.get()->getCurrentIdentificationGroupP()->getMsRunIdSpList();
ui->sample_number_display->setText(QString("%1").arg(ms_run_list.size()));
//_protein_list_window->setIdentificationGroup(_project_sp.get()->getCurrentIdentificationGroupP()); //_protein_list_window->setIdentificationGroup(_project_sp.get()->getCurrentIdentificationGroupP());
//_protein_list_window->show(); //_protein_list_window->show();
this->setEnabled(true); this->setEnabled(true);
......
...@@ -47,6 +47,7 @@ public: ...@@ -47,6 +47,7 @@ public:
public slots: public slots:
void doViewProteinList(IdentificationGroup* p_identification_group =nullptr); void doViewProteinList(IdentificationGroup* p_identification_group =nullptr);
void doProteinMatchClicked(ProteinMatch * protein_match); void doProteinMatchClicked(ProteinMatch * protein_match);
void setDefaultProteinListWindow(ProteinListWindow* p_protein_list_window);
// void setColor(const QColor &color); // void setColor(const QColor &color);
// void setShape(Shape shape); // void setShape(Shape shape);
signals: signals:
......
...@@ -59,6 +59,9 @@ ProteinListWindow::ProteinListWindow(ProjectWindow *parent): ...@@ -59,6 +59,9 @@ ProteinListWindow::ProteinListWindow(ProjectWindow *parent):
connect(ui->tableView, SIGNAL(clicked(const QModelIndex &)), _p_proxy_model, SLOT(onTableClicked(const QModelIndex &))); connect(ui->tableView, SIGNAL(clicked(const QModelIndex &)), _p_proxy_model, SLOT(onTableClicked(const QModelIndex &)));
connect(ui->tableView, SIGNAL(doubleClicked(const QModelIndex &)), _p_proxy_model, SLOT(onTableDoubleClicked(const QModelIndex &))); connect(ui->tableView, SIGNAL(doubleClicked(const QModelIndex &)), _p_proxy_model, SLOT(onTableDoubleClicked(const QModelIndex &)));
connect(ui->proteinSearchEdit, SIGNAL(textChanged(QString)), _protein_table_model_p, SLOT(onProteinSearchEdit(QString))); connect(ui->proteinSearchEdit, SIGNAL(textChanged(QString)), _protein_table_model_p, SLOT(onProteinSearchEdit(QString)));
connect( this, SIGNAL( focusReceived(bool) ),this, SLOT(doFocusReceived(bool)) );
//connect(_protein_table_model_p, SIGNAL(layoutChanged()), this, SLOT(updateStatusBar())); //connect(_protein_table_model_p, SIGNAL(layoutChanged()), this, SLOT(updateStatusBar()));
#endif #endif
...@@ -68,6 +71,11 @@ void ProteinListWindow::doubleclickOnproteinMatch(ProteinMatch * p_protein_match ...@@ -68,6 +71,11 @@ void ProteinListWindow::doubleclickOnproteinMatch(ProteinMatch * p_protein_match
emit proteinMatchClicked(p_protein_match); emit proteinMatchClicked(p_protein_match);
//updateStatusBar(); //updateStatusBar();
} }
void ProteinListWindow::doFocusReceived(bool has_focus) {
if (has_focus ) {
_project_window->setDefaultProteinListWindow(this);
}
}
ProteinListWindow::~ProteinListWindow() ProteinListWindow::~ProteinListWindow()
{ {
...@@ -78,10 +86,12 @@ ProteinListWindow::~ProteinListWindow() ...@@ -78,10 +86,12 @@ ProteinListWindow::~ProteinListWindow()
void ProteinListWindow::setIdentificationGroup(IdentificationGroup * p_identification_group) { void ProteinListWindow::setIdentificationGroup(IdentificationGroup * p_identification_group) {
_p_identification_group = p_identification_group; if (_p_identification_group != p_identification_group) {
_protein_table_model_p->setIdentificationGroup(p_identification_group); _p_identification_group = p_identification_group;
_p_proxy_model->setSourceModel(_protein_table_model_p); _protein_table_model_p->setIdentificationGroup(p_identification_group);
updateStatusBar(); _p_proxy_model->setSourceModel(_protein_table_model_p);
updateStatusBar();
}
} }
void ProteinListWindow::updateStatusBar() { void ProteinListWindow::updateStatusBar() {
......
...@@ -47,12 +47,13 @@ public: ...@@ -47,12 +47,13 @@ public:
void updateStatusBar(); void updateStatusBar();
public slots: public slots:
void doFocusReceived(bool has_focus);
//void peptideEdited(QString peptideStr); //void peptideEdited(QString peptideStr);
// void setColor(const QColor &color); // void setColor(const QColor &color);
// void setShape(Shape shape); // void setShape(Shape shape);
signals: signals:
void proteinMatchClicked(ProteinMatch * p_protein_match); void proteinMatchClicked(ProteinMatch * p_protein_match);
private: private:
IdentificationGroup * _p_identification_group; IdentificationGroup * _p_identification_group;
Ui::ProteinView *ui; Ui::ProteinView *ui;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment