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

get a PDF of the protein sequence

parent 46f6dd0d
No related branches found
No related tags found
No related merge requests found
......@@ -206,7 +206,7 @@
</sizepolicy>
</property>
<property name="text">
<string>get SVG</string>
<string>get PDF</string>
</property>
</widget>
</item>
......
......@@ -24,6 +24,7 @@
#include "proteinwindow.h"
#include "../project_view/projectwindow.h"
#include "ui_protein_detail_view.h"
#include "../../core/proteinmatch.h"
#include <pappsomspp/pappsoexception.h>
#include <QMessageBox>
#include <QDesktopServices>
......@@ -183,14 +184,16 @@ void ProteinWindow::doSaveSvg() {
QFont font("Monospace");
font.setStyleHint(QFont::Monospace);
font.setLetterSpacing(QFont::AbsoluteSpacing,0);
font.setPointSize(16); //generator.setDefaultFont(font);
font.setPointSize(10); //generator.setDefaultFont(font);
QTextOption text_option;
text_option.setWrapMode(QTextOption::WrapAnywhere);
text_option.setFlags(QTextOption::IncludeTrailingSpaces|QTextOption::ShowTabsAndSpaces);
text_option.setUseDesignMetrics(0);
QTextDocument *doc = ui->sequenceTextEdit->document()->clone();
//QTextDocument *doc = ui->sequenceTextEdit->document()->clone();
QTextDocument *doc = new QTextDocument();
doc->setHtml(QString("<p>%1</p><p>%2</p><p>%3</p>").arg(_p_protein_match->getProteinXtpSp().get()->getAccession()).arg(_p_protein_match->getProteinXtpSp().get()->getDescription()).arg(ui->sequenceTextEdit->toHtml()));
doc->setUndoRedoEnabled(false);
//doc->setHtml("<p><span style=\"color:#000000; font-weight:600\">"+text_x+"</span></p>");
doc->setTextWidth(printer.pageRect().size().width());
......
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