Loading...
Searching...
No Matches
obolistmodel.h
Go to the documentation of this file.
/**
* \file pappsomspp/widget/obo/obolistwidget/obolistmodel.h
* \date 19/04/2021
* \author Olivier Langella
* \brief MVC model of OBO term list
*/
/*******************************************************************************
* Copyright (c) 2021 Olivier Langella
*<Olivier.Langella@universite-paris-saclay.fr>.
*
* This file is part of the PAPPSOms++ library.
*
* PAPPSOms++ is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* PAPPSOms++ is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with PAPPSOms++. If not, see <http://www.gnu.org/licenses/>.
*
******************************************************************************/
#pragma once
#include <QStringListModel>
#include "pappsomspp/export-import-config.h"
#include "../../../core/obo/obopsimodterm.h"
#include "../../../core/obo/obopsimodhandlerinterface.h"
#include <vector>
namespace pappso
{
/**
* @todo write docs
*/
class PMSPP_LIB_DECL OboListModel : public QStringListModel
{
public:
/**
* Default constructor
*/
OboListModel(QObject *parent = nullptr);
/**
* Destructor
*/
~OboListModel();
void loadPsiMod();
QVariant data(const QModelIndex &index,
int role = Qt::DisplayRole) const override;
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
const OboPsiModTerm &getOboPsiModTerm(int row) const;
protected:
class OboPsiModHandler : public OboPsiModHandlerInterface
{
public:
OboPsiModHandler(OboListModel *parent);
virtual ~OboPsiModHandler();
void setOboPsiModTerm(const OboPsiModTerm &term) override;
private:
pappso::OboListModel *mp_parent;
};
std::vector<OboPsiModTerm> m_oboPsiModTermList;
};
} // namespace pappso
pappso::OboListModel::OboPsiModHandler::mp_parent
pappso::OboListModel * mp_parent
Definition obolistmodel.h:80
pappso::OboListModel::OboPsiModHandler::OboPsiModHandler
OboPsiModHandler(OboListModel *parent)
Definition obolistmodel.cpp:50
pappso::OboListModel::OboPsiModHandler::setOboPsiModTerm
void setOboPsiModTerm(const OboPsiModTerm &term) override
triggered function on each obo term when parsing obo file
Definition obolistmodel.cpp:60
pappso::OboListModel
Definition obolistmodel.h:46
pappso::OboListModel::data
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
Definition obolistmodel.cpp:89
pappso::OboListModel::getOboPsiModTerm
const OboPsiModTerm & getOboPsiModTerm(int row) const
Definition obolistmodel.cpp:138
pappso::OboListModel::OboListModel
OboListModel(QObject *parent=nullptr)
Definition obolistmodel.cpp:42
pappso::OboListModel::m_oboPsiModTermList
std::vector< OboPsiModTerm > m_oboPsiModTermList
Definition obolistmodel.h:83
pappso::OboListModel::rowCount
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Definition obolistmodel.cpp:132
pappso::OboListModel::loadPsiMod
void loadPsiMod()
Definition obolistmodel.cpp:67
pappso::OboPsiModHandlerInterface
Definition obopsimodhandlerinterface.h:31
pappso::OboPsiModTerm
Definition obopsimodterm.h:34
export-import-config.h
PMSPP_LIB_DECL
#define PMSPP_LIB_DECL
Definition export-import-config.h:14
pappso
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition aa.cpp:39
obopsimodhandlerinterface.h
obopsimodterm.h