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) {
void IdentificationGroup::addMsRunIdSp(pappso::MsRunIdSp 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() {
return _protein_match_list;
}
......
......@@ -61,6 +61,8 @@ public:
void updateAutomaticFilters(const AutomaticFilterParameters & automatic_filter_parameters);
void startGrouping (const GroupingType & grouping_type);
const std::vector<pappso::MsRunIdSp> & getMsRunIdSpList() const;
private :
GroupingExperiment * _p_grp_experiment= nullptr;
......
......@@ -32,6 +32,9 @@
<layout class="QFormLayout" name="formLayout_2">
<item row="0" column="0">
<widget class="QPushButton" name="viewProteinListButton">
<property name="toolTip">
<string>press ctrl to open a new window</string>
</property>
<property name="text">
<string>View protein list</string>
</property>
......
......@@ -52,7 +52,7 @@ ProjectWindow::ProjectWindow(MainWindow *parent):
#endif
/*
*/
this->setDisabled(true);
}
......@@ -63,6 +63,10 @@ ProjectWindow::~ProjectWindow()
delete ui;
}
void ProjectWindow::setDefaultProteinListWindow(ProteinListWindow* p_protein_list_window) {
_p_current_protein_list_window = p_protein_list_window;
}
void ProjectWindow::connectNewProteinListWindow() {
qDebug() << "ProjectWindow::connectNewProteinListWindow begin";
_p_current_protein_list_window = new ProteinListWindow(this);
......@@ -82,7 +86,7 @@ void ProjectWindow::connectNewProteinListWindow() {
#endif
qDebug() << "ProjectWindow::connectNewProteinListWindow end";
}
void ProjectWindow::doProteinMatchClicked(ProteinMatch * protein_match) {
......@@ -112,6 +116,8 @@ void ProjectWindow::doViewProteinList(IdentificationGroup* p_identification_grou
void ProjectWindow::setProjectSp(ProjectSp 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->show();
this->setEnabled(true);
......
......@@ -47,6 +47,7 @@ public:
public slots:
void doViewProteinList(IdentificationGroup* p_identification_group =nullptr);
void doProteinMatchClicked(ProteinMatch * protein_match);
void setDefaultProteinListWindow(ProteinListWindow* p_protein_list_window);
// void setColor(const QColor &color);
// void setShape(Shape shape);
signals:
......
......@@ -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(doubleClicked(const QModelIndex &)), _p_proxy_model, SLOT(onTableDoubleClicked(const QModelIndex &)));
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()));
#endif
......@@ -68,6 +71,11 @@ void ProteinListWindow::doubleclickOnproteinMatch(ProteinMatch * p_protein_match
emit proteinMatchClicked(p_protein_match);
//updateStatusBar();
}
void ProteinListWindow::doFocusReceived(bool has_focus) {
if (has_focus ) {
_project_window->setDefaultProteinListWindow(this);
}
}
ProteinListWindow::~ProteinListWindow()
{
......@@ -78,10 +86,12 @@ ProteinListWindow::~ProteinListWindow()
void ProteinListWindow::setIdentificationGroup(IdentificationGroup * p_identification_group) {
_p_identification_group = p_identification_group;
_protein_table_model_p->setIdentificationGroup(p_identification_group);
_p_proxy_model->setSourceModel(_protein_table_model_p);
updateStatusBar();
if (_p_identification_group != p_identification_group) {
_p_identification_group = p_identification_group;
_protein_table_model_p->setIdentificationGroup(p_identification_group);
_p_proxy_model->setSourceModel(_protein_table_model_p);
updateStatusBar();
}
}
void ProteinListWindow::updateStatusBar() {
......
......@@ -47,12 +47,13 @@ public:
void updateStatusBar();
public slots:
void doFocusReceived(bool has_focus);
//void peptideEdited(QString peptideStr);
// void setColor(const QColor &color);
// void setShape(Shape shape);
signals:
void proteinMatchClicked(ProteinMatch * p_protein_match);
private:
IdentificationGroup * _p_identification_group;
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