Loading...
Searching...
No Matches
pappso::OboListWidget Class Reference

`#include <obolistwidget.h>`

Inheritance diagram for pappso::OboListWidget:

## Signals

void | oboTermChanged (OboPsiModTerm oboTerm) const

## Public Member Functions

| OboListWidget (QWidget *parent=nullptr)
| ~OboListWidget ()
void | filterMzPrecision (double target_mz, PrecisionPtr precision)
double | getMzTarget () const
| get the current mz value used to filter term list
PrecisionPtr | getPrecisionPtr () const
| get the current precision used to filter term list

## Private Slots

void | onSelectionChanged (const QItemSelection &selected, const QItemSelection &deselected)
void | onFilterChanged (pappso::PrecisionPtr precision)
void | onFilterChanged ()
void | onFilterChanged (double value)

## Private Attributes

Ui::OboListWidgetForm * | ui
OboListModel * | mpa_oboListModel = nullptr
OboListProxyModel * | mpa_oboListProxyModel = nullptr

## Detailed Description

Definition at line 49 of file obolistwidget.h.

## Constructor & Destructor Documentation

## OboListWidget()

OboListWidget::OboListWidget | ( | QWidget * | parent = `nullptr` | ) |

explicit

Default constructor

Definition at line 38 of file obolistwidget.cpp.

: QWidget(parent), ui(new Ui::OboListWidgetForm)
{
qDebug();
ui->setupUi(this);
mpa_oboListModel = new OboListModel(this);
mpa_oboListModel->loadPsiMod();
mpa_oboListProxyModel = new OboListProxyModel(mpa_oboListModel, this);
mpa_oboListProxyModel->setSourceModel(mpa_oboListModel);
// mpa_oboListProxyModel->setSortRole(Qt::UserRole);
ui->oboTermListView->setModel(mpa_oboListProxyModel);
mpa_oboListProxyModel->sort(Qt::AscendingOrder);
connect(ui->oboTermListView->selectionModel(),
&QItemSelectionModel::selectionChanged,
this,
&OboListWidget::onSelectionChanged);
}
pappso::OboListModel
Definition obolistmodel.h:46
pappso::OboListModel::loadPsiMod
void loadPsiMod()
Definition obolistmodel.cpp:67
pappso::OboListProxyModel
Definition obolistproxymodel.h:43
pappso::OboListWidget::ui
Ui::OboListWidgetForm * ui
Definition obolistwidget.h:87
pappso::OboListWidget::mpa_oboListProxyModel
OboListProxyModel * mpa_oboListProxyModel
Definition obolistwidget.h:90
pappso::OboListWidget::onSelectionChanged
void onSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected)
Definition obolistwidget.cpp:75
pappso::OboListWidget::mpa_oboListModel
OboListModel * mpa_oboListModel
Definition obolistwidget.h:89

References pappso::OboListModel::loadPsiMod(), mpa_oboListModel, mpa_oboListProxyModel, onSelectionChanged(), and ui.

## ~OboListWidget()

OboListWidget::~OboListWidget | ( |  | ) |

Destructor

Definition at line 61 of file obolistwidget.cpp.

{
delete ui;
if(mpa_oboListProxyModel != nullptr)
{
delete mpa_oboListProxyModel;
}
if(mpa_oboListModel != nullptr)
{
delete mpa_oboListModel;
}
}

References mpa_oboListModel, mpa_oboListProxyModel, and ui.

## Member Function Documentation

## filterMzPrecision()

void pappso::OboListWidget::filterMzPrecision | ( | double | target_mz,
|  | pappso::PrecisionPtr | precision
| ) |  |

Definition at line 93 of file obolistwidget.cpp.

{
qDebug();
mpa_oboListProxyModel->filterMzPrecision(target_mz, precision);
if(precision == nullptr)
{
ui->massFilterGroupBox->setChecked(false);
ui->mzSpinBox->setValue(target_mz);
}
else
{
ui->massFilterGroupBox->setChecked(true);
ui->precisionWidget->setPrecision(precision);
ui->mzSpinBox->setValue(target_mz);
}
}
pappso::OboListProxyModel::filterMzPrecision
void filterMzPrecision(double target_mz, PrecisionPtr precision)
Definition obolistproxymodel.cpp:63

