DCO Remediation Commit for cullvox <cullvox@outlook.com>
I, cullvox <cullvox@outlook.com>, hereby add my Signed-off-by to this commit: c81689d39322d5ea5c7ed0073d73e4d8d2446b33 Signed-off-by: cullvox <cullvox@outlook.com>
This commit is contained in:
parent
07645984b5
commit
4053229544
@ -36,8 +36,9 @@
|
|||||||
|
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QToolTip>
|
|
||||||
#include <QTextCursor>
|
#include <QTextCursor>
|
||||||
|
#include <QTextDocument>
|
||||||
|
#include <QToolTip>
|
||||||
|
|
||||||
#include "InfoFrame.h"
|
#include "InfoFrame.h"
|
||||||
#include "ui_InfoFrame.h"
|
#include "ui_InfoFrame.h"
|
||||||
@ -276,16 +277,14 @@ void InfoFrame::setDescription(QString text)
|
|||||||
QString labeltext;
|
QString labeltext;
|
||||||
labeltext.reserve(300);
|
labeltext.reserve(300);
|
||||||
|
|
||||||
|
|
||||||
// elide rich text by getting characters without formatting
|
// elide rich text by getting characters without formatting
|
||||||
const int maxCharacterElide = 290;
|
const int maxCharacterElide = 290;
|
||||||
QTextDocument doc;
|
QTextDocument doc;
|
||||||
doc.setHtml(text);
|
doc.setHtml(text);
|
||||||
|
|
||||||
if (doc.characterCount() > maxCharacterElide) {
|
if (doc.characterCount() > maxCharacterElide) {
|
||||||
|
|
||||||
ui->descriptionLabel->setOpenExternalLinks(false);
|
ui->descriptionLabel->setOpenExternalLinks(false);
|
||||||
ui->descriptionLabel->setTextFormat(Qt::TextFormat::RichText); // This allows injecting HTML here.
|
ui->descriptionLabel->setTextFormat(Qt::TextFormat::RichText); // This allows injecting HTML here.
|
||||||
m_description = text;
|
m_description = text;
|
||||||
|
|
||||||
const QString elidedPostfix = "<a href=\"#mod_desc\">...</a>";
|
const QString elidedPostfix = "<a href=\"#mod_desc\">...</a>";
|
||||||
@ -298,7 +297,7 @@ void InfoFrame::setDescription(QString text)
|
|||||||
|
|
||||||
// insert the post fix at the cursor
|
// insert the post fix at the cursor
|
||||||
cursor.insertHtml(elidedPostfix);
|
cursor.insertHtml(elidedPostfix);
|
||||||
|
|
||||||
labeltext.append(doc.toHtml());
|
labeltext.append(doc.toHtml());
|
||||||
QObject::connect(ui->descriptionLabel, &QLabel::linkActivated, this, &InfoFrame::descriptionEllipsisHandler);
|
QObject::connect(ui->descriptionLabel, &QLabel::linkActivated, this, &InfoFrame::descriptionEllipsisHandler);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user