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

`#include <httpbutton.h>`

Inheritance diagram for pappso::HttpButton:

## Public Member Functions

| HttpButton (QWidget *parent=nullptr)
| ~HttpButton ()
void | setText (const QString &text)

## Protected Member Functions

void | mousePressEvent (QMouseEvent *e) override
const QUrl | getOlsUrl (QString psimod_accession)
const QUrl | getPubMedUrl (QString accession)
const QUrl | getRESIDUrl (QString accession)
const QUrl | getChEBIUrl (QString accession)
const QUrl | getUnimodUrl (QString accession)

## Detailed Description

Definition at line 40 of file httpbutton.h.

## Constructor & Destructor Documentation

## HttpButton()

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

explicit

Default constructor

Definition at line 38 of file httpbutton.cpp.

: QPushButton(parent)
{
qDebug();
}

## ~HttpButton()

pappso::HttpButton::~HttpButton | ( |  | ) |

Destructor

Definition at line 43 of file httpbutton.cpp.

{
}

## Member Function Documentation

## getChEBIUrl()

const QUrl HttpButton::getChEBIUrl | ( | QString | accession | ) |

protected

Definition at line 124 of file httpbutton.cpp.

{
// ChEBI:37629
// https://www.ebi.ac.uk/chebi/searchId.do?chebiId=37628
QUrl url(QString("https://www.ebi.ac.uk/chebi/searchId.do?chebiId=%1")
.arg(accession.replace("ChEBI:", "")));
return url;
}

## getOlsUrl()

const QUrl HttpButton::getOlsUrl | ( | QString | psimod_accession | ) |

protected

Definition at line 93 of file httpbutton.cpp.

{
QString iri(QString("http://purl.obolibrary.org/obo/%1")
.arg(psimod_accession.replace(":", "_")));
QUrl url(
QString("http://www.ebi.ac.uk/ols/ontologies/mod/terms?iri=%1").arg(iri));
return url;
}

## getPubMedUrl()

const QUrl HttpButton::getPubMedUrl | ( | QString | accession | ) |

protected

Definition at line 104 of file httpbutton.cpp.

{
// https://pubmed.ncbi.nlm.nih.gov/18688235/
QUrl url(QString("https://pubmed.ncbi.nlm.nih.gov/%1/")
.arg(accession.replace("PubMed:", "")));
return url;
}

## getRESIDUrl()

const QUrl HttpButton::getRESIDUrl | ( | QString | accession | ) |

protected

Definition at line 114 of file httpbutton.cpp.

{
// https://annotation.dbi.udel.edu/cgi-bin/resid?id=AA0470
QUrl url(QString("https://annotation.dbi.udel.edu/cgi-bin/resid?id=%1")
.arg(accession.replace("RESID:", "")));
return url;
}

## getUnimodUrl()

const QUrl HttpButton::getUnimodUrl | ( | QString | accession | ) |

protected

Definition at line 135 of file httpbutton.cpp.

{
// Unimod:23
// http://www.unimod.org/modifications_view.php?editid1=23
QUrl url(QString("http://www.unimod.org/modifications_view.php?editid1=%1")
.arg(accession.replace("Unimod:", "")));
return url;
}

## mousePressEvent()

void pappso::HttpButton::mousePressEvent | ( | QMouseEvent * | e | ) |

override protected

Definition at line 48 of file httpbutton.cpp.

{
if(!text().isEmpty())
{
if(text().startsWith("MOD:"))
{
QDesktopServices::openUrl(getOlsUrl(this->text()));
// qDebug() << getOlsUrl(this->text());
}
else if(text().startsWith("PubMed:"))
{
QDesktopServices::openUrl(getPubMedUrl(this->text()));
// qDebug() << getPubMedUrl(this->text());
}
else if(text().startsWith("RESID:"))
{
QDesktopServices::openUrl(getRESIDUrl(this->text()));
// qDebug() << getPubMedUrl(this->text());
}
else if(text().startsWith("ChEBI:"))
{
QDesktopServices::openUrl(getChEBIUrl(this->text()));
// qDebug() << getPubMedUrl(this->text());
}
else if(text().startsWith("Unimod:"))
{
QDesktopServices::openUrl(getUnimodUrl(this->text()));
// qDebug() << getPubMedUrl(this->text());
}
else
{
qDebug() << "unknown" << this->text();
}
}
QPushButton::mousePressEvent(e);
}
pappso::HttpButton::getUnimodUrl
const QUrl getUnimodUrl(QString accession)
Definition httpbutton.cpp:135
pappso::HttpButton::getRESIDUrl
const QUrl getRESIDUrl(QString accession)
Definition httpbutton.cpp:114
pappso::HttpButton::getChEBIUrl
const QUrl getChEBIUrl(QString accession)
Definition httpbutton.cpp:124
pappso::HttpButton::getOlsUrl
const QUrl getOlsUrl(QString psimod_accession)
Definition httpbutton.cpp:93
pappso::HttpButton::getPubMedUrl
const QUrl getPubMedUrl(QString accession)
Definition httpbutton.cpp:104

## setText()

void pappso::HttpButton::setText | ( | const QString & | text | ) |

Definition at line 86 of file httpbutton.cpp.

{
QPushButton::setText(text);
}

Referenced by pappso::OboTermForm::parseDefinitionLabel().

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

- pappsomspp/widget/httpbutton/httpbutton.h
- pappsomspp/widget/httpbutton/httpbutton.cpp