## getMzTarget()

double pappso::OboListWidget::getMzTarget | ( |  | ) | const

get the current mz value used to filter term list

Definition at line 149 of file obolistwidget.cpp.

{
return ui->mzSpinBox->value();
}

## getPrecisionPtr()

pappso::PrecisionPtr pappso::OboListWidget::getPrecisionPtr | ( |  | ) | const

get the current precision used to filter term list

Definition at line 155 of file obolistwidget.cpp.

{
if(ui->massFilterGroupBox->isChecked())
{
return ui->precisionWidget->getPrecision();
}
return nullptr;
}

## oboTermChanged

void pappso::OboListWidget::oboTermChanged | ( | OboPsiModTerm | oboTerm | ) | const

signal

Referenced by pappso::OboChooserWidget::OboChooserWidget().

## onFilterChanged [1/3]

void pappso::OboListWidget::onFilterChanged | ( |  | ) |

private slot

Definition at line 112 of file obolistwidget.cpp.

{
qDebug();
if(ui->massFilterGroupBox->isChecked())
{
mpa_oboListProxyModel->filterMzPrecision(
ui->mzSpinBox->value(), ui->precisionWidget->getPrecision());
}
else
{
mpa_oboListProxyModel->filterMzPrecision(0, nullptr);
}
}

## onFilterChanged [2/3]

void pappso::OboListWidget::onFilterChanged | ( | double | value | ) |

private slot

Definition at line 127 of file obolistwidget.cpp.

{
qDebug();
if(ui->massFilterGroupBox->isChecked())
{
mpa_oboListProxyModel->filterMzPrecision(
ui->mzSpinBox->value(), ui->precisionWidget->getPrecision());
}
else
{
mpa_oboListProxyModel->filterMzPrecision(0, nullptr);
}
}

## onFilterChanged [3/3]

void pappso::OboListWidget::onFilterChanged | ( | pappso::PrecisionPtr | precision | ) |

private slot

Definition at line 142 of file obolistwidget.cpp.

{
onFilterChanged();
}
pappso::OboListWidget::onFilterChanged
void onFilterChanged()
Definition obolistwidget.cpp:112

## onSelectionChanged

void pappso::OboListWidget::onSelectionChanged | ( | const QItemSelection & | selected,
|  | const QItemSelection & | deselected
| ) |  |

private slot

Definition at line 75 of file obolistwidget.cpp.

{
QModelIndexList index_list =
mpa_oboListProxyModel->mapSelectionToSource(selected).indexes();
if(index_list.size() > 0)
{
QModelIndex index = index_list.first();
OboPsiModTerm term =
mpa_oboListModel->data(index, Qt::UserRole).value<OboPsiModTerm>();
qDebug() << term.m_accession;
emit oboTermChanged(term);
}
}
pappso::OboListModel::data
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
Definition obolistmodel.cpp:76
pappso::OboListWidget::oboTermChanged
void oboTermChanged(OboPsiModTerm oboTerm) const
pappso::OboPsiModTerm
Definition obopsimodterm.h:32
pappso::OboPsiModTerm::m_accession
QString m_accession
Definition obopsimodterm.h:48

References pappso::OboPsiModTerm::m_accession.

Referenced by OboListWidget().

## Member Data Documentation

## mpa_oboListModel

OboListModel* pappso::OboListWidget::mpa_oboListModel = nullptr

private

Definition at line 89 of file obolistwidget.h.

Referenced by OboListWidget(), and ~OboListWidget().

## mpa_oboListProxyModel

OboListProxyModel* pappso::OboListWidget::mpa_oboListProxyModel = nullptr

private

Definition at line 90 of file obolistwidget.h.

Referenced by OboListWidget(), and ~OboListWidget().

## ui

Ui::OboListWidgetForm* pappso::OboListWidget::ui

private

Definition at line 87 of file obolistwidget.h.

Referenced by OboListWidget(), and ~OboListWidget().

The documentation for this class was generated from the following files:

- pappsomspp/widget/obo/obolistwidget/obolistwidget.h
- pappsomspp/widget/obo/obolistwidget/obolistwidget.cpp