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

WIP: trying to display html ptm scan sequences

parent cc48fd86
No related branches found
No related tags found
No related merge requests found
......@@ -202,7 +202,7 @@ MESSAGE("XTPCPP_SRCS: ${XTPCPP_SRCS}")
ADD_EXECUTABLE(xtpcpp main.cpp ${CPP_FILES} ${XTPCPP_SRCS} ${GUI_UI_HDRS} ${XTPCPP_MOC_SRCS} ${xtpcpp_RCC_SRCS})
target_include_directories (xtpcpp PUBLIC ${Pwiz_INCLUDE_DIR} ${PAPPSOMSPP_INCLUDE_DIR} ${ODSSTREAM_INCLUDE_DIR}
${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${QT_QTGUI_INCLUDE_DIR}
${CMAKE_CURRENT_BINARY_DIR}/gui/peptide_detail_view/spectrum_widget ${CMAKE_CURRENT_SOURCE_DIR}/gui/peptide_detail_view/spectrum_widget)
target_compile_definitions(xtpcpp PUBLIC ${QT_DEFINITIONS})
......
......@@ -29,9 +29,35 @@
#include "ptmpeptidetableproxymodel.h"
#include "ptmpeptidetablemodel.h"
#include "ptmpeptidelistwindow.h"
#include <QTextDocument>
PtmPeptideMenuQicon::PtmPeptideMenuQicon( const PtmSampleScan * p_ptm_sample, const PeptideMatch * p_peptide_match):QIcon() {
_p_ptm_sample_scan = p_ptm_sample;
_p_peptide_match = p_peptide_match;
}
PtmPeptideMenuQicon::~PtmPeptideMenuQicon( ) {
}
void PtmPeptideMenuQicon::paint(QPainter *painter, const QRect &rect, Qt::Alignment alignment, Mode mode, State state) const
{
// if (option.state & QStyle::State_Selected)
// painter->fillRect(option.rect, option.palette.highlight());
QTextDocument document;
document.setDocumentMargin(2);
//document.setHtml(_p_ptm_sample_scan->getHtmlSequence(_p_ptm_island_list_window->getIdentificationGroup()-//>getPtmGroupingExperiment()));
//painter->translate(option.rect.topLeft());
document.drawContents(painter);
//painter->translate(-option.rect.topLeft());
//edit_seq.render(painter);
//edit..paint(painter, option.rect, option.palette,
// StarRating::ReadOnly);
}
PtmPeptideMenuQaction::PtmPeptideMenuQaction(PtmPeptideTableProxyModel * parent, const PtmSampleScan * p_ptm_sample, const PeptideMatch * p_peptide_match):QAction(parent) {
this->setIcon(PtmPeptideMenuQicon(p_ptm_sample, p_peptide_match));
this->setText(p_peptide_match->getPeptideXtpSp().get()->getSequence());
//evalue_action.setChecked(_display_evalue);
//connect(p_action, SIGNAL(toggled(bool)), this, SLOT(showEvalueColumn(bool)));
......
......@@ -32,6 +32,7 @@
#include <QAbstractTableModel>
#include <QSortFilterProxyModel>
#include <QMenu>
#include <QIcon>
#include "../../grouping/ptm/ptmsamplescan.h"
......@@ -39,6 +40,19 @@ class PtmPeptideListWindow;
class PtmPeptideTableModel;
class PtmPeptideTableProxyModel;
class PtmPeptideMenuQicon: public QIcon {
public:
explicit PtmPeptideMenuQicon(const PtmSampleScan * p_ptm_sample, const PeptideMatch * p_peptide_match);
~PtmPeptideMenuQicon();
void paint(QPainter *painter, const QRect &rect, Qt::Alignment alignment = Qt::AlignCenter, Mode mode = Normal, State state = Off) const;
private:
const PtmSampleScan * _p_ptm_sample_scan;
const PeptideMatch * _p_peptide_match;
};
class PtmPeptideMenuQaction: public QAction {
Q_OBJECT
public:
......@@ -58,7 +72,7 @@ public:
~PtmPeptideTableProxyModel();
protected:
bool lessThan(const QModelIndex &left, const QModelIndex &right) const override;
bool lessThan(const QModelIndex &left, const QModelIndex &right) const override;
void showContextMenu(const QModelIndex &index);
private:
PtmPeptideListWindow * _p_ptm_peptide_list_window;
......
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