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

search combo box

parent 0d538c92
No related branches found
No related tags found
No related merge requests found
......@@ -260,8 +260,8 @@ void ProjectWindow::doViewPeptideList(IdentificationGroup * p_ident_group, Prote
_p_current_peptide_list_window->setProteinMatch(p_ident_group, protein_match);
_p_current_peptide_list_window->show();
_p_current_peptide_list_window->raise();
_p_current_peptide_list_window->activateWindow();
//_p_current_peptide_list_window->raise();
//_p_current_peptide_list_window->activateWindow();
qDebug() << "ProjectWindow::doViewPeptideList end";
}
......@@ -279,8 +279,8 @@ void ProjectWindow::doViewPeptideDetail(PeptideMatch * peptide_match) {
_p_current_peptide_detail_window->setPeptideMatch(peptide_match);
_p_current_peptide_detail_window->show();
_p_current_peptide_detail_window->raise();
_p_current_peptide_detail_window->activateWindow();
//_p_current_peptide_detail_window->raise();
//_p_current_peptide_detail_window->activateWindow();
emit peptideMatchSelected(peptide_match);
qDebug() << "ProjectWindow::doViewPeptideDetail end";
......@@ -301,8 +301,8 @@ void ProjectWindow::doViewProteinDetail(ProteinMatch * protein_match) {
_p_current_protein_detail_window->setProteinMatch(protein_match);
_p_current_protein_detail_window->show();
_p_current_protein_detail_window->raise();
_p_current_protein_detail_window->activateWindow();
//_p_current_protein_detail_window->raise();
//_p_current_protein_detail_window->activateWindow();
qDebug() << "ProjectWindow::doViewProteinDetail end";
}
......@@ -320,8 +320,8 @@ void ProjectWindow::doViewProteinList(IdentificationGroup* p_identification_grou
_p_current_protein_list_window->show();
_p_current_protein_list_window->raise();
_p_current_protein_list_window->activateWindow();
//_p_current_protein_list_window->raise();
//_p_current_protein_list_window->activateWindow();
qDebug() << "ProjectWindow::doViewProteinList end " << p_identification_group;
_p_current_protein_list_window->setIdentificationGroup(p_identification_group);
......
......@@ -61,7 +61,37 @@
</widget>
</item>
<item>
<widget class="QLineEdit" name="proteinSearchEdit"/>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>search</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="search_combobox">
<item>
<property name="text">
<string>accession</string>
</property>
</item>
<item>
<property name="text">
<string>description</string>
</property>
</item>
<item>
<property name="text">
<string>group</string>
</property>
</item>
</widget>
</item>
<item>
<widget class="QLineEdit" name="protein_search_edit"/>
</item>
</layout>
</item>
</layout>
</widget>
......@@ -127,10 +157,44 @@
</hint>
</hints>
</connection>
<connection>
<sender>protein_search_edit</sender>
<signal>textChanged(QString)</signal>
<receiver>ProteinView</receiver>
<slot>onProteinSearchEdit(QString)</slot>
<hints>
<hint type="sourcelabel">
<x>352</x>
<y>363</y>
</hint>
<hint type="destinationlabel">
<x>879</x>
<y>391</y>
</hint>
</hints>
</connection>
<connection>
<sender>search_combobox</sender>
<signal>activated(QString)</signal>
<receiver>ProteinView</receiver>
<slot>doSearchOn(QString)</slot>
<hints>
<hint type="sourcelabel">
<x>121</x>
<y>354</y>
</hint>
<hint type="destinationlabel">
<x>867</x>
<y>386</y>
</hint>
</hints>
</connection>
</connections>
<slots>
<slot>doNotValidHide(bool)</slot>
<slot>doNotCheckedHide(bool)</slot>
<slot>doNotGroupedHide(bool)</slot>
<slot>onProteinSearchEdit(QString)</slot>
<slot>doSearchOn(QString)</slot>
</slots>
</ui>
......@@ -77,7 +77,7 @@ ProteinListWindow::ProteinListWindow(ProjectWindow *parent):
connect (this, SIGNAL(proteinDataChanged()), _protein_table_model_p, SLOT(onProteinDataChanged()));
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)), this, SLOT(onProteinSearchEdit(QString)));
//connect(ui->protein_search_edit, SIGNAL(textChanged(QString)), this, SLOT(onProteinSearchEdit(QString)));
//connect( this, SIGNAL( focusReceived(bool) ),this, SLOT(doFocusReceived(bool)) );
......@@ -187,6 +187,12 @@ void ProteinListWindow::doNotGroupedHide(bool hide) {
qDebug() << "ProteinListWindow::doNotGroupedHide end";
}
void ProteinListWindow::doSearchOn(QString search_on) {
qDebug() << "ProteinTableProxyModel::doSearchOn begin " << search_on;
_p_proxy_model->setSearchOn( search_on);
emit proteinDataChanged();
}
void ProteinListWindow::onProteinSearchEdit(QString protein_search_string) {
qDebug() << "ProteinTableProxyModel::onProteinSearchEdit begin " << protein_search_string;
......
......@@ -70,6 +70,7 @@ protected slots:
void showAccessionColumn(bool show);
void updateStatusBar();
void onProteinSearchEdit(QString protein_search_string);
void doSearchOn(QString search_on);
protected :
void askProteinDetailView(ProteinMatch * p_protein_match);
......
......@@ -40,8 +40,27 @@ bool ProteinTableProxyModel::filterAcceptsRow(int source_row,
//qDebug() << "ProteinTableProxyModel::filterAcceptsRow protein_match " << source_row;
if (!_protein_search_string.isEmpty()) {
if (!protein_match->getProteinXtpSp().get()->getDescription().contains(_protein_search_string)) {
return false;
if (_search_on == "accession") {
if (!protein_match->getProteinXtpSp().get()->getAccession().contains(_protein_search_string)) {
return false;
}
}
else if (_search_on == "group") {
pappso::GrpProtein * p_grp_prot = protein_match->getGrpProteinSp().get();
if (p_grp_prot == nullptr) {
return false;
}
else {
p_grp_prot->getGroupingId();
if (!p_grp_prot->getGroupingId().startsWith(_protein_search_string)) {
return false;
}
}
}
else {
if (!protein_match->getProteinXtpSp().get()->getDescription().contains(_protein_search_string)) {
return false;
}
}
}
......@@ -172,7 +191,9 @@ void ProteinTableProxyModel::hideNotChecked(bool hide) {
void ProteinTableProxyModel::hideNotGrouped(bool hide) {
_hide_not_grouped = hide;
}
void ProteinTableProxyModel::setSearchOn(QString search_on) {
_search_on = search_on;
}
void ProteinTableProxyModel::setProteinSearchString(QString protein_search_string) {
_protein_search_string = protein_search_string;
}
......@@ -47,6 +47,7 @@ public:
void hideNotChecked(bool hide);
void hideNotGrouped(bool hide);
void setProteinSearchString(QString protein_search_string);
void setSearchOn(QString search_on);
public slots:
void onTableClicked(const QModelIndex &index);
......@@ -54,6 +55,7 @@ public slots:
private:
ProteinTableModel* _protein_table_model_p;
ProteinListWindow * _p_protein_list_window;
QString _search_on = "accession";
QString _protein_search_string;
bool _hide_not_valid = true;
bool _hide_not_checked = true;
......
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