From 15240daca577782d8b407b820cec1e6f32c0faca Mon Sep 17 00:00:00 2001 From: Olivier Langella <Olivier.Langella@moulon.inra.fr> Date: Sat, 29 Jul 2017 22:53:07 +0200 Subject: [PATCH] trying to render sequence --- src/gui/ptm_peptide_list_view/ptmsequencedelegate.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/gui/ptm_peptide_list_view/ptmsequencedelegate.cpp b/src/gui/ptm_peptide_list_view/ptmsequencedelegate.cpp index f7a38cc7..1c594a10 100644 --- a/src/gui/ptm_peptide_list_view/ptmsequencedelegate.cpp +++ b/src/gui/ptm_peptide_list_view/ptmsequencedelegate.cpp @@ -29,6 +29,7 @@ #include "ptmsequencedelegate.h" #include "../../grouping/ptm/ptmsamplescan.h" #include <QTextEdit> +#include <QPainter> PtmSequenceDelegate::PtmSequenceDelegate(QWidget *parent) : QStyledItemDelegate(parent) { @@ -42,8 +43,14 @@ void PtmSequenceDelegate::paint(QPainter *painter, const QStyleOptionViewItem &o // if (option.state & QStyle::State_Selected) // painter->fillRect(option.rect, option.palette.highlight()); - //QTextEdit edit; - + QTextEdit edit_seq; + edit_seq.setPlainText(p_ptm_sample_scan->getRepresentativePeptideMatch()->getPeptideXtpSp().get()->getSequence()); + + painter->save(); + painter->translate(option.rect.x(), option.rect.y()); + edit_seq.render(painter); + painter->restore(); + //edit_seq.render(painter); //edit..paint(painter, option.rect, option.palette, // StarRating::ReadOnly); } else { -- GitLab