diff options
Diffstat (limited to 'client/resumewidget.cc')
-rw-r--r-- | client/resumewidget.cc | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/client/resumewidget.cc b/client/resumewidget.cc index 80643db..b991ccf 100644 --- a/client/resumewidget.cc +++ b/client/resumewidget.cc @@ -27,16 +27,46 @@ #include "resumewidget.h" #include <QHBoxLayout> +#include <QBoxLayout> + +//#define RICH ResumeWidget::ResumeWidget() { setLayout(new QHBoxLayout()); - resume = new QLabel(); + layout()->setContentsMargins(10,2,2,2); + resume = new QLabel("Endnu ikke udfyldt"); + +#ifdef RICH + resume->setTextFormat(Qt::RichText); +#endif + resume->setWordWrap(true); + resume->setEnabled(false); + /* + resume->setFixedWidth(300); + ((QBoxLayout*)layout())->addStretch(); + */ layout()->addWidget(resume); } void ResumeWidget::setText(QString text) { + resume->setEnabled(true); + +#ifdef RICH + QString f; + + for(int i = 0; i < text.length(); i++) { + if(text[i] >= '0' && text[i] <= '9') f += "<font style='color: #55F;'>" + text[i] + "</font>"; + else if(text[i] == '\n') f += "<br/>"; + else if(text[i] == ' ') f += " "; + else f += text[i]; + } + + resume->setText(f); + resume->setWordWrap(true); +#else resume->setText(text); +#endif } |