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

trying to render sequence : not bad

parent 15240dac
No related branches found
No related tags found
No related merge requests found
......@@ -28,7 +28,7 @@
#include "ptmsequencedelegate.h"
#include "../../grouping/ptm/ptmsamplescan.h"
#include <QTextEdit>
#include <QTextDocument>
#include <QPainter>
PtmSequenceDelegate::PtmSequenceDelegate(QWidget *parent) : QStyledItemDelegate(parent) {
......@@ -43,13 +43,13 @@ void PtmSequenceDelegate::paint(QPainter *painter, const QStyleOptionViewItem &o
// if (option.state & QStyle::State_Selected)
// painter->fillRect(option.rect, option.palette.highlight());
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();
QTextDocument document;
document.setDocumentMargin(2);
document.setHtml(p_ptm_sample_scan->getRepresentativePeptideMatch()->getPeptideXtpSp().get()->getSequence());
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);
......
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